feed

package
v0.0.0-...-37004a0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFeedAlreadyExists = errutil.NewError(errutil.TypeAlreadyExists, "feed already exists")
	ErrFeedNotFound      = errutil.NewError(errutil.TypeNotFound, "feed not found")
)

define errors

Functions

func CamelToSnake

func CamelToSnake(camelCase string) string

CamelToSnake converts a string from camel case to snake case and replaces spaces with underscores e.g. "HelloWorld" -> "hello_world"

func ScheduleFeedFetcher

func ScheduleFeedFetcher(lc fx.Lifecycle, logger *log.Logger, h *Handler) error

Types

type Handler

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

func NewHandler

func NewHandler(s *store.Store[repository.FeedRepository], log *log.Logger, activitypub *activitypub.Handler, pubsub *pubsub.Client) *Handler

func (*Handler) AddNewFeed

func (h *Handler) AddNewFeed(ctx context.Context, feedurl string) (feed model.Feed, err error)

func (*Handler) FetchFeed

func (h *Handler) FetchFeed(ctx context.Context, source model.Feed) func() error

func (*Handler) FetchFeedUpdates

func (h *Handler) FetchFeedUpdates(ctx context.Context, feed model.Feed) error

func (*Handler) GetFeed

func (h *Handler) GetFeed(ctx context.Context, id string) (feed model.Feed, err error)

func (*Handler) GetFeedWithUsername

func (h *Handler) GetFeedWithUsername(ctx context.Context, username string) (feed model.Feed, err error)

func (*Handler) ListFeedStatus

func (h *Handler) ListFeedStatus(ctx context.Context, id string, offset int, limit int) (totalCount int, statuses []model.Status, err error)

func (*Handler) ListFeeds

func (h *Handler) ListFeeds(ctx context.Context, offset int, limit int) (totalCount int, feeds []model.Feed, err error)

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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