feed

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GenerateFunc

type GenerateFunc func(ctx context.Context, queries *store.PGXStore, cursor string, limit int) ([]Post, error)

type Meta

type Meta struct {
	// ID is the rkey that is used to identify the Feed in generation requests.
	ID string
	// DisplayName is the short name of the feed used in the BlueSky client.
	DisplayName string
	// Description is a long description of the feed used in the BlueSky client.
	Description string

	// Priority controls where the feed shows up on FurryList UIs.
	// Higher priority wins. Negative values indicate the feed should be hidden
	// in the UI.
	Priority int32
}

type Post

type Post struct {
	URI    string
	Cursor string
}

type Service

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

func ServiceWithDefaultFeeds

func ServiceWithDefaultFeeds(pgxStore *store.PGXStore) *Service

ServiceWithDefaultFeeds instantiates a registry with all the standard bksy-furry-feed feeds. TODO: This really doesn't belong here, ideally, these feeds would be defined elsewhere to make this more pluggable. A refactor idea for the future :)

func (*Service) GetFeedPosts

func (s *Service) GetFeedPosts(ctx context.Context, feedKey string, cursor string, limit int) (posts []Post, err error)

func (*Service) IDs

func (s *Service) IDs() []string

IDs returns a slice of the IDs of feeds which are eligible for generation.

func (*Service) Metas added in v0.0.22

func (s *Service) Metas() []Meta

func (*Service) Register

func (s *Service) Register(m Meta, generateFunc GenerateFunc)

Jump to

Keyboard shortcuts

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