this repo has no description
0
fork

Configure Feed

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

refactor: consistent 'lexutil' naming (#58)

I might also soon recommend that we refactor the package itself to
`lex/lexutil/`, or top-level `lexutil/`.

authored by

Whyrusleeping and committed by
GitHub
e890db8a 215a0ee5

+24 -24
+2 -2
bgs/bgs.go
··· 17 17 "github.com/bluesky-social/indigo/carstore" 18 18 "github.com/bluesky-social/indigo/events" 19 19 "github.com/bluesky-social/indigo/indexer" 20 - "github.com/bluesky-social/indigo/lex/util" 20 + lexutil "github.com/bluesky-social/indigo/lex/util" 21 21 "github.com/bluesky-social/indigo/models" 22 22 "github.com/bluesky-social/indigo/plc" 23 23 "github.com/bluesky-social/indigo/repomgr" ··· 172 172 return err 173 173 } 174 174 175 - var obj util.CBOR 175 + var obj lexutil.CBOR 176 176 177 177 switch { 178 178 case evt.RepoAppend != nil:
+2 -2
gen/main.go
··· 5 5 atproto "github.com/bluesky-social/indigo/api/atproto" 6 6 bsky "github.com/bluesky-social/indigo/api/bsky" 7 7 "github.com/bluesky-social/indigo/events" 8 - "github.com/bluesky-social/indigo/lex/util" 8 + lexutil "github.com/bluesky-social/indigo/lex/util" 9 9 mst "github.com/bluesky-social/indigo/mst" 10 10 "github.com/bluesky-social/indigo/repo" 11 11 cbg "github.com/whyrusleeping/cbor-gen" ··· 32 32 panic(err) 33 33 } 34 34 35 - if err := cbg.WriteMapEncodersToFile("lex/util/cbor_gen.go", "util", util.CborChecker{}, util.Blob{}); err != nil { 35 + if err := cbg.WriteMapEncodersToFile("lex/util/cbor_gen.go", "util", lexutil.CborChecker{}, lexutil.Blob{}); err != nil { 36 36 panic(err) 37 37 } 38 38
+5 -5
notifs/notifs.go
··· 6 6 "time" 7 7 8 8 appbskytypes "github.com/bluesky-social/indigo/api/bsky" 9 - "github.com/bluesky-social/indigo/lex/util" 9 + lexutil "github.com/bluesky-social/indigo/lex/util" 10 10 "github.com/bluesky-social/indigo/models" 11 11 bsutil "github.com/bluesky-social/indigo/util" 12 12 "github.com/ipfs/go-cid" ··· 174 174 rsub := "at://" + postAuthor.Did + "/app.bsky.feed.post/" + votedOn.Rkey 175 175 176 176 return &appbskytypes.NotificationList_Notification{ 177 - Record: util.LexiconTypeDecoder{Val: rec}, 177 + Record: lexutil.LexiconTypeDecoder{Val: rec}, 178 178 IsRead: nrec.CreatedAt.Before(lastSeen), 179 179 IndexedAt: nrec.CreatedAt.Format(time.RFC3339), 180 180 Uri: "at://" + voter.Did + "/app.bsky.feed.vote/" + vote.Rkey, ··· 214 214 rsub := "at://" + postAuthor.Did + "/app.bsky.feed.post/" + reposted.Rkey 215 215 216 216 return &appbskytypes.NotificationList_Notification{ 217 - Record: util.LexiconTypeDecoder{rec}, 217 + Record: lexutil.LexiconTypeDecoder{rec}, 218 218 IsRead: nrec.CreatedAt.Before(lastSeen), 219 219 IndexedAt: nrec.CreatedAt.Format(time.RFC3339), 220 220 Uri: "at://" + reposter.Did + "/app.bsky.feed.repost/" + repost.Rkey, ··· 254 254 rsub := "at://" + opAuthor.Did + "/app.bsky.feed.post/" + replyTo.Rkey 255 255 256 256 return &appbskytypes.NotificationList_Notification{ 257 - Record: util.LexiconTypeDecoder{rec}, 257 + Record: lexutil.LexiconTypeDecoder{rec}, 258 258 IsRead: nrec.CreatedAt.Before(lastSeen), 259 259 IndexedAt: nrec.CreatedAt.Format(time.RFC3339), 260 260 Uri: "at://" + author.Did + "/app.bsky.feed.post/" + fp.Rkey, ··· 282 282 } 283 283 284 284 return &appbskytypes.NotificationList_Notification{ 285 - Record: util.LexiconTypeDecoder{rec}, 285 + Record: lexutil.LexiconTypeDecoder{rec}, 286 286 IsRead: nrec.CreatedAt.Before(lastSeen), 287 287 IndexedAt: nrec.CreatedAt.Format(time.RFC3339), 288 288 Uri: "at://" + follower.Did + "/app.bsky.graph.follow/" + frec.Rkey,
+3 -3
pds/feedgen.go
··· 9 9 10 10 bsky "github.com/bluesky-social/indigo/api/bsky" 11 11 "github.com/bluesky-social/indigo/indexer" 12 - "github.com/bluesky-social/indigo/lex/util" 12 + lexutil "github.com/bluesky-social/indigo/lex/util" 13 13 "github.com/bluesky-social/indigo/models" 14 14 bsutil "github.com/bluesky-social/indigo/util" 15 15 "github.com/ipfs/go-cid" ··· 32 32 }, nil 33 33 } 34 34 35 - type ReadRecordFunc func(context.Context, bsutil.Uid, cid.Cid) (util.CBOR, error) 35 + type ReadRecordFunc func(context.Context, bsutil.Uid, cid.Cid) (lexutil.CBOR, error) 36 36 37 37 /* 38 38 type HydratedFeedItem struct { ··· 149 149 return nil, err 150 150 } 151 151 152 - out.Post.Record = util.LexiconTypeDecoder{rec} 152 + out.Post.Record = lexutil.LexiconTypeDecoder{rec} 153 153 154 154 return out, nil 155 155 }
+3 -3
pds/handlers.go
··· 9 9 10 10 comatprototypes "github.com/bluesky-social/indigo/api/atproto" 11 11 appbskytypes "github.com/bluesky-social/indigo/api/bsky" 12 - "github.com/bluesky-social/indigo/lex/util" 12 + lexutil "github.com/bluesky-social/indigo/lex/util" 13 13 "github.com/ipfs/go-cid" 14 14 jwt "github.com/lestrrat-go/jwx/jwt" 15 15 ) ··· 87 87 return &appbskytypes.ActorUpdateProfile_Output{ 88 88 Cid: ncid.String(), 89 89 Uri: "at://" + u.Did + "/app.bsky.actor.profile/self", 90 - Record: util.LexiconTypeDecoder{profile}, 90 + Record: lexutil.LexiconTypeDecoder{profile}, 91 91 }, nil 92 92 } 93 93 ··· 540 540 return &comatprototypes.RepoGetRecord_Output{ 541 541 Cid: &ccstr, 542 542 Uri: "at://" + targetUser.Did + "/" + collection + "/" + rkey, 543 - Value: util.LexiconTypeDecoder{rec}, 543 + Value: lexutil.LexiconTypeDecoder{rec}, 544 544 }, nil 545 545 } 546 546
+4 -4
pds/server.go
··· 17 17 "github.com/bluesky-social/indigo/carstore" 18 18 "github.com/bluesky-social/indigo/events" 19 19 "github.com/bluesky-social/indigo/indexer" 20 - "github.com/bluesky-social/indigo/lex/util" 20 + lexutil "github.com/bluesky-social/indigo/lex/util" 21 21 "github.com/bluesky-social/indigo/models" 22 22 "github.com/bluesky-social/indigo/notifs" 23 23 "github.com/bluesky-social/indigo/plc" ··· 283 283 return out, nil 284 284 } 285 285 286 - func (s *Server) readRecordFunc(ctx context.Context, user bsutil.Uid, c cid.Cid) (util.CBOR, error) { 286 + func (s *Server) readRecordFunc(ctx context.Context, user bsutil.Uid, c cid.Cid) (lexutil.CBOR, error) { 287 287 bs, err := s.cs.ReadOnlySession(user) 288 288 if err != nil { 289 289 return nil, err ··· 294 294 return nil, err 295 295 } 296 296 297 - return util.CborDecodeValue(blk.RawData()) 297 + return lexutil.CborDecodeValue(blk.RawData()) 298 298 } 299 299 300 300 func loadKey(kfile string) (*did.PrivKey, error) { ··· 657 657 return err 658 658 } 659 659 660 - var obj util.CBOR 660 + var obj lexutil.CBOR 661 661 662 662 switch { 663 663 case evt.RepoAppend != nil:
+5 -5
testing/utils.go
··· 24 24 "github.com/bluesky-social/indigo/carstore" 25 25 "github.com/bluesky-social/indigo/events" 26 26 "github.com/bluesky-social/indigo/indexer" 27 - "github.com/bluesky-social/indigo/lex/util" 27 + lexutil "github.com/bluesky-social/indigo/lex/util" 28 28 "github.com/bluesky-social/indigo/notifs" 29 29 "github.com/bluesky-social/indigo/pds" 30 30 "github.com/bluesky-social/indigo/plc" ··· 225 225 resp, err := atproto.RepoCreateRecord(ctx, u.client, &atproto.RepoCreateRecord_Input{ 226 226 Collection: "app.bsky.feed.post", 227 227 Did: u.did, 228 - Record: util.LexiconTypeDecoder{&bsky.FeedPost{ 228 + Record: lexutil.LexiconTypeDecoder{&bsky.FeedPost{ 229 229 CreatedAt: time.Now().Format(time.RFC3339), 230 230 Text: body, 231 231 Reply: &bsky.FeedPost_ReplyRef{ ··· 252 252 resp, err := atproto.RepoCreateRecord(ctx, u.client, &atproto.RepoCreateRecord_Input{ 253 253 Collection: "app.bsky.feed.post", 254 254 Did: u.did, 255 - Record: util.LexiconTypeDecoder{&bsky.FeedPost{ 255 + Record: lexutil.LexiconTypeDecoder{&bsky.FeedPost{ 256 256 CreatedAt: time.Now().Format(time.RFC3339), 257 257 Text: body, 258 258 }}, ··· 275 275 _, err := atproto.RepoCreateRecord(ctx, u.client, &atproto.RepoCreateRecord_Input{ 276 276 Collection: "app.bsky.feed.vote", 277 277 Did: u.did, 278 - Record: util.LexiconTypeDecoder{&bsky.FeedVote{ 278 + Record: lexutil.LexiconTypeDecoder{&bsky.FeedVote{ 279 279 LexiconTypeID: "app.bsky.feed.vote", 280 280 CreatedAt: time.Now().Format(time.RFC3339), 281 281 Direction: "up", ··· 295 295 resp, err := atproto.RepoCreateRecord(ctx, u.client, &atproto.RepoCreateRecord_Input{ 296 296 Collection: "app.bsky.graph.follow", 297 297 Did: u.did, 298 - Record: util.LexiconTypeDecoder{&bsky.GraphFollow{ 298 + Record: lexutil.LexiconTypeDecoder{&bsky.GraphFollow{ 299 299 CreatedAt: time.Now().Format(time.RFC3339), 300 300 Subject: &bsky.ActorRef{ 301 301 DeclarationCid: "bafyreid27zk7lbis4zw5fz4podbvbs4fc5ivwji3dmrwa6zggnj4bnd57u",