storage

package
v0.0.0-...-b17c1e0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Article

type Article struct {
	Title       string    `json:"title,omitempty"`
	Link        string    `json:"link,omitempty"`
	Description string    `json:"description,omitempty"`
	Published   time.Time `json:"published,omitempty"`
	GUID        string    `json:"guid,omitempty"`
	Thumbnail   string    `json:"thumbnail,omitempty"`
	Categories  []string  `json:"categories,omitempty"`
	Provider    string    `json:"provider,omitempty"`
}

Article defines a news article

type ArticleRepository

type ArticleRepository interface {
	InsertArticles(ctx context.Context, p []Article) ([]string, error)
	GetArticles(ctx context.Context, offset, count int, category, provider []string) ([]Article, error)
}

ArticleRepository defines functionality to CRUD articles in underlying store

type ErrNotFound

type ErrNotFound struct {
	Message string
}

ErrNotFound is returned when an item requested is not found

func (ErrNotFound) Error

func (e ErrNotFound) Error() string

type Provider

type Provider struct {
	Type                 string `json:"type,omitempty"`
	Label                string `json:"label,omitempty"`
	FeedURL              string `json:"feedURL,omitempty"`
	PollFrequencySeconds int    `json:"pollFrequencySeconds,omitempty"`
}

Provider represents a provider

type ProviderRepository

type ProviderRepository interface {
	InsertProviders(ctx context.Context, p []Provider) ([]string, error)
	GetProviders(ctx context.Context, offset, count int) ([]Provider, error)
	GetProvider(ctx context.Context, providerID string) (Provider, error)
}

ProviderRepository defines functionality to CRUD providers in underlying store

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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