Changing IDs to stix compatible format

This commit is contained in:
Christopher Talib 2020-01-16 12:06:03 +01:00
parent 1b25c25aa7
commit e6cbfc6466
2 changed files with 8 additions and 6 deletions

View file

@ -48,8 +48,8 @@ func SaveData(flag string, data CertStreamStruct) {
// json.Unmarshal(data, &res)
node := &Node{
ID: uuid.New(),
Flag: flag,
ID: flag + "--" + uuid.New().String(),
Type: flag,
Data: data,
}

View file

@ -6,16 +6,18 @@ import (
"github.com/google/uuid"
)
// Node defines the data we gather through the parsing.
// Node defines the data we gather through the parsing. It should follow the
// Styx terminology
// (https://docs.google.com/document/d/1dIrh1Lp3KAjEMm8o2VzAmuV0Peu-jt9aAh1IHrjAroM/pub#h.xzbicbtscatx)
type Node struct {
ID uuid.UUID
Flag string `json:"flag"`
ID string `json:"id"`
Type string `json:"type"`
Data CertStreamStruct `json:"data"`
}
// Edge defines a relation between two nodes.
type Edge struct {
ID uuid.UUID
ID string `json:"id"`
NodeOneID uuid.UUID `json:"NodeOneID"`
// NodeTwoID uuid.UUID `json:NodeTwoID` to implement
Timestamp time.Time `json:"Timestamp"`