garden

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: 13 Imported by: 0

Documentation

Overview

Package garden aggregates feeds.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB interface {
	ReadAll(context.Context) ([]data.Feed, error)
	UpdateFeed(context.Context, data.Feed) error
	UpdatedAt(context.Context, string) (time.Time, error)
	SetUpdatedAt(context.Context, string, time.Time) error
}

type ExecuteTemplate

type ExecuteTemplate interface {
	ExecuteTemplate(io.Writer, string, interface{}) error
}

type Feed

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

func NewFeed

func NewFeed(ctx context.Context, db DB, refresh time.Duration, uri string) (*Feed, error)

func (*Feed) Run

func (f *Feed) Run()

type Garden

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

func New

func New(store DB, refresh time.Duration) *Garden

func (*Garden) Handler

func (garden *Garden) Handler(templates ExecuteTemplate, signedIn bool) http.HandlerFunc

func (*Garden) Latest

func (g *Garden) Latest(ctx context.Context) (gardenjs.Garden, error)

func (*Garden) Run

func (g *Garden) Run(ctx context.Context)

func (*Garden) Subscribe

func (g *Garden) Subscribe(ctx context.Context, uri string) error

func (*Garden) Unsubscribe

func (g *Garden) Unsubscribe(ctx context.Context, uri string) error

Jump to

Keyboard shortcuts

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