this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

label-as-data helper (for JSON out)

+25
+25
atproto/label/label.go
··· 25 25 Sig data.Bytes `json:"sig,omitempty" cborgen:"sig,omitempty"` 26 26 } 27 27 28 + // converts to map[string]any for printing as JSON 29 + func (l *Label) Data() map[string]any { 30 + d := map[string]any{ 31 + "cid": c.CID, 32 + "cts": c.CreatedAt, 33 + "src": c.SourceDID, 34 + "uri": c.URI, 35 + "val": c.Val, 36 + "ver": c.Version, 37 + } 38 + if c.CID != nil { 39 + d["cid"] = c.CID 40 + } 41 + if c.ExpiresAt != nil { 42 + d["exp"] = c.ExpiresAt 43 + } 44 + if c.Negated != nil { 45 + d["neg"] = c.Negated 46 + } 47 + if c.Sig != nil { 48 + d["sig"] = data.Bytes(c.Sig) 49 + } 50 + return d 51 + } 52 + 28 53 // does basic checks on syntax and structure 29 54 func (l *Label) VerifySyntax() error { 30 55 if l.Version != ATPROTO_LABEL_VERSION {