core

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSubscriptionExist    = errors.New("already subscribed")
	ErrSubscriptionNotExist = errors.New("subscription not exist")
	ErrSourceNotExist       = errors.New("source not exist")
)

Functions

This section is empty.

Types

type Core

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

func NewCore

func NewCore(
	userStorage storage.User, contentStorage storage.Content, sourceStorage storage.Source,
	subscriptionStorage storage.Subscription,
) *Core

func NewCoreFormConfig

func NewCoreFormConfig() *Core

func (*Core) AddSubscription

func (c *Core) AddSubscription(ctx context.Context, userID int64, sourceID uint) error

AddSubscription 添加订阅

func (*Core) ClearSourceErrorCount

func (c *Core) ClearSourceErrorCount(ctx context.Context, sourceID uint) error

ClearSourceErrorCount 清空订阅源错误计数

func (*Core) DisableSourceUpdate

func (c *Core) DisableSourceUpdate(ctx context.Context, sourceID uint) error

DisableSourceUpdate 关闭订阅源更新

func (*Core) EnableSourceUpdate

func (c *Core) EnableSourceUpdate(ctx context.Context, sourceID uint) error

EnableSourceUpdate 开启订阅源更新

func (*Core) GetSource

func (c *Core) GetSource(ctx context.Context, id uint) (*model.Source, error)

GetSource 获取用户订阅的订阅源

func (*Core) GetSourceByURL

func (c *Core) GetSourceByURL(ctx context.Context, sourceURL string) (*model.Source, error)

GetSourceByURL 获取用户订阅的订阅源

func (*Core) GetSubscription

func (c *Core) GetSubscription(ctx context.Context, userID int64, sourceID uint) (*model.Subscribe, error)

GetSubscription 获取订阅

func (*Core) GetUserSubscribedSources

func (c *Core) GetUserSubscribedSources(ctx context.Context, userID int64) ([]*model.Source, error)

GetUserSubscribedSources 获取用户订阅的订阅源

func (*Core) Init

func (c *Core) Init() error

func (*Core) SetSubscriptionInterval

func (c *Core) SetSubscriptionInterval(ctx context.Context, userID int64, sourceID uint, interval int) error

SetSubscriptionInterval

func (*Core) SetSubscriptionTag

func (c *Core) SetSubscriptionTag(ctx context.Context, userID int64, sourceID uint, tags []string) error

SetSubscriptionTag 设置订阅标签

func (*Core) ToggleSourceUpdateStatus

func (c *Core) ToggleSourceUpdateStatus(ctx context.Context, sourceID uint) error

func (*Core) ToggleSubscriptionNotice

func (c *Core) ToggleSubscriptionNotice(ctx context.Context, userID int64, sourceID uint) error

func (*Core) ToggleSubscriptionTelegraph

func (c *Core) ToggleSubscriptionTelegraph(ctx context.Context, userID int64, sourceID uint) error

func (*Core) Unsubscribe

func (c *Core) Unsubscribe(ctx context.Context, userID int64, sourceID uint) error

Unsubscribe 添加订阅

func (*Core) UnsubscribeAllSource

func (c *Core) UnsubscribeAllSource(ctx context.Context, userID int64) error

UnsubscribeAllSource 添加订阅

Jump to

Keyboard shortcuts

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