this repo has no description
0
fork

Configure Feed

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

add struct field annotations that can be used with go-dasl/drisl

+36 -36
+6 -6
atproto/data/blob.go
··· 22 22 } 23 23 24 24 type LegacyBlobSchema struct { 25 - Cid string `json:"cid" cborgen:"cid"` 26 - MimeType string `json:"mimeType" cborgen:"mimeType"` 25 + Cid string `json:"cid" cbor:"cid" cborgen:"cid"` 26 + MimeType string `json:"mimeType" cbor:"mimeType" cborgen:"mimeType"` 27 27 } 28 28 29 29 type BlobSchema struct { 30 - LexiconTypeID string `json:"$type" cborgen:"$type,const=blob"` 31 - Ref CIDLink `json:"ref" cborgen:"ref"` 32 - MimeType string `json:"mimeType" cborgen:"mimeType"` 33 - Size int64 `json:"size" cborgen:"size"` 30 + LexiconTypeID string `json:"$type" cbor:"$type" cborgen:"$type,const=blob"` 31 + Ref CIDLink `json:"ref" cbor:"ref" cborgen:"ref"` 32 + MimeType string `json:"mimeType" cbor:"mimeType" cborgen:"mimeType"` 33 + Size int64 `json:"size" cbor:"size" cborgen:"size"` 34 34 } 35 35 36 36 func (b Blob) MarshalJSON() ([]byte, error) {
+1 -1
atproto/data/extract.go
··· 9 9 10 10 // Helper type for extracting record $type from CBOR 11 11 type GenericRecord struct { 12 - Type string `json:"$type" cborgen:"$type"` 12 + Type string `json:"$type" cbor:"$type" cborgen:"$type"` 13 13 } 14 14 15 15 // Parses the top-level $type field from generic atproto JSON data
+9 -9
atproto/label/label.go
··· 14 14 const ATPROTO_LABEL_VERSION int64 = 1 15 15 16 16 type Label struct { 17 - CID *string `json:"cid,omitempty" cborgen:"cid,omitempty"` 18 - CreatedAt string `json:"cts" cborgen:"cts"` 19 - ExpiresAt *string `json:"exp,omitempty" cborgen:"exp,omitempty"` 20 - Negated *bool `json:"neg,omitempty" cborgen:"neg,omitempty"` 21 - SourceDID string `json:"src" cborgen:"src"` 22 - URI string `json:"uri" cborgen:"uri"` 23 - Val string `json:"val" cborgen:"val"` 24 - Version int64 `json:"ver" cborgen:"ver"` 25 - Sig data.Bytes `json:"sig,omitempty" cborgen:"sig,omitempty"` 17 + CID *string `json:"cid,omitempty" cbor:"cid,omitempty" cborgen:"cid,omitempty"` 18 + CreatedAt string `json:"cts" cbor:"cts" cborgen:"cts"` 19 + ExpiresAt *string `json:"exp,omitempty" cbor:"exp,omitempty" cborgen:"exp,omitempty"` 20 + Negated *bool `json:"neg,omitempty" cbor:"neg,omitempty" cborgen:"neg,omitempty"` 21 + SourceDID string `json:"src" cbor:"src" cborgen:"src"` 22 + URI string `json:"uri" cbor:"uri" cborgen:"uri"` 23 + Val string `json:"val" cbor:"val" cborgen:"val"` 24 + Version int64 `json:"ver" cbor:"ver" cborgen:"ver"` 25 + Sig data.Bytes `json:"sig,omitempty" cbor:"sig,omitempty" cborgen:"sig,omitempty"` 26 26 } 27 27 28 28 // converts to map[string]any for printing as JSON
+6 -6
atproto/repo/commit.go
··· 13 13 14 14 // atproto repo commit object as a struct type. Can be used for direct CBOR or JSON serialization. 15 15 type Commit struct { 16 - DID string `json:"did" cborgen:"did"` 17 - Version int64 `json:"version" cborgen:"version"` // currently: 3 18 - Prev *cid.Cid `json:"prev" cborgen:"prev"` // NOTE: omitempty would break signature verification for repo v3 19 - Data cid.Cid `json:"data" cborgen:"data"` 20 - Sig []byte `json:"sig,omitempty" cborgen:"sig,omitempty"` 21 - Rev string `json:"rev,omitempty" cborgen:"rev,omitempty"` 16 + DID string `json:"did" cbor:"did" cborgen:"did"` 17 + Version int64 `json:"version" cbor:"version" cborgen:"version"` // currently: 3 18 + Prev *cid.Cid `json:"prev" cbor:"prev" cborgen:"prev"` // NOTE: omitempty would break signature verification for repo v3 19 + Data cid.Cid `json:"data" cbor:"data" cborgen:"data"` 20 + Sig []byte `json:"sig,omitempty" cbor:"sig,omitempty" cborgen:"sig,omitempty"` 21 + Rev string `json:"rev,omitempty" cbor:"rev,omitempty" cborgen:"rev,omitempty"` 22 22 } 23 23 24 24 // does basic checks that field values and syntax are correct
+6 -6
atproto/repo/mst/encoding.go
··· 15 15 16 16 // CBOR serialization struct for a MST tree node. MST tree node as gets serialized to CBOR. Note that the CBOR fields are all single-character. 17 17 type NodeData struct { 18 - Left *cid.Cid `cborgen:"l"` // [nullable] pointer to lower-level subtree to the "left" of this path/key 19 - Entries []EntryData `cborgen:"e"` // ordered list of entries at this node 18 + Left *cid.Cid `cbor:"l" cborgen:"l"` // [nullable] pointer to lower-level subtree to the "left" of this path/key 19 + Entries []EntryData `cbor:"e" cborgen:"e"` // ordered list of entries at this node 20 20 } 21 21 22 22 // CBOR serialization struct for a single entry within a `NodeData` entry list. 23 23 type EntryData struct { 24 - PrefixLen int64 `cborgen:"p"` // count of characters shared with previous path/key in tree 25 - KeySuffix []byte `cborgen:"k"` // remaining part of path/key (appended to "previous key") 26 - Value cid.Cid `cborgen:"v"` // CID pointer at this path/key 27 - Right *cid.Cid `cborgen:"t"` // [nullable] pointer to lower-level subtree to the "right" of this path/key entry 24 + PrefixLen int64 `cbor:"p" cborgen:"p"` // count of characters shared with previous path/key in tree 25 + KeySuffix []byte `cbor:"k" cborgen:"k"` // remaining part of path/key (appended to "previous key") 26 + Value cid.Cid `cbor:"v" cborgen:"v"` // CID pointer at this path/key 27 + Right *cid.Cid `cbor:"t" cborgen:"t"` // [nullable] pointer to lower-level subtree to the "right" of this path/key entry 28 28 } 29 29 30 30 // Encodes a single `NodeData` struct as CBOR bytes. Does not recursively encode or update children.
+6 -6
lex/util/lex_types.go
··· 145 145 } 146 146 147 147 type LegacyBlob struct { 148 - Cid string `json:"cid" cborgen:"cid"` 149 - MimeType string `json:"mimeType" cborgen:"mimeType"` 148 + Cid string `json:"cid" cbor:"cid" cborgen:"cid"` 149 + MimeType string `json:"mimeType" cbor:"mimeType" cborgen:"mimeType"` 150 150 } 151 151 152 152 type BlobSchema struct { 153 - LexiconTypeID string `json:"$type,const=blob" cborgen:"$type,const=blob"` 154 - Ref LexLink `json:"ref" cborgen:"ref"` 155 - MimeType string `json:"mimeType" cborgen:"mimeType"` 156 - Size int64 `json:"size" cborgen:"size"` 153 + LexiconTypeID string `json:"$type" cbor:"$type" cborgen:"$type,const=blob"` 154 + Ref LexLink `json:"ref" cbor:"ref" cborgen:"ref"` 155 + MimeType string `json:"mimeType" cbor:"mimeType" cborgen:"mimeType"` 156 + Size int64 `json:"size" cbor:"size" cborgen:"size"` 157 157 } 158 158 159 159 func (b LexBlob) MarshalJSON() ([]byte, error) {
+2 -2
lex/util/util.go
··· 8 8 ) 9 9 10 10 type typeExtractor struct { 11 - Type string `json:"$type" cborgen:"$type"` 11 + Type string `json:"$type" cbor:"$type" cborgen:"$type"` 12 12 } 13 13 14 14 func TypeExtract(b []byte) (string, error) { ··· 21 21 } 22 22 23 23 type CborChecker struct { 24 - Type string `json:"$type" cborgen:"$type"` 24 + Type string `json:"$type" cbor:"$type" cborgen:"$type"` 25 25 } 26 26 27 27 func CborTypeExtract(b []byte) (string, error) {