fork of indigo with slightly nicer lexgen
0
fork

Configure Feed

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

make fmt lint

+30 -30
+2 -2
atproto/label/cbor_gen.go
··· 159 159 } 160 160 } 161 161 162 - // t.Sig ([]uint8) (slice) 162 + // t.Sig (data.Bytes) (slice) 163 163 if t.Sig != nil { 164 164 165 165 if len("sig") > 1000000 { ··· 408 408 t.Negated = &val 409 409 } 410 410 } 411 - // t.Sig ([]uint8) (slice) 411 + // t.Sig (data.Bytes) (slice) 412 412 case "sig": 413 413 414 414 maj, extra, err = cr.ReadHeader()
+10 -10
atproto/label/label.go
··· 6 6 7 7 comatproto "github.com/bluesky-social/indigo/api/atproto" 8 8 "github.com/bluesky-social/indigo/atproto/crypto" 9 - "github.com/bluesky-social/indigo/atproto/syntax" 10 9 "github.com/bluesky-social/indigo/atproto/data" 10 + "github.com/bluesky-social/indigo/atproto/syntax" 11 11 ) 12 12 13 13 // version of the label data fromat implemented by this package 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" 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"` 26 26 } 27 27 28 28 // does basic checks on syntax and structure
+17 -17
atproto/label/label_test.go
··· 30 30 }`) 31 31 32 32 var l Label 33 - if err := json.Unmarshal(labelJSON, &l); err != nil { 34 - t.Fatal(err) 35 - } 33 + if err := json.Unmarshal(labelJSON, &l); err != nil { 34 + t.Fatal(err) 35 + } 36 36 37 - assert.NoError(l.VerifySyntax()) 38 - assert.NoError(l.VerifySignature(pubkey)) 37 + assert.NoError(l.VerifySyntax()) 38 + assert.NoError(l.VerifySignature(pubkey)) 39 39 40 40 // check that signature fails after mutation 41 - l.Val = "wrong" 42 - assert.NoError(l.VerifySyntax()) 43 - assert.Error(l.VerifySignature(pubkey)) 41 + l.Val = "wrong" 42 + assert.NoError(l.VerifySyntax()) 43 + assert.Error(l.VerifySignature(pubkey)) 44 44 45 45 // version check 46 - l.Version = 0 47 - assert.Error(l.VerifySyntax()) 46 + l.Version = 0 47 + assert.Error(l.VerifySyntax()) 48 48 } 49 49 50 50 func TestParseLabel(t *testing.T) { ··· 59 59 }`) 60 60 61 61 var l Label 62 - if err := json.Unmarshal(unsignedJSON, &l); err != nil { 63 - t.Fatal(err) 64 - } 65 - assert.NoError(l.VerifySyntax()) 62 + if err := json.Unmarshal(unsignedJSON, &l); err != nil { 63 + t.Fatal(err) 64 + } 65 + assert.NoError(l.VerifySyntax()) 66 66 } 67 67 68 68 func TestSignLabel(t *testing.T) { 69 69 assert := assert.New(t) 70 70 71 71 l := Label{ 72 - Version: ATPROTO_LABEL_VERSION, 72 + Version: ATPROTO_LABEL_VERSION, 73 73 CreatedAt: "2024-10-23T17:51:19.128Z", 74 - URI: "at://did:plc:ewvi7nxzyoun6zhxrhs64oiz/app.bsky.actor.profile/self", 75 - Val: "good", 74 + URI: "at://did:plc:ewvi7nxzyoun6zhxrhs64oiz/app.bsky.actor.profile/self", 75 + Val: "good", 76 76 SourceDID: "did:plc:ewvi7nxzyoun6zhxrhs64oiz", 77 77 } 78 78
+1 -1
gen/main.go
··· 8 8 bsky "github.com/bluesky-social/indigo/api/bsky" 9 9 chat "github.com/bluesky-social/indigo/api/chat" 10 10 "github.com/bluesky-social/indigo/atproto/data" 11 + "github.com/bluesky-social/indigo/atproto/label" 11 12 atrepo "github.com/bluesky-social/indigo/atproto/repo" 12 13 atmst "github.com/bluesky-social/indigo/atproto/repo/mst" 13 - "github.com/bluesky-social/indigo/atproto/label" 14 14 "github.com/bluesky-social/indigo/events" 15 15 lexutil "github.com/bluesky-social/indigo/lex/util" 16 16 "github.com/bluesky-social/indigo/mst"