data

package
v0.0.0-...-27e023b Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package data implements the data access for arboretum.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

func Open

func Open(path string) (*DB, error)

func (*DB) Close

func (d *DB) Close() error

func (*DB) ReadAll

func (d *DB) ReadAll(ctx context.Context) ([]Feed, error)

func (*DB) SetUpdatedAt

func (d *DB) SetUpdatedAt(ctx context.Context, uri string, updatedAt time.Time) error

func (*DB) Subscribe

func (d *DB) Subscribe(ctx context.Context, uri string) error

func (*DB) Subscriptions

func (d *DB) Subscriptions(ctx context.Context) (list []string, err error)

func (*DB) Unsubscribe

func (d *DB) Unsubscribe(ctx context.Context, uri string) error

func (*DB) UpdateFeed

func (d *DB) UpdateFeed(ctx context.Context, feed Feed) (err error)

func (*DB) UpdatedAt

func (d *DB) UpdatedAt(ctx context.Context, uri string) (time.Time, error)

type Feed

type Feed struct {
	URL        string
	WebsiteURL string
	Title      string
	UpdatedAt  time.Time
	Items      []FeedItem
}

type FeedItem

type FeedItem struct {
	Key       string
	PermaLink string
	PubDate   time.Time
	Title     string
	Link      string
}

Jump to

Keyboard shortcuts

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