rss

package
v0.0.0-...-524d49d Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a 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) 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 Feed

type Feed struct {
	gorm.Model

	DID     string `gorm:"index"`
	FeedURL string `gorm:"index"`

	LastChecked time.Time
	LastGUID    string
}

func (*Feed) Update

func (f *Feed) Update() (*Feed, *gofeed.Feed, error)

type FeedConsumer

type FeedConsumer struct {
	DB *gorm.DB
	// contains filtered or unexported fields
}

func NewFeedConsumer

func NewFeedConsumer(logger *slog.Logger, dbPath string) (*FeedConsumer, error)

func (*FeedConsumer) AddFeed

func (fc *FeedConsumer) AddFeed(feedURL, did string) (*Feed, error)

func (*FeedConsumer) AddUser

func (fc *FeedConsumer) AddUser(ctx context.Context, handle, appPassword string) (*User, error)

func (*FeedConsumer) GetFeed

func (fc *FeedConsumer) GetFeed(did string) (*Feed, error)

func (*FeedConsumer) GetFeeds

func (fc *FeedConsumer) GetFeeds() ([]*Feed, error)

func (*FeedConsumer) GetUser

func (fc *FeedConsumer) GetUser(did string) (*User, error)

func (*FeedConsumer) MarshalPost

func (fc *FeedConsumer) MarshalPost(ctx context.Context, client *Client, feed *gofeed.Feed, item *gofeed.Item) (*PostArgs, error)

func (*FeedConsumer) NewBskyClient

func (fc *FeedConsumer) NewBskyClient(ctx context.Context, rawDid, appPassword string) (*Client, error)

func (*FeedConsumer) RemoveFeed

func (fc *FeedConsumer) RemoveFeed(did string) error

func (*FeedConsumer) ResumeClient

func (fc *FeedConsumer) ResumeClient(ctx context.Context, rawDid, accessJwt, refreshJwt string) (*Client, error)

func (*FeedConsumer) SaveFeed

func (fc *FeedConsumer) SaveFeed(feed *Feed) error

func (*FeedConsumer) Shutdown

func (fc *FeedConsumer) Shutdown()

func (*FeedConsumer) Start

func (fc *FeedConsumer) Start()

func (*FeedConsumer) UpdateFeeds

func (fc *FeedConsumer) UpdateFeeds() error

type PostArgs

type PostArgs struct {
	Text      string
	Tags      []string
	Labels    []string
	Languages []string
	Embed     *bsky.FeedPost_Embed
	CreatedAt time.Time
}

type User

type User struct {
	gorm.Model
	DID          string `gorm:"uniqueIndex"`
	AccessToken  string
	RefreshToken string
	RefreshedAt  time.Time
}

Jump to

Keyboard shortcuts

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