Documentation ¶
Index ¶
- type ArticleRepository
- type ProviderRepository
- func (pr *ProviderRepository) GetProvider(ctx context.Context, providerID string) (storage.Provider, error)
- func (pr *ProviderRepository) GetProviders(ctx context.Context, offset, count int) ([]storage.Provider, error)
- func (pr *ProviderRepository) InsertProviders(ctx context.Context, providers []storage.Provider) ([]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArticleRepository ¶
type ArticleRepository struct {
// contains filtered or unexported fields
}
ArticleRepository is an implementation to create/retrieve articles from MongoBD store
func NewArticleRepository ¶
func NewArticleRepository(connection, user, password, dbName string) (*ArticleRepository, error)
NewArticleRepository ..
func (*ArticleRepository) GetArticles ¶
func (pr *ArticleRepository) GetArticles(ctx context.Context, offset, count int, categories, providers []string) ([]storage.Article, error)
GetArticles returns a collection of article
func (*ArticleRepository) InsertArticles ¶
func (pr *ArticleRepository) InsertArticles(ctx context.Context, articles []storage.Article) ([]string, error)
InsertArticles inserts a collection of articles into the article collection
type ProviderRepository ¶
type ProviderRepository struct {
// contains filtered or unexported fields
}
ProviderRepository is an implementation to create/retrieve providers from MongoBD store
func NewProviderRepository ¶
func NewProviderRepository(connection, user, password, dbName string) (*ProviderRepository, error)
NewProviderRepository ..
func (*ProviderRepository) GetProvider ¶
func (pr *ProviderRepository) GetProvider(ctx context.Context, providerID string) (storage.Provider, error)
GetProvider returns the provider related to the specified `providerID`. Use `IsNotFound()` to determine if item was not found.
func (*ProviderRepository) GetProviders ¶
func (pr *ProviderRepository) GetProviders(ctx context.Context, offset, count int) ([]storage.Provider, error)
GetProviders returns a collection of providers
func (*ProviderRepository) InsertProviders ¶
func (pr *ProviderRepository) InsertProviders(ctx context.Context, providers []storage.Provider) ([]string, error)
InsertProviders inserts a provider into the provider collection
Click to show internal directories.
Click to hide internal directories.