Adding RFC3339 times
This commit is contained in:
parent
01f3e3ca1e
commit
a0d2761c4e
|
@ -70,12 +70,14 @@ import (
|
|||
|
||||
// BuildNode builds a node to send to MQ instance.
|
||||
func BuildNode(flag string, data CertStreamStruct) (*Node, error) {
|
||||
t := time.Now()
|
||||
rfc3339time := t.Format(time.RFC3339)
|
||||
return &Node{
|
||||
ID: flag + "--" + uuid.New().String(),
|
||||
Type: flag,
|
||||
Data: data,
|
||||
Created: time.Now(),
|
||||
Modified: time.Now(),
|
||||
Created: rfc3339time,
|
||||
Modified: rfc3339time,
|
||||
}, nil
|
||||
|
||||
}
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
|
@ -13,8 +11,8 @@ type Node struct {
|
|||
ID string `json:"id"`
|
||||
Type string `json:"type"`
|
||||
Data CertStreamStruct `json:"data"`
|
||||
Created time.Time `json:"created"`
|
||||
Modified time.Time `json:"modified"`
|
||||
Created string `json:"created"`
|
||||
Modified string `json:"modified"`
|
||||
}
|
||||
|
||||
// Edge defines a relation between two nodes.
|
||||
|
@ -22,9 +20,10 @@ type Edge struct {
|
|||
ID string `json:"id"`
|
||||
NodeOneID uuid.UUID `json:"NodeOneID"`
|
||||
// NodeTwoID uuid.UUID `json:NodeTwoID` to implement
|
||||
Timestamp time.Time `json:"Timestamp"`
|
||||
Timestamp string `json:"Timestamp"`
|
||||
}
|
||||
|
||||
// LeafCertExtensions extends the LeafCert object.
|
||||
type LeafCertExtensions struct {
|
||||
KeyUsage string `json:"keyUsage"`
|
||||
ExtendedKeyUsage string `json:"extendedKeyUsage"`
|
||||
|
|
Loading…
Reference in a new issue