diff --git a/Makefile b/Makefile index d8e10adb..380253f7 100644 --- a/Makefile +++ b/Makefile @@ -363,7 +363,7 @@ go-lexicons: && mkdir -p ./pkg/streamplace \ && rm -rf ./pkg/streamplace/cbor_gen.go \ && $(MAKE) lexgen \ - && sed -i.bak 's/\tutil/\/\/\tutil/' $$(find ./pkg/streamplace -type f) \ + && sed -i.bak 's/\tlexutil\.RegisterType/\/\/\tlexutil.RegisterType/' $$(find ./pkg/streamplace -type f) \ && go run golang.org/x/tools/cmd/goimports@latest -w $$(find ./pkg/streamplace -type f) \ && go run ./pkg/gen/gen.go \ && $(MAKE) lexgen \ diff --git a/go.mod b/go.mod index 9674531e..118e7f81 100644 --- a/go.mod +++ b/go.mod @@ -8,6 +8,8 @@ replace github.com/gocql/gocql => github.com/scylladb/gocql v1.14.4 replace github.com/AxisCommunications/go-dpop => github.com/streamplace/go-dpop v0.0.0-20250510031900-c897158a8ad4 +tool github.com/bluesky-social/indigo/cmd/lexgen + require ( firebase.google.com/go/v4 v4.14.1 github.com/99designs/gqlgen v0.17.64 @@ -15,7 +17,7 @@ require ( github.com/NYTimes/gziphandler v1.1.1 github.com/ThalesGroup/crypto11 v0.0.0-00010101000000-000000000000 github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d - github.com/bluesky-social/indigo v0.0.0-20251114034233-c10ddb5cf518 + github.com/bluesky-social/indigo v0.0.0-20251206005924-d49b45419635 github.com/cenkalti/backoff v2.2.1+incompatible github.com/cenkalti/backoff/v5 v5.0.2 github.com/decred/dcrd/dcrec/secp256k1 v1.0.4 diff --git a/go.sum b/go.sum index fab02d9f..80c1f154 100644 --- a/go.sum +++ b/go.sum @@ -213,8 +213,8 @@ github.com/bluenviron/gortsplib/v4 v4.12.3 h1:3EzbyGb5+MIOJQYiWytRegFEP4EW5paiyT github.com/bluenviron/gortsplib/v4 v4.12.3/go.mod h1:SkZPdaMNr+IvHt2PKRjUXxZN6FDutmSZn4eT0GmF0sk= github.com/bluenviron/mediacommon/v2 v2.4.0 h1:Ss1T7AMxTrICJ+a/N5urS/1lp1ZpsF+3iJq3B/RLDMw= github.com/bluenviron/mediacommon/v2 v2.4.0/go.mod h1:a6MbPmXtYda9mKibKVMZlW20GYLLrX2R7ZkUE+1pwV0= -github.com/bluesky-social/indigo v0.0.0-20251114034233-c10ddb5cf518 h1:XSbejNxWMcXMg29Fww7DT9Z4q+W+tWmvoWej332MVks= -github.com/bluesky-social/indigo v0.0.0-20251114034233-c10ddb5cf518/go.mod h1:GuGAU33qKulpZCZNPcUeIQ4RW6KzNvOy7s8MSUXbAng= +github.com/bluesky-social/indigo v0.0.0-20251206005924-d49b45419635 h1:kNeRrgGJH2g5OvjLqtaQ744YXqduliZYpFkJ/ld47c0= +github.com/bluesky-social/indigo v0.0.0-20251206005924-d49b45419635/go.mod h1:Pm2I1+iDXn/hLbF7XCg/DsZi6uDCiOo7hZGWprSM7k0= github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= diff --git a/pkg/spxrpc/stubs.go b/pkg/spxrpc/stubs.go index 2c5e15f4..81718267 100644 --- a/pkg/spxrpc/stubs.go +++ b/pkg/spxrpc/stubs.go @@ -4,11 +4,11 @@ import ( "io" "strconv" - comatprototypes "github.com/bluesky-social/indigo/api/atproto" - appbskytypes "github.com/bluesky-social/indigo/api/bsky" + comatproto "github.com/bluesky-social/indigo/api/atproto" + appbsky "github.com/bluesky-social/indigo/api/bsky" "github.com/labstack/echo/v4" "go.opentelemetry.io/otel" - placestreamtypes "stream.place/streamplace/pkg/streamplace" + placestream "stream.place/streamplace/pkg/streamplace" ) func (s *Server) RegisterHandlersAppBsky(e *echo.Echo) error { @@ -21,9 +21,9 @@ func (s *Server) HandleAppBskyActorGetProfile(c echo.Context) error { ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyActorGetProfile") defer span.End() actor := c.QueryParam("actor") - var out *appbskytypes.ActorDefs_ProfileViewDetailed + var out *appbsky.ActorDefs_ProfileViewDetailed var handleErr error - // func (s *Server) handleAppBskyActorGetProfile(ctx context.Context,actor string) (*appbskytypes.ActorDefs_ProfileViewDetailed, error) + // func (s *Server) handleAppBskyActorGetProfile(ctx context.Context,actor string) (*appbsky.ActorDefs_ProfileViewDetailed, error) out, handleErr = s.handleAppBskyActorGetProfile(ctx, actor) if handleErr != nil { return handleErr @@ -47,9 +47,9 @@ func (s *Server) HandleAppBskyFeedGetFeedSkeleton(c echo.Context) error { } else { limit = 50 } - var out *appbskytypes.FeedGetFeedSkeleton_Output + var out *appbsky.FeedGetFeedSkeleton_Output var handleErr error - // func (s *Server) handleAppBskyFeedGetFeedSkeleton(ctx context.Context,cursor string,feed string,limit int) (*appbskytypes.FeedGetFeedSkeleton_Output, error) + // func (s *Server) handleAppBskyFeedGetFeedSkeleton(ctx context.Context,cursor string,feed string,limit int) (*appbsky.FeedGetFeedSkeleton_Output, error) out, handleErr = s.handleAppBskyFeedGetFeedSkeleton(ctx, cursor, feed, limit) if handleErr != nil { return handleErr @@ -79,13 +79,13 @@ func (s *Server) HandleComAtprotoIdentityRefreshIdentity(c echo.Context) error { ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoIdentityRefreshIdentity") defer span.End() - var body comatprototypes.IdentityRefreshIdentity_Input + var body comatproto.IdentityRefreshIdentity_Input if err := c.Bind(&body); err != nil { return err } - var out *comatprototypes.IdentityDefs_IdentityInfo + var out *comatproto.IdentityDefs_IdentityInfo var handleErr error - // func (s *Server) handleComAtprotoIdentityRefreshIdentity(ctx context.Context,body *comatprototypes.IdentityRefreshIdentity_Input) (*comatprototypes.IdentityDefs_IdentityInfo, error) + // func (s *Server) handleComAtprotoIdentityRefreshIdentity(ctx context.Context,body *comatproto.IdentityRefreshIdentity_Input) (*comatproto.IdentityDefs_IdentityInfo, error) out, handleErr = s.handleComAtprotoIdentityRefreshIdentity(ctx, &body) if handleErr != nil { return handleErr @@ -97,9 +97,9 @@ func (s *Server) HandleComAtprotoIdentityResolveHandle(c echo.Context) error { ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoIdentityResolveHandle") defer span.End() handle := c.QueryParam("handle") - var out *comatprototypes.IdentityResolveHandle_Output + var out *comatproto.IdentityResolveHandle_Output var handleErr error - // func (s *Server) handleComAtprotoIdentityResolveHandle(ctx context.Context,handle string) (*comatprototypes.IdentityResolveHandle_Output, error) + // func (s *Server) handleComAtprotoIdentityResolveHandle(ctx context.Context,handle string) (*comatproto.IdentityResolveHandle_Output, error) out, handleErr = s.handleComAtprotoIdentityResolveHandle(ctx, handle) if handleErr != nil { return handleErr @@ -111,13 +111,13 @@ func (s *Server) HandleComAtprotoModerationCreateReport(c echo.Context) error { ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoModerationCreateReport") defer span.End() - var body comatprototypes.ModerationCreateReport_Input + var body comatproto.ModerationCreateReport_Input if err := c.Bind(&body); err != nil { return err } - var out *comatprototypes.ModerationCreateReport_Output + var out *comatproto.ModerationCreateReport_Output var handleErr error - // func (s *Server) handleComAtprotoModerationCreateReport(ctx context.Context,body *comatprototypes.ModerationCreateReport_Input) (*comatprototypes.ModerationCreateReport_Output, error) + // func (s *Server) handleComAtprotoModerationCreateReport(ctx context.Context,body *comatproto.ModerationCreateReport_Input) (*comatproto.ModerationCreateReport_Output, error) out, handleErr = s.handleComAtprotoModerationCreateReport(ctx, &body) if handleErr != nil { return handleErr @@ -129,9 +129,9 @@ func (s *Server) HandleComAtprotoRepoDescribeRepo(c echo.Context) error { ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoRepoDescribeRepo") defer span.End() repo := c.QueryParam("repo") - var out *comatprototypes.RepoDescribeRepo_Output + var out *comatproto.RepoDescribeRepo_Output var handleErr error - // func (s *Server) handleComAtprotoRepoDescribeRepo(ctx context.Context,repo string) (*comatprototypes.RepoDescribeRepo_Output, error) + // func (s *Server) handleComAtprotoRepoDescribeRepo(ctx context.Context,repo string) (*comatproto.RepoDescribeRepo_Output, error) out, handleErr = s.handleComAtprotoRepoDescribeRepo(ctx, repo) if handleErr != nil { return handleErr @@ -146,9 +146,9 @@ func (s *Server) HandleComAtprotoRepoGetRecord(c echo.Context) error { collection := c.QueryParam("collection") repo := c.QueryParam("repo") rkey := c.QueryParam("rkey") - var out *comatprototypes.RepoGetRecord_Output + var out *comatproto.RepoGetRecord_Output var handleErr error - // func (s *Server) handleComAtprotoRepoGetRecord(ctx context.Context,cid string,collection string,repo string,rkey string) (*comatprototypes.RepoGetRecord_Output, error) + // func (s *Server) handleComAtprotoRepoGetRecord(ctx context.Context,cid string,collection string,repo string,rkey string) (*comatproto.RepoGetRecord_Output, error) out, handleErr = s.handleComAtprotoRepoGetRecord(ctx, cid, collection, repo, rkey) if handleErr != nil { return handleErr @@ -182,9 +182,9 @@ func (s *Server) HandleComAtprotoRepoListRecords(c echo.Context) error { } reverse = &reverse_val } - var out *comatprototypes.RepoListRecords_Output + var out *comatproto.RepoListRecords_Output var handleErr error - // func (s *Server) handleComAtprotoRepoListRecords(ctx context.Context,collection string,cursor string,limit int,repo string,reverse *bool) (*comatprototypes.RepoListRecords_Output, error) + // func (s *Server) handleComAtprotoRepoListRecords(ctx context.Context,collection string,cursor string,limit int,repo string,reverse *bool) (*comatproto.RepoListRecords_Output, error) out, handleErr = s.handleComAtprotoRepoListRecords(ctx, collection, cursor, limit, repo, reverse) if handleErr != nil { return handleErr @@ -197,9 +197,9 @@ func (s *Server) HandleComAtprotoRepoUploadBlob(c echo.Context) error { defer span.End() body := c.Request().Body contentType := c.Request().Header.Get("Content-Type") - var out *comatprototypes.RepoUploadBlob_Output + var out *comatproto.RepoUploadBlob_Output var handleErr error - // func (s *Server) handleComAtprotoRepoUploadBlob(ctx context.Context,r io.Reader,contentType string) (*comatprototypes.RepoUploadBlob_Output, error) + // func (s *Server) handleComAtprotoRepoUploadBlob(ctx context.Context,r io.Reader,contentType string) (*comatproto.RepoUploadBlob_Output, error) out, handleErr = s.handleComAtprotoRepoUploadBlob(ctx, body, contentType) if handleErr != nil { return handleErr @@ -210,9 +210,9 @@ func (s *Server) HandleComAtprotoRepoUploadBlob(c echo.Context) error { func (s *Server) HandleComAtprotoServerDescribeServer(c echo.Context) error { ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoServerDescribeServer") defer span.End() - var out *comatprototypes.ServerDescribeServer_Output + var out *comatproto.ServerDescribeServer_Output var handleErr error - // func (s *Server) handleComAtprotoServerDescribeServer(ctx context.Context) (*comatprototypes.ServerDescribeServer_Output, error) + // func (s *Server) handleComAtprotoServerDescribeServer(ctx context.Context) (*comatproto.ServerDescribeServer_Output, error) out, handleErr = s.handleComAtprotoServerDescribeServer(ctx) if handleErr != nil { return handleErr @@ -251,9 +251,9 @@ func (s *Server) HandleComAtprotoSyncListRepos(c echo.Context) error { } else { limit = 500 } - var out *comatprototypes.SyncListRepos_Output + var out *comatproto.SyncListRepos_Output var handleErr error - // func (s *Server) handleComAtprotoSyncListRepos(ctx context.Context,cursor string,limit int) (*comatprototypes.SyncListRepos_Output, error) + // func (s *Server) handleComAtprotoSyncListRepos(ctx context.Context,cursor string,limit int) (*comatproto.SyncListRepos_Output, error) out, handleErr = s.handleComAtprotoSyncListRepos(ctx, cursor, limit) if handleErr != nil { return handleErr @@ -279,9 +279,9 @@ func (s *Server) RegisterHandlersPlaceStream(e *echo.Echo) error { func (s *Server) HandlePlaceStreamBroadcastGetBroadcaster(c echo.Context) error { ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandlePlaceStreamBroadcastGetBroadcaster") defer span.End() - var out *placestreamtypes.BroadcastGetBroadcaster_Output + var out *placestream.BroadcastGetBroadcaster_Output var handleErr error - // func (s *Server) handlePlaceStreamBroadcastGetBroadcaster(ctx context.Context) (*placestreamtypes.BroadcastGetBroadcaster_Output, error) + // func (s *Server) handlePlaceStreamBroadcastGetBroadcaster(ctx context.Context) (*placestream.BroadcastGetBroadcaster_Output, error) out, handleErr = s.handlePlaceStreamBroadcastGetBroadcaster(ctx) if handleErr != nil { return handleErr @@ -294,9 +294,9 @@ func (s *Server) HandlePlaceStreamGraphGetFollowingUser(c echo.Context) error { defer span.End() subjectDID := c.QueryParam("subjectDID") userDID := c.QueryParam("userDID") - var out *placestreamtypes.GraphGetFollowingUser_Output + var out *placestream.GraphGetFollowingUser_Output var handleErr error - // func (s *Server) handlePlaceStreamGraphGetFollowingUser(ctx context.Context,subjectDID string,userDID string) (*placestreamtypes.GraphGetFollowingUser_Output, error) + // func (s *Server) handlePlaceStreamGraphGetFollowingUser(ctx context.Context,subjectDID string,userDID string) (*placestream.GraphGetFollowingUser_Output, error) out, handleErr = s.handlePlaceStreamGraphGetFollowingUser(ctx, subjectDID, userDID) if handleErr != nil { return handleErr @@ -319,9 +319,9 @@ func (s *Server) HandlePlaceStreamLiveGetLiveUsers(c echo.Context) error { } else { limit = 50 } - var out *placestreamtypes.LiveGetLiveUsers_Output + var out *placestream.LiveGetLiveUsers_Output var handleErr error - // func (s *Server) handlePlaceStreamLiveGetLiveUsers(ctx context.Context,before string,limit int) (*placestreamtypes.LiveGetLiveUsers_Output, error) + // func (s *Server) handlePlaceStreamLiveGetLiveUsers(ctx context.Context,before string,limit int) (*placestream.LiveGetLiveUsers_Output, error) out, handleErr = s.handlePlaceStreamLiveGetLiveUsers(ctx, before, limit) if handleErr != nil { return handleErr @@ -359,9 +359,9 @@ func (s *Server) HandlePlaceStreamLiveGetSegments(c echo.Context) error { limit = 50 } userDID := c.QueryParam("userDID") - var out *placestreamtypes.LiveGetSegments_Output + var out *placestream.LiveGetSegments_Output var handleErr error - // func (s *Server) handlePlaceStreamLiveGetSegments(ctx context.Context,before string,limit int,userDID string) (*placestreamtypes.LiveGetSegments_Output, error) + // func (s *Server) handlePlaceStreamLiveGetSegments(ctx context.Context,before string,limit int,userDID string) (*placestream.LiveGetSegments_Output, error) out, handleErr = s.handlePlaceStreamLiveGetSegments(ctx, before, limit, userDID) if handleErr != nil { return handleErr @@ -373,13 +373,13 @@ func (s *Server) HandlePlaceStreamServerCreateWebhook(c echo.Context) error { ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandlePlaceStreamServerCreateWebhook") defer span.End() - var body placestreamtypes.ServerCreateWebhook_Input + var body placestream.ServerCreateWebhook_Input if err := c.Bind(&body); err != nil { return err } - var out *placestreamtypes.ServerCreateWebhook_Output + var out *placestream.ServerCreateWebhook_Output var handleErr error - // func (s *Server) handlePlaceStreamServerCreateWebhook(ctx context.Context,body *placestreamtypes.ServerCreateWebhook_Input) (*placestreamtypes.ServerCreateWebhook_Output, error) + // func (s *Server) handlePlaceStreamServerCreateWebhook(ctx context.Context,body *placestream.ServerCreateWebhook_Input) (*placestream.ServerCreateWebhook_Output, error) out, handleErr = s.handlePlaceStreamServerCreateWebhook(ctx, &body) if handleErr != nil { return handleErr @@ -391,13 +391,13 @@ func (s *Server) HandlePlaceStreamServerDeleteWebhook(c echo.Context) error { ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandlePlaceStreamServerDeleteWebhook") defer span.End() - var body placestreamtypes.ServerDeleteWebhook_Input + var body placestream.ServerDeleteWebhook_Input if err := c.Bind(&body); err != nil { return err } - var out *placestreamtypes.ServerDeleteWebhook_Output + var out *placestream.ServerDeleteWebhook_Output var handleErr error - // func (s *Server) handlePlaceStreamServerDeleteWebhook(ctx context.Context,body *placestreamtypes.ServerDeleteWebhook_Input) (*placestreamtypes.ServerDeleteWebhook_Output, error) + // func (s *Server) handlePlaceStreamServerDeleteWebhook(ctx context.Context,body *placestream.ServerDeleteWebhook_Input) (*placestream.ServerDeleteWebhook_Output, error) out, handleErr = s.handlePlaceStreamServerDeleteWebhook(ctx, &body) if handleErr != nil { return handleErr @@ -408,9 +408,9 @@ func (s *Server) HandlePlaceStreamServerDeleteWebhook(c echo.Context) error { func (s *Server) HandlePlaceStreamServerGetServerTime(c echo.Context) error { ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandlePlaceStreamServerGetServerTime") defer span.End() - var out *placestreamtypes.ServerGetServerTime_Output + var out *placestream.ServerGetServerTime_Output var handleErr error - // func (s *Server) handlePlaceStreamServerGetServerTime(ctx context.Context) (*placestreamtypes.ServerGetServerTime_Output, error) + // func (s *Server) handlePlaceStreamServerGetServerTime(ctx context.Context) (*placestream.ServerGetServerTime_Output, error) out, handleErr = s.handlePlaceStreamServerGetServerTime(ctx) if handleErr != nil { return handleErr @@ -422,9 +422,9 @@ func (s *Server) HandlePlaceStreamServerGetWebhook(c echo.Context) error { ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandlePlaceStreamServerGetWebhook") defer span.End() id := c.QueryParam("id") - var out *placestreamtypes.ServerGetWebhook_Output + var out *placestream.ServerGetWebhook_Output var handleErr error - // func (s *Server) handlePlaceStreamServerGetWebhook(ctx context.Context,id string) (*placestreamtypes.ServerGetWebhook_Output, error) + // func (s *Server) handlePlaceStreamServerGetWebhook(ctx context.Context,id string) (*placestream.ServerGetWebhook_Output, error) out, handleErr = s.handlePlaceStreamServerGetWebhook(ctx, id) if handleErr != nil { return handleErr @@ -457,9 +457,9 @@ func (s *Server) HandlePlaceStreamServerListWebhooks(c echo.Context) error { } else { limit = 50 } - var out *placestreamtypes.ServerListWebhooks_Output + var out *placestream.ServerListWebhooks_Output var handleErr error - // func (s *Server) handlePlaceStreamServerListWebhooks(ctx context.Context,active *bool,cursor string,event string,limit int) (*placestreamtypes.ServerListWebhooks_Output, error) + // func (s *Server) handlePlaceStreamServerListWebhooks(ctx context.Context,active *bool,cursor string,event string,limit int) (*placestream.ServerListWebhooks_Output, error) out, handleErr = s.handlePlaceStreamServerListWebhooks(ctx, active, cursor, event, limit) if handleErr != nil { return handleErr @@ -471,13 +471,13 @@ func (s *Server) HandlePlaceStreamServerUpdateWebhook(c echo.Context) error { ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandlePlaceStreamServerUpdateWebhook") defer span.End() - var body placestreamtypes.ServerUpdateWebhook_Input + var body placestream.ServerUpdateWebhook_Input if err := c.Bind(&body); err != nil { return err } - var out *placestreamtypes.ServerUpdateWebhook_Output + var out *placestream.ServerUpdateWebhook_Output var handleErr error - // func (s *Server) handlePlaceStreamServerUpdateWebhook(ctx context.Context,body *placestreamtypes.ServerUpdateWebhook_Input) (*placestreamtypes.ServerUpdateWebhook_Output, error) + // func (s *Server) handlePlaceStreamServerUpdateWebhook(ctx context.Context,body *placestream.ServerUpdateWebhook_Input) (*placestream.ServerUpdateWebhook_Output, error) out, handleErr = s.handlePlaceStreamServerUpdateWebhook(ctx, &body) if handleErr != nil { return handleErr diff --git a/pkg/streamplace/broadcastdefs.go b/pkg/streamplace/broadcastdefs.go index 5fc1abf0..24c03ba9 100644 --- a/pkg/streamplace/broadcastdefs.go +++ b/pkg/streamplace/broadcastdefs.go @@ -1,18 +1,18 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package streamplace +// Lexicon schema: place.stream.broadcast.defs -// schema: place.stream.broadcast.defs +package streamplace import ( - appbskytypes "github.com/bluesky-social/indigo/api/bsky" - "github.com/bluesky-social/indigo/lex/util" + appbsky "github.com/bluesky-social/indigo/api/bsky" + lexutil "github.com/bluesky-social/indigo/lex/util" ) // BroadcastDefs_BroadcastOriginView is a "broadcastOriginView" in the place.stream.broadcast.defs schema. type BroadcastDefs_BroadcastOriginView struct { - Author *appbskytypes.ActorDefs_ProfileViewBasic `json:"author" cborgen:"author"` - Cid string `json:"cid" cborgen:"cid"` - Record *util.LexiconTypeDecoder `json:"record" cborgen:"record"` - Uri string `json:"uri" cborgen:"uri"` + Author *appbsky.ActorDefs_ProfileViewBasic `json:"author" cborgen:"author"` + Cid string `json:"cid" cborgen:"cid"` + Record *lexutil.LexiconTypeDecoder `json:"record" cborgen:"record"` + Uri string `json:"uri" cborgen:"uri"` } diff --git a/pkg/streamplace/broadcastgetBroadcaster.go b/pkg/streamplace/broadcastgetBroadcaster.go index a6d6b3da..c0aebf8c 100644 --- a/pkg/streamplace/broadcastgetBroadcaster.go +++ b/pkg/streamplace/broadcastgetBroadcaster.go @@ -1,13 +1,13 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package streamplace +// Lexicon schema: place.stream.broadcast.getBroadcaster -// schema: place.stream.broadcast.getBroadcaster +package streamplace import ( "context" - "github.com/bluesky-social/indigo/lex/util" + lexutil "github.com/bluesky-social/indigo/lex/util" ) // BroadcastGetBroadcaster_Output is the output of a place.stream.broadcast.getBroadcaster call. @@ -19,11 +19,11 @@ type BroadcastGetBroadcaster_Output struct { } // BroadcastGetBroadcaster calls the XRPC method "place.stream.broadcast.getBroadcaster". -func BroadcastGetBroadcaster(ctx context.Context, c util.LexClient) (*BroadcastGetBroadcaster_Output, error) { +func BroadcastGetBroadcaster(ctx context.Context, c lexutil.LexClient) (*BroadcastGetBroadcaster_Output, error) { var out BroadcastGetBroadcaster_Output params := map[string]interface{}{} - if err := c.LexDo(ctx, util.Query, "", "place.stream.broadcast.getBroadcaster", params, nil, &out); err != nil { + if err := c.LexDo(ctx, lexutil.Query, "", "place.stream.broadcast.getBroadcaster", params, nil, &out); err != nil { return nil, err } diff --git a/pkg/streamplace/broadcastorigin.go b/pkg/streamplace/broadcastorigin.go index b78617e9..e293b949 100644 --- a/pkg/streamplace/broadcastorigin.go +++ b/pkg/streamplace/broadcastorigin.go @@ -1,19 +1,19 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package streamplace +// Lexicon schema: place.stream.broadcast.origin -// schema: place.stream.broadcast.origin +package streamplace import ( - "github.com/bluesky-social/indigo/lex/util" + lexutil "github.com/bluesky-social/indigo/lex/util" ) func init() { - util.RegisterType("place.stream.broadcast.origin", &BroadcastOrigin{}) -} // -// RECORDTYPE: BroadcastOrigin + lexutil.RegisterType("place.stream.broadcast.origin", &BroadcastOrigin{}) +} + type BroadcastOrigin struct { - LexiconTypeID string `json:"$type,const=place.stream.broadcast.origin" cborgen:"$type,const=place.stream.broadcast.origin"` + LexiconTypeID string `json:"$type" cborgen:"$type,const=place.stream.broadcast.origin"` // broadcaster: did of the broadcaster that operates the server syndicating the livestream Broadcaster *string `json:"broadcaster,omitempty" cborgen:"broadcaster,omitempty"` // irohTicket: Iroh ticket that can be used to access the livestream from the server diff --git a/pkg/streamplace/broadcastsyndication.go b/pkg/streamplace/broadcastsyndication.go index 8b839ddd..45946594 100644 --- a/pkg/streamplace/broadcastsyndication.go +++ b/pkg/streamplace/broadcastsyndication.go @@ -1,19 +1,19 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package streamplace +// Lexicon schema: place.stream.broadcast.syndication -// schema: place.stream.broadcast.syndication +package streamplace import ( - "github.com/bluesky-social/indigo/lex/util" + lexutil "github.com/bluesky-social/indigo/lex/util" ) func init() { - util.RegisterType("place.stream.broadcast.syndication", &BroadcastSyndication{}) -} // -// RECORDTYPE: BroadcastSyndication + lexutil.RegisterType("place.stream.broadcast.syndication", &BroadcastSyndication{}) +} + type BroadcastSyndication struct { - LexiconTypeID string `json:"$type,const=place.stream.broadcast.syndication" cborgen:"$type,const=place.stream.broadcast.syndication"` + LexiconTypeID string `json:"$type" cborgen:"$type,const=place.stream.broadcast.syndication"` // broadcaster: DID of the Streamplace broadcaster that will be replicating the livestream Broadcaster string `json:"broadcaster" cborgen:"broadcaster"` // createdAt: Client-declared timestamp when this syndication was created. diff --git a/pkg/streamplace/chatdefs.go b/pkg/streamplace/chatdefs.go index 12a8da90..499910d9 100644 --- a/pkg/streamplace/chatdefs.go +++ b/pkg/streamplace/chatdefs.go @@ -1,29 +1,27 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package streamplace +// Lexicon schema: place.stream.chat.defs -// schema: place.stream.chat.defs +package streamplace import ( "encoding/json" "fmt" - appbskytypes "github.com/bluesky-social/indigo/api/bsky" - "github.com/bluesky-social/indigo/lex/util" + appbsky "github.com/bluesky-social/indigo/api/bsky" + lexutil "github.com/bluesky-social/indigo/lex/util" ) // ChatDefs_MessageView is a "messageView" in the place.stream.chat.defs schema. -// -// RECORDTYPE: ChatDefs_MessageView type ChatDefs_MessageView struct { - LexiconTypeID string `json:"$type,const=place.stream.chat.defs#messageView" cborgen:"$type,const=place.stream.chat.defs#messageView"` - Author *appbskytypes.ActorDefs_ProfileViewBasic `json:"author" cborgen:"author"` - ChatProfile *ChatProfile `json:"chatProfile,omitempty" cborgen:"chatProfile,omitempty"` - Cid string `json:"cid" cborgen:"cid"` + LexiconTypeID string `json:"$type" cborgen:"$type,const=place.stream.chat.defs#messageView"` + Author *appbsky.ActorDefs_ProfileViewBasic `json:"author" cborgen:"author"` + ChatProfile *ChatProfile `json:"chatProfile,omitempty" cborgen:"chatProfile,omitempty"` + Cid string `json:"cid" cborgen:"cid"` // deleted: If true, this message has been deleted or labeled and should be cleared from the cache Deleted *bool `json:"deleted,omitempty" cborgen:"deleted,omitempty"` IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` - Record *util.LexiconTypeDecoder `json:"record" cborgen:"record"` + Record *lexutil.LexiconTypeDecoder `json:"record" cborgen:"record"` ReplyTo *ChatDefs_MessageView_ReplyTo `json:"replyTo,omitempty" cborgen:"replyTo,omitempty"` Uri string `json:"uri" cborgen:"uri"` } @@ -37,10 +35,11 @@ func (t *ChatDefs_MessageView_ReplyTo) MarshalJSON() ([]byte, error) { t.ChatDefs_MessageView.LexiconTypeID = "place.stream.chat.defs#messageView" return json.Marshal(t.ChatDefs_MessageView) } - return nil, fmt.Errorf("cannot marshal empty enum") + return nil, fmt.Errorf("can not marshal empty union as JSON") } + func (t *ChatDefs_MessageView_ReplyTo) UnmarshalJSON(b []byte) error { - typ, err := util.TypeExtract(b) + typ, err := lexutil.TypeExtract(b) if err != nil { return err } @@ -49,7 +48,6 @@ func (t *ChatDefs_MessageView_ReplyTo) UnmarshalJSON(b []byte) error { case "place.stream.chat.defs#messageView": t.ChatDefs_MessageView = new(ChatDefs_MessageView) return json.Unmarshal(b, t.ChatDefs_MessageView) - default: return nil } diff --git a/pkg/streamplace/chatgate.go b/pkg/streamplace/chatgate.go index 6fa04aec..0d4538ad 100644 --- a/pkg/streamplace/chatgate.go +++ b/pkg/streamplace/chatgate.go @@ -1,19 +1,19 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package streamplace +// Lexicon schema: place.stream.chat.gate -// schema: place.stream.chat.gate +package streamplace import ( - "github.com/bluesky-social/indigo/lex/util" + lexutil "github.com/bluesky-social/indigo/lex/util" ) func init() { - util.RegisterType("place.stream.chat.gate", &ChatGate{}) -} // -// RECORDTYPE: ChatGate + lexutil.RegisterType("place.stream.chat.gate", &ChatGate{}) +} + type ChatGate struct { - LexiconTypeID string `json:"$type,const=place.stream.chat.gate" cborgen:"$type,const=place.stream.chat.gate"` + LexiconTypeID string `json:"$type" cborgen:"$type,const=place.stream.chat.gate"` // hiddenMessage: URI of the hidden chat message. HiddenMessage string `json:"hiddenMessage" cborgen:"hiddenMessage"` } diff --git a/pkg/streamplace/chatmessage.go b/pkg/streamplace/chatmessage.go index d03baea2..459b30a0 100644 --- a/pkg/streamplace/chatmessage.go +++ b/pkg/streamplace/chatmessage.go @@ -1,20 +1,20 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package streamplace +// Lexicon schema: place.stream.chat.message -// schema: place.stream.chat.message +package streamplace import ( - comatprototypes "github.com/bluesky-social/indigo/api/atproto" - "github.com/bluesky-social/indigo/lex/util" + comatproto "github.com/bluesky-social/indigo/api/atproto" + lexutil "github.com/bluesky-social/indigo/lex/util" ) func init() { - util.RegisterType("place.stream.chat.message", &ChatMessage{}) -} // -// RECORDTYPE: ChatMessage + lexutil.RegisterType("place.stream.chat.message", &ChatMessage{}) +} + type ChatMessage struct { - LexiconTypeID string `json:"$type,const=place.stream.chat.message" cborgen:"$type,const=place.stream.chat.message"` + LexiconTypeID string `json:"$type" cborgen:"$type,const=place.stream.chat.message"` // createdAt: Client-declared timestamp when this message was originally created. CreatedAt string `json:"createdAt" cborgen:"createdAt"` // facets: Annotations of text (mentions, URLs, etc) @@ -28,6 +28,6 @@ type ChatMessage struct { // ChatMessage_ReplyRef is a "replyRef" in the place.stream.chat.message schema. type ChatMessage_ReplyRef struct { - Parent *comatprototypes.RepoStrongRef `json:"parent" cborgen:"parent"` - Root *comatprototypes.RepoStrongRef `json:"root" cborgen:"root"` + Parent *comatproto.RepoStrongRef `json:"parent" cborgen:"parent"` + Root *comatproto.RepoStrongRef `json:"root" cborgen:"root"` } diff --git a/pkg/streamplace/chatprofile.go b/pkg/streamplace/chatprofile.go index a1f52e60..88a88e14 100644 --- a/pkg/streamplace/chatprofile.go +++ b/pkg/streamplace/chatprofile.go @@ -1,19 +1,19 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package streamplace +// Lexicon schema: place.stream.chat.profile -// schema: place.stream.chat.profile +package streamplace import ( - "github.com/bluesky-social/indigo/lex/util" + lexutil "github.com/bluesky-social/indigo/lex/util" ) func init() { - util.RegisterType("place.stream.chat.profile", &ChatProfile{}) -} // -// RECORDTYPE: ChatProfile + lexutil.RegisterType("place.stream.chat.profile", &ChatProfile{}) +} + type ChatProfile struct { - LexiconTypeID string `json:"$type,const=place.stream.chat.profile" cborgen:"$type,const=place.stream.chat.profile"` + LexiconTypeID string `json:"$type" cborgen:"$type,const=place.stream.chat.profile"` Color *ChatProfile_Color `json:"color,omitempty" cborgen:"color,omitempty"` } diff --git a/pkg/streamplace/graphgetFollowingUser.go b/pkg/streamplace/graphgetFollowingUser.go index 41696fd4..d76725a7 100644 --- a/pkg/streamplace/graphgetFollowingUser.go +++ b/pkg/streamplace/graphgetFollowingUser.go @@ -1,32 +1,32 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package streamplace +// Lexicon schema: place.stream.graph.getFollowingUser -// schema: place.stream.graph.getFollowingUser +package streamplace import ( "context" - comatprototypes "github.com/bluesky-social/indigo/api/atproto" - "github.com/bluesky-social/indigo/lex/util" + comatproto "github.com/bluesky-social/indigo/api/atproto" + lexutil "github.com/bluesky-social/indigo/lex/util" ) // GraphGetFollowingUser_Output is the output of a place.stream.graph.getFollowingUser call. type GraphGetFollowingUser_Output struct { - Follow *comatprototypes.RepoStrongRef `json:"follow,omitempty" cborgen:"follow,omitempty"` + Follow *comatproto.RepoStrongRef `json:"follow,omitempty" cborgen:"follow,omitempty"` } // GraphGetFollowingUser calls the XRPC method "place.stream.graph.getFollowingUser". // // subjectDID: The DID of the user potentially being followed // userDID: The DID of the potentially-following user -func GraphGetFollowingUser(ctx context.Context, c util.LexClient, subjectDID string, userDID string) (*GraphGetFollowingUser_Output, error) { +func GraphGetFollowingUser(ctx context.Context, c lexutil.LexClient, subjectDID string, userDID string) (*GraphGetFollowingUser_Output, error) { var out GraphGetFollowingUser_Output params := map[string]interface{}{} params["subjectDID"] = subjectDID params["userDID"] = userDID - if err := c.LexDo(ctx, util.Query, "", "place.stream.graph.getFollowingUser", params, nil, &out); err != nil { + if err := c.LexDo(ctx, lexutil.Query, "", "place.stream.graph.getFollowingUser", params, nil, &out); err != nil { return nil, err } diff --git a/pkg/streamplace/livegetLiveUsers.go b/pkg/streamplace/livegetLiveUsers.go index 8feeb9c4..f29281ff 100644 --- a/pkg/streamplace/livegetLiveUsers.go +++ b/pkg/streamplace/livegetLiveUsers.go @@ -1,13 +1,13 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package streamplace +// Lexicon schema: place.stream.live.getLiveUsers -// schema: place.stream.live.getLiveUsers +package streamplace import ( "context" - "github.com/bluesky-social/indigo/lex/util" + lexutil "github.com/bluesky-social/indigo/lex/util" ) // LiveGetLiveUsers_Output is the output of a place.stream.live.getLiveUsers call. @@ -16,7 +16,7 @@ type LiveGetLiveUsers_Output struct { } // LiveGetLiveUsers calls the XRPC method "place.stream.live.getLiveUsers". -func LiveGetLiveUsers(ctx context.Context, c util.LexClient, before string, limit int64) (*LiveGetLiveUsers_Output, error) { +func LiveGetLiveUsers(ctx context.Context, c lexutil.LexClient, before string, limit int64) (*LiveGetLiveUsers_Output, error) { var out LiveGetLiveUsers_Output params := map[string]interface{}{} @@ -26,7 +26,7 @@ func LiveGetLiveUsers(ctx context.Context, c util.LexClient, before string, limi if limit != 0 { params["limit"] = limit } - if err := c.LexDo(ctx, util.Query, "", "place.stream.live.getLiveUsers", params, nil, &out); err != nil { + if err := c.LexDo(ctx, lexutil.Query, "", "place.stream.live.getLiveUsers", params, nil, &out); err != nil { return nil, err } diff --git a/pkg/streamplace/livegetProfileCard.go b/pkg/streamplace/livegetProfileCard.go index e5914d53..1d7e4e2f 100644 --- a/pkg/streamplace/livegetProfileCard.go +++ b/pkg/streamplace/livegetProfileCard.go @@ -1,25 +1,25 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package streamplace +// Lexicon schema: place.stream.live.getProfileCard -// schema: place.stream.live.getProfileCard +package streamplace import ( "bytes" "context" - "github.com/bluesky-social/indigo/lex/util" + lexutil "github.com/bluesky-social/indigo/lex/util" ) // LiveGetProfileCard calls the XRPC method "place.stream.live.getProfileCard". // // id: The DID or handle of the account. -func LiveGetProfileCard(ctx context.Context, c util.LexClient, id string) ([]byte, error) { +func LiveGetProfileCard(ctx context.Context, c lexutil.LexClient, id string) ([]byte, error) { buf := new(bytes.Buffer) params := map[string]interface{}{} params["id"] = id - if err := c.LexDo(ctx, util.Query, "", "place.stream.live.getProfileCard", params, nil, buf); err != nil { + if err := c.LexDo(ctx, lexutil.Query, "", "place.stream.live.getProfileCard", params, nil, buf); err != nil { return nil, err } diff --git a/pkg/streamplace/livegetSegments.go b/pkg/streamplace/livegetSegments.go index 97e2d17d..be304ca9 100644 --- a/pkg/streamplace/livegetSegments.go +++ b/pkg/streamplace/livegetSegments.go @@ -1,13 +1,13 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package streamplace +// Lexicon schema: place.stream.live.getSegments -// schema: place.stream.live.getSegments +package streamplace import ( "context" - "github.com/bluesky-social/indigo/lex/util" + lexutil "github.com/bluesky-social/indigo/lex/util" ) // LiveGetSegments_Output is the output of a place.stream.live.getSegments call. @@ -18,7 +18,7 @@ type LiveGetSegments_Output struct { // LiveGetSegments calls the XRPC method "place.stream.live.getSegments". // // userDID: The DID of the potentially-following user -func LiveGetSegments(ctx context.Context, c util.LexClient, before string, limit int64, userDID string) (*LiveGetSegments_Output, error) { +func LiveGetSegments(ctx context.Context, c lexutil.LexClient, before string, limit int64, userDID string) (*LiveGetSegments_Output, error) { var out LiveGetSegments_Output params := map[string]interface{}{} @@ -29,7 +29,7 @@ func LiveGetSegments(ctx context.Context, c util.LexClient, before string, limit params["limit"] = limit } params["userDID"] = userDID - if err := c.LexDo(ctx, util.Query, "", "place.stream.live.getSegments", params, nil, &out); err != nil { + if err := c.LexDo(ctx, lexutil.Query, "", "place.stream.live.getSegments", params, nil, &out); err != nil { return nil, err } diff --git a/pkg/streamplace/livesubscribeSegments.go b/pkg/streamplace/livesubscribeSegments.go index 35414513..4a368b8c 100644 --- a/pkg/streamplace/livesubscribeSegments.go +++ b/pkg/streamplace/livesubscribeSegments.go @@ -1,5 +1,5 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package streamplace +// Lexicon schema: place.stream.live.subscribeSegments -// schema: place.stream.live.subscribeSegments +package streamplace diff --git a/pkg/streamplace/metadataconfiguration.go b/pkg/streamplace/metadataconfiguration.go index e6a5d1f0..34570d73 100644 --- a/pkg/streamplace/metadataconfiguration.go +++ b/pkg/streamplace/metadataconfiguration.go @@ -1,19 +1,19 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package streamplace +// Lexicon schema: place.stream.metadata.configuration -// schema: place.stream.metadata.configuration +package streamplace import ( - "github.com/bluesky-social/indigo/lex/util" + lexutil "github.com/bluesky-social/indigo/lex/util" ) func init() { - util.RegisterType("place.stream.metadata.configuration", &MetadataConfiguration{}) -} // -// RECORDTYPE: MetadataConfiguration + lexutil.RegisterType("place.stream.metadata.configuration", &MetadataConfiguration{}) +} + type MetadataConfiguration struct { - LexiconTypeID string `json:"$type,const=place.stream.metadata.configuration" cborgen:"$type,const=place.stream.metadata.configuration"` + LexiconTypeID string `json:"$type" cborgen:"$type,const=place.stream.metadata.configuration"` ContentRights *MetadataContentRights `json:"contentRights,omitempty" cborgen:"contentRights,omitempty"` ContentWarnings *MetadataContentWarnings `json:"contentWarnings,omitempty" cborgen:"contentWarnings,omitempty"` DistributionPolicy *MetadataDistributionPolicy `json:"distributionPolicy,omitempty" cborgen:"distributionPolicy,omitempty"` diff --git a/pkg/streamplace/metadatacontentRights.go b/pkg/streamplace/metadatacontentRights.go index 1017c391..d8f02188 100644 --- a/pkg/streamplace/metadatacontentRights.go +++ b/pkg/streamplace/metadatacontentRights.go @@ -1,8 +1,8 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package streamplace +// Lexicon schema: place.stream.metadata.contentRights -// schema: place.stream.metadata.contentRights +package streamplace // MetadataContentRights is a "main" in the place.stream.metadata.contentRights schema. // diff --git a/pkg/streamplace/metadatacontentWarnings.go b/pkg/streamplace/metadatacontentWarnings.go index fddd33ec..cc4d7def 100644 --- a/pkg/streamplace/metadatacontentWarnings.go +++ b/pkg/streamplace/metadatacontentWarnings.go @@ -1,8 +1,8 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package streamplace +// Lexicon schema: place.stream.metadata.contentWarnings -// schema: place.stream.metadata.contentWarnings +package streamplace // MetadataContentWarnings is a "main" in the place.stream.metadata.contentWarnings schema. // diff --git a/pkg/streamplace/metadatadistributionPolicy.go b/pkg/streamplace/metadatadistributionPolicy.go index d9322b03..b363b59e 100644 --- a/pkg/streamplace/metadatadistributionPolicy.go +++ b/pkg/streamplace/metadatadistributionPolicy.go @@ -1,8 +1,8 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package streamplace +// Lexicon schema: place.stream.metadata.distributionPolicy -// schema: place.stream.metadata.distributionPolicy +package streamplace // MetadataDistributionPolicy is a "main" in the place.stream.metadata.distributionPolicy schema. // diff --git a/pkg/streamplace/richtextfacet.go b/pkg/streamplace/richtextfacet.go index fc58a913..6061bea4 100644 --- a/pkg/streamplace/richtextfacet.go +++ b/pkg/streamplace/richtextfacet.go @@ -1,8 +1,8 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package streamplace +// Lexicon schema: place.stream.richtext.facet -// schema: place.stream.richtext.facet +package streamplace import ( "bytes" @@ -10,8 +10,8 @@ import ( "fmt" "io" - appbskytypes "github.com/bluesky-social/indigo/api/bsky" - "github.com/bluesky-social/indigo/lex/util" + appbsky "github.com/bluesky-social/indigo/api/bsky" + lexutil "github.com/bluesky-social/indigo/lex/util" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -19,13 +19,13 @@ import ( // // Annotation of a sub-string within rich text. type RichtextFacet struct { - Features []*RichtextFacet_Features_Elem `json:"features" cborgen:"features"` - Index *appbskytypes.RichtextFacet_ByteSlice `json:"index" cborgen:"index"` + Features []*RichtextFacet_Features_Elem `json:"features" cborgen:"features"` + Index *appbsky.RichtextFacet_ByteSlice `json:"index" cborgen:"index"` } type RichtextFacet_Features_Elem struct { - RichtextFacet_Mention *appbskytypes.RichtextFacet_Mention - RichtextFacet_Link *appbskytypes.RichtextFacet_Link + RichtextFacet_Mention *appbsky.RichtextFacet_Mention + RichtextFacet_Link *appbsky.RichtextFacet_Link } func (t *RichtextFacet_Features_Elem) MarshalJSON() ([]byte, error) { @@ -37,22 +37,22 @@ func (t *RichtextFacet_Features_Elem) MarshalJSON() ([]byte, error) { t.RichtextFacet_Link.LexiconTypeID = "app.bsky.richtext.facet#link" return json.Marshal(t.RichtextFacet_Link) } - return nil, fmt.Errorf("cannot marshal empty enum") + return nil, fmt.Errorf("can not marshal empty union as JSON") } + func (t *RichtextFacet_Features_Elem) UnmarshalJSON(b []byte) error { - typ, err := util.TypeExtract(b) + typ, err := lexutil.TypeExtract(b) if err != nil { return err } switch typ { case "app.bsky.richtext.facet#mention": - t.RichtextFacet_Mention = new(appbskytypes.RichtextFacet_Mention) + t.RichtextFacet_Mention = new(appbsky.RichtextFacet_Mention) return json.Unmarshal(b, t.RichtextFacet_Mention) case "app.bsky.richtext.facet#link": - t.RichtextFacet_Link = new(appbskytypes.RichtextFacet_Link) + t.RichtextFacet_Link = new(appbsky.RichtextFacet_Link) return json.Unmarshal(b, t.RichtextFacet_Link) - default: return nil } @@ -70,22 +70,22 @@ func (t *RichtextFacet_Features_Elem) MarshalCBOR(w io.Writer) error { if t.RichtextFacet_Link != nil { return t.RichtextFacet_Link.MarshalCBOR(w) } - return fmt.Errorf("cannot cbor marshal empty enum") + return fmt.Errorf("can not marshal empty union as CBOR") } + func (t *RichtextFacet_Features_Elem) UnmarshalCBOR(r io.Reader) error { - typ, b, err := util.CborTypeExtractReader(r) + typ, b, err := lexutil.CborTypeExtractReader(r) if err != nil { return err } switch typ { case "app.bsky.richtext.facet#mention": - t.RichtextFacet_Mention = new(appbskytypes.RichtextFacet_Mention) + t.RichtextFacet_Mention = new(appbsky.RichtextFacet_Mention) return t.RichtextFacet_Mention.UnmarshalCBOR(bytes.NewReader(b)) case "app.bsky.richtext.facet#link": - t.RichtextFacet_Link = new(appbskytypes.RichtextFacet_Link) + t.RichtextFacet_Link = new(appbsky.RichtextFacet_Link) return t.RichtextFacet_Link.UnmarshalCBOR(bytes.NewReader(b)) - default: return nil } diff --git a/pkg/streamplace/servercreateWebhook.go b/pkg/streamplace/servercreateWebhook.go index 8576ff81..c06732e7 100644 --- a/pkg/streamplace/servercreateWebhook.go +++ b/pkg/streamplace/servercreateWebhook.go @@ -1,13 +1,13 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package streamplace +// Lexicon schema: place.stream.server.createWebhook -// schema: place.stream.server.createWebhook +package streamplace import ( "context" - "github.com/bluesky-social/indigo/lex/util" + lexutil "github.com/bluesky-social/indigo/lex/util" ) // ServerCreateWebhook_Input is the input argument to a place.stream.server.createWebhook call. @@ -38,9 +38,9 @@ type ServerCreateWebhook_Output struct { } // ServerCreateWebhook calls the XRPC method "place.stream.server.createWebhook". -func ServerCreateWebhook(ctx context.Context, c util.LexClient, input *ServerCreateWebhook_Input) (*ServerCreateWebhook_Output, error) { +func ServerCreateWebhook(ctx context.Context, c lexutil.LexClient, input *ServerCreateWebhook_Input) (*ServerCreateWebhook_Output, error) { var out ServerCreateWebhook_Output - if err := c.LexDo(ctx, util.Procedure, "application/json", "place.stream.server.createWebhook", nil, input, &out); err != nil { + if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "place.stream.server.createWebhook", nil, input, &out); err != nil { return nil, err } diff --git a/pkg/streamplace/serverdefs.go b/pkg/streamplace/serverdefs.go index 9aa1a617..18eff55e 100644 --- a/pkg/streamplace/serverdefs.go +++ b/pkg/streamplace/serverdefs.go @@ -1,8 +1,8 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package streamplace +// Lexicon schema: place.stream.server.defs -// schema: place.stream.server.defs +package streamplace // ServerDefs_RewriteRule is a "rewriteRule" in the place.stream.server.defs schema. type ServerDefs_RewriteRule struct { diff --git a/pkg/streamplace/serverdeleteWebhook.go b/pkg/streamplace/serverdeleteWebhook.go index 6d3ba992..a5d91ad5 100644 --- a/pkg/streamplace/serverdeleteWebhook.go +++ b/pkg/streamplace/serverdeleteWebhook.go @@ -1,13 +1,13 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package streamplace +// Lexicon schema: place.stream.server.deleteWebhook -// schema: place.stream.server.deleteWebhook +package streamplace import ( "context" - "github.com/bluesky-social/indigo/lex/util" + lexutil "github.com/bluesky-social/indigo/lex/util" ) // ServerDeleteWebhook_Input is the input argument to a place.stream.server.deleteWebhook call. @@ -23,9 +23,9 @@ type ServerDeleteWebhook_Output struct { } // ServerDeleteWebhook calls the XRPC method "place.stream.server.deleteWebhook". -func ServerDeleteWebhook(ctx context.Context, c util.LexClient, input *ServerDeleteWebhook_Input) (*ServerDeleteWebhook_Output, error) { +func ServerDeleteWebhook(ctx context.Context, c lexutil.LexClient, input *ServerDeleteWebhook_Input) (*ServerDeleteWebhook_Output, error) { var out ServerDeleteWebhook_Output - if err := c.LexDo(ctx, util.Procedure, "application/json", "place.stream.server.deleteWebhook", nil, input, &out); err != nil { + if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "place.stream.server.deleteWebhook", nil, input, &out); err != nil { return nil, err } diff --git a/pkg/streamplace/servergetServerTime.go b/pkg/streamplace/servergetServerTime.go index d672843d..3b13f85a 100644 --- a/pkg/streamplace/servergetServerTime.go +++ b/pkg/streamplace/servergetServerTime.go @@ -1,13 +1,13 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package streamplace +// Lexicon schema: place.stream.server.getServerTime -// schema: place.stream.server.getServerTime +package streamplace import ( "context" - "github.com/bluesky-social/indigo/lex/util" + lexutil "github.com/bluesky-social/indigo/lex/util" ) // ServerGetServerTime_Output is the output of a place.stream.server.getServerTime call. @@ -17,11 +17,11 @@ type ServerGetServerTime_Output struct { } // ServerGetServerTime calls the XRPC method "place.stream.server.getServerTime". -func ServerGetServerTime(ctx context.Context, c util.LexClient) (*ServerGetServerTime_Output, error) { +func ServerGetServerTime(ctx context.Context, c lexutil.LexClient) (*ServerGetServerTime_Output, error) { var out ServerGetServerTime_Output params := map[string]interface{}{} - if err := c.LexDo(ctx, util.Query, "", "place.stream.server.getServerTime", params, nil, &out); err != nil { + if err := c.LexDo(ctx, lexutil.Query, "", "place.stream.server.getServerTime", params, nil, &out); err != nil { return nil, err } diff --git a/pkg/streamplace/servergetWebhook.go b/pkg/streamplace/servergetWebhook.go index 6ba770e0..17c2e3f2 100644 --- a/pkg/streamplace/servergetWebhook.go +++ b/pkg/streamplace/servergetWebhook.go @@ -1,13 +1,13 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package streamplace +// Lexicon schema: place.stream.server.getWebhook -// schema: place.stream.server.getWebhook +package streamplace import ( "context" - "github.com/bluesky-social/indigo/lex/util" + lexutil "github.com/bluesky-social/indigo/lex/util" ) // ServerGetWebhook_Output is the output of a place.stream.server.getWebhook call. @@ -18,12 +18,12 @@ type ServerGetWebhook_Output struct { // ServerGetWebhook calls the XRPC method "place.stream.server.getWebhook". // // id: The ID of the webhook to retrieve. -func ServerGetWebhook(ctx context.Context, c util.LexClient, id string) (*ServerGetWebhook_Output, error) { +func ServerGetWebhook(ctx context.Context, c lexutil.LexClient, id string) (*ServerGetWebhook_Output, error) { var out ServerGetWebhook_Output params := map[string]interface{}{} params["id"] = id - if err := c.LexDo(ctx, util.Query, "", "place.stream.server.getWebhook", params, nil, &out); err != nil { + if err := c.LexDo(ctx, lexutil.Query, "", "place.stream.server.getWebhook", params, nil, &out); err != nil { return nil, err } diff --git a/pkg/streamplace/serverlistWebhooks.go b/pkg/streamplace/serverlistWebhooks.go index aa945d78..804e8f44 100644 --- a/pkg/streamplace/serverlistWebhooks.go +++ b/pkg/streamplace/serverlistWebhooks.go @@ -1,13 +1,13 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package streamplace +// Lexicon schema: place.stream.server.listWebhooks -// schema: place.stream.server.listWebhooks +package streamplace import ( "context" - "github.com/bluesky-social/indigo/lex/util" + lexutil "github.com/bluesky-social/indigo/lex/util" ) // ServerListWebhooks_Output is the output of a place.stream.server.listWebhooks call. @@ -23,7 +23,7 @@ type ServerListWebhooks_Output struct { // cursor: An optional cursor for pagination. // event: Filter webhooks that handle this event type. // limit: The number of webhooks to return. -func ServerListWebhooks(ctx context.Context, c util.LexClient, active bool, cursor string, event string, limit int64) (*ServerListWebhooks_Output, error) { +func ServerListWebhooks(ctx context.Context, c lexutil.LexClient, active bool, cursor string, event string, limit int64) (*ServerListWebhooks_Output, error) { var out ServerListWebhooks_Output params := map[string]interface{}{} @@ -39,7 +39,7 @@ func ServerListWebhooks(ctx context.Context, c util.LexClient, active bool, curs if limit != 0 { params["limit"] = limit } - if err := c.LexDo(ctx, util.Query, "", "place.stream.server.listWebhooks", params, nil, &out); err != nil { + if err := c.LexDo(ctx, lexutil.Query, "", "place.stream.server.listWebhooks", params, nil, &out); err != nil { return nil, err } diff --git a/pkg/streamplace/serversettings.go b/pkg/streamplace/serversettings.go index a9e262e0..ca2a9547 100644 --- a/pkg/streamplace/serversettings.go +++ b/pkg/streamplace/serversettings.go @@ -1,19 +1,19 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package streamplace +// Lexicon schema: place.stream.server.settings -// schema: place.stream.server.settings +package streamplace import ( - "github.com/bluesky-social/indigo/lex/util" + lexutil "github.com/bluesky-social/indigo/lex/util" ) func init() { - util.RegisterType("place.stream.server.settings", &ServerSettings{}) -} // -// RECORDTYPE: ServerSettings + lexutil.RegisterType("place.stream.server.settings", &ServerSettings{}) +} + type ServerSettings struct { - LexiconTypeID string `json:"$type,const=place.stream.server.settings" cborgen:"$type,const=place.stream.server.settings"` + LexiconTypeID string `json:"$type" cborgen:"$type,const=place.stream.server.settings"` // debugRecording: Whether this node may archive your livestream for improving the service DebugRecording *bool `json:"debugRecording,omitempty" cborgen:"debugRecording,omitempty"` } diff --git a/pkg/streamplace/serverupdateWebhook.go b/pkg/streamplace/serverupdateWebhook.go index 08bab165..88779465 100644 --- a/pkg/streamplace/serverupdateWebhook.go +++ b/pkg/streamplace/serverupdateWebhook.go @@ -1,13 +1,13 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package streamplace +// Lexicon schema: place.stream.server.updateWebhook -// schema: place.stream.server.updateWebhook +package streamplace import ( "context" - "github.com/bluesky-social/indigo/lex/util" + lexutil "github.com/bluesky-social/indigo/lex/util" ) // ServerUpdateWebhook_Input is the input argument to a place.stream.server.updateWebhook call. @@ -40,9 +40,9 @@ type ServerUpdateWebhook_Output struct { } // ServerUpdateWebhook calls the XRPC method "place.stream.server.updateWebhook". -func ServerUpdateWebhook(ctx context.Context, c util.LexClient, input *ServerUpdateWebhook_Input) (*ServerUpdateWebhook_Output, error) { +func ServerUpdateWebhook(ctx context.Context, c lexutil.LexClient, input *ServerUpdateWebhook_Input) (*ServerUpdateWebhook_Output, error) { var out ServerUpdateWebhook_Output - if err := c.LexDo(ctx, util.Procedure, "application/json", "place.stream.server.updateWebhook", nil, input, &out); err != nil { + if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "place.stream.server.updateWebhook", nil, input, &out); err != nil { return nil, err } diff --git a/pkg/streamplace/streamdefs.go b/pkg/streamplace/streamdefs.go index 954479a2..1224680e 100644 --- a/pkg/streamplace/streamdefs.go +++ b/pkg/streamplace/streamdefs.go @@ -1,37 +1,31 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package streamplace +// Lexicon schema: place.stream.defs -// schema: place.stream.defs +package streamplace import ( - appbskytypes "github.com/bluesky-social/indigo/api/bsky" + appbsky "github.com/bluesky-social/indigo/api/bsky" ) // Defs_BlockView is a "blockView" in the place.stream.defs schema. -// -// RECORDTYPE: Defs_BlockView type Defs_BlockView struct { - LexiconTypeID string `json:"$type,const=place.stream.defs#blockView" cborgen:"$type,const=place.stream.defs#blockView"` - Blocker *appbskytypes.ActorDefs_ProfileViewBasic `json:"blocker" cborgen:"blocker"` - Cid string `json:"cid" cborgen:"cid"` - IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` - Record *appbskytypes.GraphBlock `json:"record" cborgen:"record"` - Uri string `json:"uri" cborgen:"uri"` + LexiconTypeID string `json:"$type" cborgen:"$type,const=place.stream.defs#blockView"` + Blocker *appbsky.ActorDefs_ProfileViewBasic `json:"blocker" cborgen:"blocker"` + Cid string `json:"cid" cborgen:"cid"` + IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` + Record *appbsky.GraphBlock `json:"record" cborgen:"record"` + Uri string `json:"uri" cborgen:"uri"` } // Defs_Rendition is a "rendition" in the place.stream.defs schema. -// -// RECORDTYPE: Defs_Rendition type Defs_Rendition struct { - LexiconTypeID string `json:"$type,const=place.stream.defs#rendition" cborgen:"$type,const=place.stream.defs#rendition"` + LexiconTypeID string `json:"$type" cborgen:"$type,const=place.stream.defs#rendition"` Name string `json:"name" cborgen:"name"` } // Defs_Renditions is a "renditions" in the place.stream.defs schema. -// -// RECORDTYPE: Defs_Renditions type Defs_Renditions struct { - LexiconTypeID string `json:"$type,const=place.stream.defs#renditions" cborgen:"$type,const=place.stream.defs#renditions"` + LexiconTypeID string `json:"$type" cborgen:"$type,const=place.stream.defs#renditions"` Renditions []*Defs_Rendition `json:"renditions" cborgen:"renditions"` } diff --git a/pkg/streamplace/streamkey.go b/pkg/streamplace/streamkey.go index c45af7fb..4f699852 100644 --- a/pkg/streamplace/streamkey.go +++ b/pkg/streamplace/streamkey.go @@ -1,19 +1,19 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package streamplace +// Lexicon schema: place.stream.key -// schema: place.stream.key +package streamplace import ( - "github.com/bluesky-social/indigo/lex/util" + lexutil "github.com/bluesky-social/indigo/lex/util" ) func init() { - util.RegisterType("place.stream.key", &Key{}) -} // -// RECORDTYPE: Key + lexutil.RegisterType("place.stream.key", &Key{}) +} + type Key struct { - LexiconTypeID string `json:"$type,const=place.stream.key" cborgen:"$type,const=place.stream.key"` + LexiconTypeID string `json:"$type" cborgen:"$type,const=place.stream.key"` // createdAt: Client-declared timestamp when this key was created. CreatedAt string `json:"createdAt" cborgen:"createdAt"` // createdBy: The name of the client that created this key. diff --git a/pkg/streamplace/streamlivestream.go b/pkg/streamplace/streamlivestream.go index 232b82f3..dcb9f3df 100644 --- a/pkg/streamplace/streamlivestream.go +++ b/pkg/streamplace/streamlivestream.go @@ -1,24 +1,24 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package streamplace +// Lexicon schema: place.stream.livestream -// schema: place.stream.livestream +package streamplace import ( "encoding/json" "fmt" - comatprototypes "github.com/bluesky-social/indigo/api/atproto" - appbskytypes "github.com/bluesky-social/indigo/api/bsky" - "github.com/bluesky-social/indigo/lex/util" + comatproto "github.com/bluesky-social/indigo/api/atproto" + appbsky "github.com/bluesky-social/indigo/api/bsky" + lexutil "github.com/bluesky-social/indigo/lex/util" ) func init() { - util.RegisterType("place.stream.livestream", &Livestream{}) -} // -// RECORDTYPE: Livestream + lexutil.RegisterType("place.stream.livestream", &Livestream{}) +} + type Livestream struct { - LexiconTypeID string `json:"$type,const=place.stream.livestream" cborgen:"$type,const=place.stream.livestream"` + LexiconTypeID string `json:"$type" cborgen:"$type,const=place.stream.livestream"` // agent: The source of the livestream, if available, in a User Agent format: ` / ` e.g. Streamplace/0.7.5 iOS Agent *string `json:"agent,omitempty" cborgen:"agent,omitempty"` // canonicalUrl: The primary URL where this livestream can be viewed, if available. @@ -27,8 +27,8 @@ type Livestream struct { CreatedAt string `json:"createdAt" cborgen:"createdAt"` NotificationSettings *Livestream_NotificationSettings `json:"notificationSettings,omitempty" cborgen:"notificationSettings,omitempty"` // post: The post that announced this livestream. - Post *comatprototypes.RepoStrongRef `json:"post,omitempty" cborgen:"post,omitempty"` - Thumb *util.LexBlob `json:"thumb,omitempty" cborgen:"thumb,omitempty"` + Post *comatproto.RepoStrongRef `json:"post,omitempty" cborgen:"post,omitempty"` + Thumb *lexutil.LexBlob `json:"thumb,omitempty" cborgen:"thumb,omitempty"` // title: The title of the livestream, as it will be announced to followers. Title string `json:"title" cborgen:"title"` // url: The URL where this stream can be found. This is primarily a hint for other Streamplace nodes to locate and replicate the stream. @@ -36,15 +36,13 @@ type Livestream struct { } // Livestream_LivestreamView is a "livestreamView" in the place.stream.livestream schema. -// -// RECORDTYPE: Livestream_LivestreamView type Livestream_LivestreamView struct { - LexiconTypeID string `json:"$type,const=place.stream.livestream#livestreamView" cborgen:"$type,const=place.stream.livestream#livestreamView"` - Author *appbskytypes.ActorDefs_ProfileViewBasic `json:"author" cborgen:"author"` - Cid string `json:"cid" cborgen:"cid"` - IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` - Record *util.LexiconTypeDecoder `json:"record" cborgen:"record"` - Uri string `json:"uri" cborgen:"uri"` + LexiconTypeID string `json:"$type" cborgen:"$type,const=place.stream.livestream#livestreamView"` + Author *appbsky.ActorDefs_ProfileViewBasic `json:"author" cborgen:"author"` + Cid string `json:"cid" cborgen:"cid"` + IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` + Record *lexutil.LexiconTypeDecoder `json:"record" cborgen:"record"` + Uri string `json:"uri" cborgen:"uri"` // viewerCount: The number of viewers watching this livestream. Use when you can't reasonably use #viewerCount directly. ViewerCount *Livestream_ViewerCount `json:"viewerCount,omitempty" cborgen:"viewerCount,omitempty"` } @@ -94,10 +92,11 @@ func (t *Livestream_StreamplaceAnything_Livestream) MarshalJSON() ([]byte, error t.ChatDefs_MessageView.LexiconTypeID = "place.stream.chat.defs#messageView" return json.Marshal(t.ChatDefs_MessageView) } - return nil, fmt.Errorf("cannot marshal empty enum") + return nil, fmt.Errorf("can not marshal empty union as JSON") } + func (t *Livestream_StreamplaceAnything_Livestream) UnmarshalJSON(b []byte) error { - typ, err := util.TypeExtract(b) + typ, err := lexutil.TypeExtract(b) if err != nil { return err } @@ -121,16 +120,13 @@ func (t *Livestream_StreamplaceAnything_Livestream) UnmarshalJSON(b []byte) erro case "place.stream.chat.defs#messageView": t.ChatDefs_MessageView = new(ChatDefs_MessageView) return json.Unmarshal(b, t.ChatDefs_MessageView) - default: return nil } } // Livestream_ViewerCount is a "viewerCount" in the place.stream.livestream schema. -// -// RECORDTYPE: Livestream_ViewerCount type Livestream_ViewerCount struct { - LexiconTypeID string `json:"$type,const=place.stream.livestream#viewerCount" cborgen:"$type,const=place.stream.livestream#viewerCount"` + LexiconTypeID string `json:"$type" cborgen:"$type,const=place.stream.livestream#viewerCount"` Count int64 `json:"count" cborgen:"count"` } diff --git a/pkg/streamplace/streamsegment.go b/pkg/streamplace/streamsegment.go index a18fcef5..bc192e90 100644 --- a/pkg/streamplace/streamsegment.go +++ b/pkg/streamplace/streamsegment.go @@ -1,19 +1,19 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package streamplace +// Lexicon schema: place.stream.segment -// schema: place.stream.segment +package streamplace import ( - "github.com/bluesky-social/indigo/lex/util" + lexutil "github.com/bluesky-social/indigo/lex/util" ) func init() { - util.RegisterType("place.stream.segment", &Segment{}) -} // -// RECORDTYPE: Segment + lexutil.RegisterType("place.stream.segment", &Segment{}) +} + type Segment struct { - LexiconTypeID string `json:"$type,const=place.stream.segment" cborgen:"$type,const=place.stream.segment"` + LexiconTypeID string `json:"$type" cborgen:"$type,const=place.stream.segment"` Audio []*Segment_Audio `json:"audio,omitempty" cborgen:"audio,omitempty"` ContentRights *MetadataContentRights `json:"contentRights,omitempty" cborgen:"contentRights,omitempty"` ContentWarnings *MetadataContentWarnings `json:"contentWarnings,omitempty" cborgen:"contentWarnings,omitempty"` @@ -47,8 +47,8 @@ type Segment_Framerate struct { // Segment_SegmentView is a "segmentView" in the place.stream.segment schema. type Segment_SegmentView struct { - Cid string `json:"cid" cborgen:"cid"` - Record *util.LexiconTypeDecoder `json:"record" cborgen:"record"` + Cid string `json:"cid" cborgen:"cid"` + Record *lexutil.LexiconTypeDecoder `json:"record" cborgen:"record"` } // Segment_Video is a "video" in the place.stream.segment schema.