bluesky

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMalformedRecordUri = fmt.Errorf("malformed record uri")

Functions

func FormatTime

func FormatTime(t time.Time) string

func ParseNamespaceID

func ParseNamespaceID(recordUri string) (string, error)

Parse the namespace ID from a full record URI, such as app.bsky.feed.post or app.bsky.graph.follow.

Errors with a `ErrMalformedRecordUri` if the URI is not a _parseable_ record URI.

func ParseTime

func ParseTime(str string) (time.Time, error)

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func ClientFromCredentials added in v0.0.2

func ClientFromCredentials(ctx context.Context, credentials *Credentials) (*Client, error)

func ClientFromToken added in v0.0.2

func ClientFromToken(ctx context.Context, token string) (*Client, string, error)

ClientFromToken takes a JWT access token, and makes a client. It then calls GetSession to verify the token.

On success, an authenticated client is returned along with the JWTs DID

func (*Client) Follow

func (c *Client) Follow(
	ctx context.Context, subjectDID string,
) error

Follow creates an app.bsky.graph.follow for the user the client is authenticated as.

func (*Client) GetFollowers

func (c *Client) GetFollowers(
	ctx context.Context, actor string, cursor string, limit int64,
) (*bsky.GraphGetFollowers_Output, error)

func (*Client) GetPostThread

func (c *Client) GetPostThread(
	ctx context.Context, uri string,
) (*bsky.FeedGetPostThread_Output, error)

func (*Client) GetProfile

func (c *Client) GetProfile(
	ctx context.Context, actor string,
) (*bsky.ActorDefs_ProfileViewDetailed, error)

GetProfile fetches an actor's profile. actor can be a DID or a handle.

func (*Client) ResolveHandle added in v0.0.2

func (c *Client) ResolveHandle(ctx context.Context, handle string) (*atproto.IdentityResolveHandle_Output, error)

type Credentials added in v0.0.2

type Credentials struct {
	Identifier string
	Password   string
}

func CredentialsFromEnv added in v0.0.2

func CredentialsFromEnv() (*Credentials, error)

Jump to

Keyboard shortcuts

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