feed

package
v0.0.0-...-e7beb2a Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entries

type Entries struct {
	Storage StorageInterface
}

func NewFeedStorage

func NewFeedStorage(store StorageInterface) *Entries

func (*Entries) FindAll

func (es *Entries) FindAll(ctx context.Context, limit int) (chan Entry, error)

type Entry

type Entry struct {
	ID         *int64     `json:"id"`
	Language   string     `json:"language"`
	Title      string     `json:"title"`
	Url        string     `json:"url"`
	Updated    *time.Time `json:"updated"`
	Published  *time.Time `json:"published"`
	Created    *time.Time `json:"created"`
	UpdatedAt  *time.Time `json:"updated_at"`
	Summary    string     `json:"summary"`
	Content    string     `json:"content"`
	Author     string     `json:"author"`
	Number     string     `json:"number"`
	ResourceID int        `json:"resource_id"`
	Chunk      int        `json:"chunk"`
}

func MakeEntries

func MakeEntries(items []*gofeed.Item, url link.Link) []Entry

type StorageInterface

type StorageInterface interface {
	FindByUrl(ctx context.Context, url string) (*Entry, error)
	FindAllByUrl(ctx context.Context, url string) ([]Entry, error)
	Insert(ctx context.Context, entry *Entry) (*int64, error)
	Update(ctx context.Context, entry *Entry) error
	Bulk(ctx context.Context, entries *[]Entry) error
	FindAll(ctx context.Context, limit int) (chan Entry, error)
	Delete(ctx context.Context, id *int64) error
}

Jump to

Keyboard shortcuts

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