Documentation
¶
Index ¶
- Variables
- type Config
- type Service
- func (s *Service) Create(ctx context.Context, userID string, url *url.URL, tagIDs []string) (*Subscription, error)
- func (s *Service) Get(ctx context.Context, id string, userID string) (*Subscription, error)
- func (s *Service) List(ctx context.Context, userID string, pageSize int, createdLT *time.Time) ([]*Subscription, error)
- func (s *Service) Shutdown(ctx context.Context) error
- func (s *Service) Start(ctx context.Context) error
- type Subscription
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAlreadyExists = fmt.Errorf("subscription already exists") ErrFailedToDownloadSubscription = fmt.Errorf("failed to download subscription") ErrFailedToParseSubscription = fmt.Errorf("failed to parse subscription") )
Known errors.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Update *updateConfig `yaml:"update"`
}
Config is a subscriptions service configuration.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service allows to manage subscriptions resource.
func NewService ¶
func NewService(db *sql.DB, crawler crawler, logger logger, cfg *Config, itemsService itemsService) *Service
NewService returns new subscriptions service.
func (*Service) Create ¶
func (s *Service) Create(ctx context.Context, userID string, url *url.URL, tagIDs []string) (*Subscription, error)
Create creates a subscription from URL.
func (*Service) List ¶
func (s *Service) List(ctx context.Context, userID string, pageSize int, createdLT *time.Time) ([]*Subscription, error)
List returns a list of user subscriptions.
type Subscription ¶
type Subscription struct { ID string `json:"id"` URL string `json:"url"` Title string `json:"title"` Created time.Time `json:"created"` Updated *time.Time `json:"updated,omitempty"` IconURL *string `json:"icon_url,omitempty"` TagIDs stringsArray `json:"tag_ids"` }
Subscription is the subscription model.
Click to show internal directories.
Click to hide internal directories.