porting all github actions from bluesky-social/indigo to tangled CI

api: getHostStatus and listHosts endpoints (#1025)

authored by bnewbold.net and committed by GitHub 8500c47d 68ea75a3

+5
api/atproto/syncdefs.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package atproto 4 + 5 + // schema: com.atproto.sync.defs
+37
api/atproto/syncgetHostStatus.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package atproto 4 + 5 + // schema: com.atproto.sync.getHostStatus 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // SyncGetHostStatus_Output is the output of a com.atproto.sync.getHostStatus call. 14 + type SyncGetHostStatus_Output struct { 15 + // accountCount: Number of accounts on the server which are associated with the upstream host. Note that the upstream may actually have more accounts. 16 + AccountCount *int64 `json:"accountCount,omitempty" cborgen:"accountCount,omitempty"` 17 + Hostname string `json:"hostname" cborgen:"hostname"` 18 + // seq: Recent repo stream event sequence number. May be delayed from actual stream processing (eg, persisted cursor not in-memory cursor). 19 + Seq *int64 `json:"seq,omitempty" cborgen:"seq,omitempty"` 20 + Status *string `json:"status,omitempty" cborgen:"status,omitempty"` 21 + } 22 + 23 + // SyncGetHostStatus calls the XRPC method "com.atproto.sync.getHostStatus". 24 + // 25 + // hostname: Hostname of the host (eg, PDS or relay) being queried. 26 + func SyncGetHostStatus(ctx context.Context, c *xrpc.Client, hostname string) (*SyncGetHostStatus_Output, error) { 27 + var out SyncGetHostStatus_Output 28 + 29 + params := map[string]interface{}{ 30 + "hostname": hostname, 31 + } 32 + if err := c.Do(ctx, xrpc.Query, "", "com.atproto.sync.getHostStatus", params, nil, &out); err != nil { 33 + return nil, err 34 + } 35 + 36 + return &out, nil 37 + }
+43
api/atproto/synclistHosts.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package atproto 4 + 5 + // schema: com.atproto.sync.listHosts 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // SyncListHosts_Host is a "host" in the com.atproto.sync.listHosts schema. 14 + type SyncListHosts_Host struct { 15 + AccountCount *int64 `json:"accountCount,omitempty" cborgen:"accountCount,omitempty"` 16 + // hostname: hostname of server; not a URL (no scheme) 17 + Hostname string `json:"hostname" cborgen:"hostname"` 18 + // seq: Recent repo stream event sequence number. May be delayed from actual stream processing (eg, persisted cursor not in-memory cursor). 19 + Seq *int64 `json:"seq,omitempty" cborgen:"seq,omitempty"` 20 + Status *string `json:"status,omitempty" cborgen:"status,omitempty"` 21 + } 22 + 23 + // SyncListHosts_Output is the output of a com.atproto.sync.listHosts call. 24 + type SyncListHosts_Output struct { 25 + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` 26 + // hosts: Sort order is not formally specified. Recommended order is by time host was first seen by the server, with oldest first. 27 + Hosts []*SyncListHosts_Host `json:"hosts" cborgen:"hosts"` 28 + } 29 + 30 + // SyncListHosts calls the XRPC method "com.atproto.sync.listHosts". 31 + func SyncListHosts(ctx context.Context, c *xrpc.Client, cursor string, limit int64) (*SyncListHosts_Output, error) { 32 + var out SyncListHosts_Output 33 + 34 + params := map[string]interface{}{ 35 + "cursor": cursor, 36 + "limit": limit, 37 + } 38 + if err := c.Do(ctx, xrpc.Query, "", "com.atproto.sync.listHosts", params, nil, &out); err != nil { 39 + return nil, err 40 + } 41 + 42 + return &out, nil 43 + }