client

package
v0.0.0-...-66a65b0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2023 License: MIT Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	PLCHost         string
	PDSHost         string
	ActorDID        syntax.DID
	AutoRefreshAuth bool
	// contains filtered or unexported fields
}

Client is a Bluesky API Client

func New

func New(pdsHost, plcHost string) *Client

New creates a new Bluesky API Client

func (*Client) CreatePost

func (c *Client) CreatePost(ctx context.Context, args PostArgs) (*syntax.ATURI, error)

CreatePost creates a new post

func (*Client) Login

func (c *Client) Login(ctx context.Context, handle, appPassword string) error

Login logs in the user with the given handle and appPassword

func (*Client) RefreshAuth

func (c *Client) RefreshAuth(ctx context.Context) error

RefreshAuth refreshes the auth token for the client

func (*Client) UploadImage

func (c *Client) UploadImage(ctx context.Context, image io.Reader) (*util.LexBlob, error)

UploadImage uploads an image to the PDS

type Image

type Image struct {
	Reader  io.Reader
	AltText string
}

type PostArgs

type PostArgs struct {
	Text         string
	Images       []Image
	Tags         []string
	Labels       []string
	ReplyTo      *syntax.ATURI
	Quoting      *syntax.ATURI
	Languages    []string
	EmbeddedLink string
	CreatedAt    time.Time
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL