package types import ( "time" "github.com/did-method-plc/go-didplc" "github.com/ipfs/go-cid" ) type SequencedLogEntry struct { Seq uint64 DID string Operation didplc.OpEnum CID cid.Cid Nullified bool CreatedAt time.Time } func (l SequencedLogEntry) ToDIDPLCLogEntry() didplc.LogEntry { return didplc.LogEntry{ DID: l.DID, Operation: l.Operation, CID: l.CID.String(), Nullified: l.Nullified, CreatedAt: l.CreatedAt.Format(ActualAtprotoDatetimeLayout), } } // ActualAtprotoDatetimeLayout is the format for CreatedAt timestamps // AtprotoDatetimeLayout as defined by github.com/bluesky-social/indigo/atproto/syntax omits trailing zeros in the milliseconds // This doesn't match how the official plc.directory implementation formats them, so we define that format here with trailing zeros included const ActualAtprotoDatetimeLayout = "2006-01-02T15:04:05.000Z"