services

package
v0.0.0-...-2319eaa Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2022 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigKey

type ConfigKey = string
const (
	FeedlyToken          ConfigKey = "feedly_token"
	FeedlyTokenExpiresAt ConfigKey = "feedly_token_expires_at"
)

#nosec G101 -- Not hardcoded credentials, just managed keys

type ConfigService

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

func NewConfigService

func NewConfigService(db *gorm.DB) *ConfigService

func (*ConfigService) Get

func (s *ConfigService) Get(key ConfigKey) (sql.NullString, error)

func (*ConfigService) InitSetup

func (s *ConfigService) InitSetup() error

Add db entry if needed for each of the config keys

func (*ConfigService) Set

func (s *ConfigService) Set(key ConfigKey, value *string) error

type ContentService

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

func NewContentService

func NewContentService(db *gorm.DB) *ContentService

func (*ContentService) AddMany

func (s *ContentService) AddMany(contents []*model.Content, sources []*model.Source) error

func (*ContentService) Find

func (s *ContentService) Find(sourceTypes []string, sources []int, page int) (*database.Pagination, error)

func (*ContentService) FindOneByContentID

func (s *ContentService) FindOneByContentID(contentID string) (model.Content, error)

func (*ContentService) Get

func (s *ContentService) Get(id string) (model.Content, error)

type LangService

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

func NewLangService

func NewLangService(db *gorm.DB) *LangService

func (*LangService) Create

func (s *LangService) Create(lang *model.Lang) error

func (*LangService) Delete

func (s *LangService) Delete(lang *model.Lang) error

func (*LangService) FindAll

func (s *LangService) FindAll() ([]model.Lang, error)

func (*LangService) Get

func (s *LangService) Get(isoCode string) (model.Lang, error)

func (*LangService) Update

func (s *LangService) Update(lang *model.Lang) error

type RefreshErrors

type RefreshErrors struct {
	Message string           `json:"message,omitempty"`
	Error   error            `json:"error,omitempty"`
	Errors  map[string]error `json:"errors,omitempty"`
}

type RefreshService

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

func NewRefreshService

func NewRefreshService(db *gorm.DB, fetcher *fetchers.Fetcher, feedlyCategoryID string) *RefreshService

func (*RefreshService) RefreshBySource

func (rs *RefreshService) RefreshBySource(source model.Source) ([]*model.Content, *RefreshErrors)

func (*RefreshService) RefreshByTypes

func (rs *RefreshService) RefreshByTypes(types []string) ([]*model.Content, error)

func (*RefreshService) RefreshFeedlySource

func (rs *RefreshService) RefreshFeedlySource() ([]*model.Source, error)

type SourceService

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

func NewSourceService

func NewSourceService(db *gorm.DB) *SourceService

func (*SourceService) AddMany

func (s *SourceService) AddMany(sources []*model.Source) error

func (*SourceService) AddManyIfNotExist

func (s *SourceService) AddManyIfNotExist(data []fetchers.ChannelFetchData, sourceType string, nextOrder int) ([]*model.Source, error)

func (*SourceService) Create

func (s *SourceService) Create(source *model.Source) error

func (*SourceService) Delete

func (s *SourceService) Delete(source *model.Source) error

func (*SourceService) FindAll

func (s *SourceService) FindAll(types []string) ([]*model.Source, error)

func (*SourceService) Get

func (s *SourceService) Get(id string) (model.Source, error)

func (*SourceService) GetBySourceID

func (s *SourceService) GetBySourceID(sourceID string) (model.Source, error)

func (*SourceService) GetNextOrder

func (s *SourceService) GetNextOrder() (int, error)

func (*SourceService) Update

func (s *SourceService) Update(source *model.Source) error

func (*SourceService) UpdateOrder

func (s *SourceService) UpdateOrder(updates map[int]map[string]interface{}) ([]model.Source, error)

Jump to

Keyboard shortcuts

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