this repo has no description
0
fork

Configure Feed

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

client: old API sketch

+57
+57
atproto/client/client.go
··· 1 + package client 2 + 3 + import ( 4 + "context" 5 + "fmt" 6 + "net/http" 7 + 8 + "github.com/bluesky-social/indigo/atproto/syntax" 9 + ) 10 + 11 + type AuthInfo struct { 12 + AccessJwt string `json:"accessJwt"` 13 + RefreshJwt string `json:"refreshJwt"` 14 + AdminToken string `json:"adminToken"` 15 + Handle string `json:"handle"` 16 + Did string `json:"did"` 17 + } 18 + 19 + type Client struct { 20 + Client *http.Client 21 + Auth *AuthInfo 22 + Host string 23 + UserAgent *string 24 + Headers map[string]string 25 + } 26 + 27 + // Context can include additional headers, including "cache busting", metrics collection, etc. 28 + 29 + func (c *Client) Login(ctx context.Context, ident syntax.AtIdentifier, password string) (*AuthInfo, error) { 30 + return nil, fmt.Errorf("XXX: not implemented") 31 + } 32 + 33 + func (c *Client) Get(ctx context.Context, endpoint string, params map[string]interface{}) (map[string]interface{}, error) { 34 + return nil, fmt.Errorf("XXX: not implemented") 35 + } 36 + 37 + func (c *Client) GetBytes(ctx context.Context, endpoint string, params map[string]interface{}) ([]byte, error) { 38 + return nil, fmt.Errorf("XXX: not implemented") 39 + } 40 + 41 + func (c *Client) Post(ctx context.Context, endpoint string, body, params map[string]interface{}) (map[string]interface{}, error) { 42 + return nil, fmt.Errorf("XXX: not implemented") 43 + } 44 + 45 + // TODO: return stdlib HTTP wrapper? 46 + func (c *Client) PostBytes(ctx context.Context, endpoint string, contentType string, body, params map[string]interface{}) ([]byte, error) { 47 + return nil, fmt.Errorf("XXX: not implemented") 48 + } 49 + 50 + type StreamEvent struct { 51 + // header meta 52 + // body bytes 53 + } 54 + 55 + func (c *Client) Subscribe(ctx context.Context, endpoint string, ch <-chan StreamEvent, params map[string]interface{}) error { 56 + return fmt.Errorf("XXX: not implemented") 57 + }