bizyesod

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func GetBuiltinActionMap added in v0.2.10

func GetBuiltinActionMap(
	ctx context.Context,
) map[string]func(context.Context, *modelsupervisor.FeatureRequest, *modelfeed.Item) (*modelfeed.Item, error)

func NewFeedOwnerCache added in v0.2.10

func NewFeedOwnerCache(
	repo YesodRepo,
	store libcache.Store,
) *libcache.Map[modelyesod.FeedConfig, modeltiphereth.User]

func RequiredEndAction added in v0.2.10

func RequiredEndAction(ctx context.Context, item *modelfeed.Item) (*modelfeed.Item, error)

func RequiredStartAction added in v0.2.10

func RequiredStartAction(ctx context.Context, item *modelfeed.Item) (*modelfeed.Item, error)

Types

type Yesod

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

func NewYesod

func NewYesod(
	repo YesodRepo,
	supv *supervisor.Supervisor,
	cron *libcron.Cron,

	sClient *client.Searcher,
	pullFeed *libmq.Topic[modelyesod.PullFeed],
	systemNotify *libmq.Topic[modelnetzach.SystemNotify],
	feedOwner *libcache.Map[modelyesod.FeedConfig, modeltiphereth.User],
) (*Yesod, error)

func (*Yesod) AddFeedItemToCollection added in v0.2.10

func (y *Yesod) AddFeedItemToCollection(ctx context.Context, collectionID model.InternalID,
	itemID model.InternalID) *errors.Error

func (*Yesod) CreateFeedActionSet added in v0.2.10

func (y *Yesod) CreateFeedActionSet(
	ctx context.Context,
	set *modelyesod.FeedActionSet,
) (model.InternalID, *errors.Error)

func (*Yesod) CreateFeedConfig

func (y *Yesod) CreateFeedConfig(ctx context.Context, config *modelyesod.FeedConfig) (model.InternalID, *errors.Error)

func (*Yesod) CreateFeedItemCollection added in v0.2.10

func (y *Yesod) CreateFeedItemCollection(
	ctx context.Context,
	collection *modelyesod.FeedItemCollection,
) (model.InternalID, *errors.Error)

func (*Yesod) GetBuiltInFeedActions added in v0.2.10

func (y *Yesod) GetBuiltInFeedActions() []*modelsupervisor.FeatureFlag

func (*Yesod) GetFeedItem added in v0.0.8

func (y *Yesod) GetFeedItem(ctx context.Context, id model.InternalID) (*modelfeed.Item, *errors.Error)

func (*Yesod) GetFeedItems added in v0.0.8

func (y *Yesod) GetFeedItems(ctx context.Context, ids []model.InternalID) ([]*modelfeed.Item, *errors.Error)

func (*Yesod) GroupFeedItems added in v0.0.9

func (y *Yesod) GroupFeedItems(
	ctx context.Context,
	groupBy modelyesod.GroupFeedItemsBy,
	feedIDs []model.InternalID,
	authors []string,
	platforms []string,
	timeRange *model.TimeRange,
	groupSize int,
	categories []string,
) (map[model.TimeRange][]*modelyesod.FeedItemDigest, *errors.Error)

func (*Yesod) ListFeedActionSets added in v0.2.10

func (y *Yesod) ListFeedActionSets(ctx context.Context, paging model.Paging) ([]*modelyesod.FeedActionSet, int, *errors.Error)

func (*Yesod) ListFeedCategories added in v0.1.15

func (y *Yesod) ListFeedCategories(ctx context.Context) ([]string, *errors.Error)

func (*Yesod) ListFeedItemCollections added in v0.2.10

func (y *Yesod) ListFeedItemCollections(
	ctx context.Context,
	paging model.Paging,
	ids []model.InternalID,
	categories []string,
) ([]*modelyesod.FeedItemCollection, int, *errors.Error)

func (*Yesod) ListFeedItems added in v0.0.8

func (y *Yesod) ListFeedItems(
	ctx context.Context,
	paging model.Paging,
	feedIDs []model.InternalID,
	authors []string,
	platforms []string,
	timeRange *model.TimeRange,
	categories []string,
) ([]*modelyesod.FeedItemDigest, int, *errors.Error)

func (*Yesod) ListFeedItemsInCollection added in v0.2.10

func (y *Yesod) ListFeedItemsInCollection(
	ctx context.Context,
	paging model.Paging,
	ids []model.InternalID,
	authors []string,
	platforms []string,
	categories []string,
	timeRange *model.TimeRange,
) ([]*modelyesod.FeedItemDigest, int, *errors.Error)

func (*Yesod) ListFeedPlatforms added in v0.1.15

func (y *Yesod) ListFeedPlatforms(ctx context.Context) ([]string, *errors.Error)

func (*Yesod) ListFeeds added in v0.0.8

func (y *Yesod) ListFeeds(
	ctx context.Context,
	paging model.Paging,
	ids []model.InternalID,
	statuses []modelyesod.FeedConfigStatus,
	categories []string,
) ([]*modelyesod.FeedWithConfig, int, *errors.Error)

func (*Yesod) PullFeeds

func (y *Yesod) PullFeeds(ctx context.Context) error

func (*Yesod) ReadFeedItem added in v0.1.15

func (y *Yesod) ReadFeedItem(ctx context.Context, id model.InternalID) *errors.Error

func (*Yesod) RemoveFeedItemFromCollection added in v0.2.10

func (y *Yesod) RemoveFeedItemFromCollection(ctx context.Context, collectionID model.InternalID,
	itemID model.InternalID) *errors.Error

func (*Yesod) UpdateFeedActionSet added in v0.2.10

func (y *Yesod) UpdateFeedActionSet(ctx context.Context, set *modelyesod.FeedActionSet) *errors.Error

func (*Yesod) UpdateFeedConfig

func (y *Yesod) UpdateFeedConfig(ctx context.Context, config *modelyesod.FeedConfig) *errors.Error

func (*Yesod) UpdateFeedItemCollection added in v0.2.10

func (y *Yesod) UpdateFeedItemCollection(
	ctx context.Context,
	collection *modelyesod.FeedItemCollection,
) *errors.Error

type YesodRepo

type YesodRepo interface {
	CreateFeedConfig(context.Context, model.InternalID, *modelyesod.FeedConfig) error
	UpdateFeedConfig(context.Context, model.InternalID, *modelyesod.FeedConfig) error
	ListFeedCategories(context.Context, model.InternalID) ([]string, error)
	ListFeedPlatforms(context.Context, model.InternalID) ([]string, error)
	ListFeedConfigNeedPull(context.Context, []string, []modelyesod.FeedConfigStatus,
		modelyesod.ListFeedOrder, time.Time, int) ([]*modelyesod.FeedConfig, error)
	UpdateFeedConfigAsInQueue(context.Context, model.InternalID) error
	ListFeedConfigs(context.Context, model.InternalID, model.Paging, []model.InternalID,
		[]modelyesod.FeedConfigStatus, []string) ([]*modelyesod.FeedWithConfig, int, error)
	ListFeedItems(context.Context, model.InternalID, model.Paging, []model.InternalID,
		[]string, []string, *model.TimeRange, []string) ([]*modelyesod.FeedItemDigest, int, error)
	GroupFeedItems(context.Context, model.InternalID, []model.TimeRange, []model.InternalID,
		[]string, []string, int, []string) (
		map[model.TimeRange][]*modelyesod.FeedItemDigest, error)
	GetFeedItems(context.Context, model.InternalID, []model.InternalID) ([]*modelfeed.Item, error)
	ReadFeedItem(context.Context, model.InternalID, model.InternalID) error
	CreateFeedItemCollection(context.Context, model.InternalID, *modelyesod.FeedItemCollection) error
	UpdateFeedItemCollection(context.Context, model.InternalID, *modelyesod.FeedItemCollection) error
	ListFeedItemCollections(context.Context, model.InternalID, model.Paging, []model.InternalID,
		[]string) ([]*modelyesod.FeedItemCollection, int, error)
	AddFeedItemToCollection(context.Context, model.InternalID, model.InternalID, model.InternalID) error
	RemoveFeedItemFromCollection(context.Context, model.InternalID, model.InternalID, model.InternalID) error
	ListFeedItemsInCollection(context.Context, model.InternalID, model.Paging, []model.InternalID, []string,
		[]string, []string, *model.TimeRange) ([]*modelyesod.FeedItemDigest, int, error)
	GetFeedOwner(context.Context, model.InternalID) (*modeltiphereth.User, error)
	CreateFeedActionSet(context.Context, model.InternalID, *modelyesod.FeedActionSet) error
	UpdateFeedActionSet(context.Context, model.InternalID, *modelyesod.FeedActionSet) error
	ListFeedActionSets(context.Context, model.InternalID, model.Paging) ([]*modelyesod.FeedActionSet, int, error)
}

Jump to

Keyboard shortcuts

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