items

package
v0.0.0-...-9831a62 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = fmt.Errorf("not found")

	ErrAlreadyExists = fmt.Errorf("item already exists")
)

Known errors.

Functions

This section is empty.

Types

type Item

type Item struct {
	ID                string
	URL               string
	Title             string
	SubscriptionID    string
	Created           *time.Time
	Summary           *string
	SubscriptionTitle *string
	SubscriptionIcon  *string
}

Item is the item model.

type Service

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

Service allows to manage items resource.

func NewService

func NewService(db *sql.DB, logger logger) *Service

NewService returns new items service.

func (*Service) Create

func (s *Service) Create(
	ctx context.Context,
	subscriptionID string,
	url string,
	title string,
	date *time.Time,
	summary *string,
) (*Item, error)

Create creates a item from URL.

func (*Service) Get

func (s *Service) Get(ctx context.Context, userID string, id string) (*Item, error)

Get returns a item by it's id.

func (*Service) List

func (s *Service) List(ctx context.Context, userID string, pageSize int, createdLT *time.Time, subscriptionID *string, tagID *string) ([]*Item, error)

List returns a list of user items.

Jump to

Keyboard shortcuts

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