services

package
v0.0.0-...-7f65031 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2021 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

This section is empty.

Types

type Adjacent

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

func (Adjacent) ID

func (c Adjacent) ID() uint

func (Adjacent) Slug

func (c Adjacent) Slug() string

func (Adjacent) Title

func (c Adjacent) Title() template.HTML

type Content

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

func NewContent

func NewContent(wpc wpcontent) (Content, error)

func NewContentFake

func NewContentFake(title, desc string) (c Content)

func (Content) Desc

func (c Content) Desc() template.HTML

func (Content) HasNext

func (c Content) HasNext() bool

func (Content) HasPrev

func (c Content) HasPrev() bool

func (Content) HasTags

func (c Content) HasTags() bool

func (Content) IsCat

func (c Content) IsCat(id uint) bool

func (Content) Mod

func (c Content) Mod() string

func (Content) Next

func (c Content) Next() Adjacent

func (Content) Prev

func (c Content) Prev() Adjacent

func (Content) Pub

func (c Content) Pub() string

func (Content) Short

func (c Content) Short() template.HTML

func (Content) Slug

func (c Content) Slug() string

func (Content) Tags

func (c Content) Tags() (tags []Content)

func (Content) Title

func (c Content) Title() template.HTML

type DataService

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

func NewDataService

func NewDataService(origin string, cache *GetCache) DataService

func (DataService) Get

func (ds DataService) Get(c context.Context, catids []uint, slug string) (Content, error)

func (DataService) ListByCat

func (ds DataService) ListByCat(c context.Context, catid uint) ([]Content, error)

func (DataService) ListByTaxaSlug

func (ds DataService) ListByTaxaSlug(c context.Context, catids []uint, taxans, slug string) (Content, []Content, error)

func (DataService) Search

func (ds DataService) Search(c context.Context, catids []uint, search string) (ret []Content, err error)

type GetCache

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

func NewGetCache

func NewGetCache() *GetCache

func (*GetCache) Get

func (c *GetCache) Get(ctx context.Context, wpurl string, data interface{}) error

type Prefetch

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

func NewPrefetch

func NewPrefetch(data DataService) Prefetch

func (Prefetch) Load

func (p Prefetch) Load(ctx context.Context, cats []uint) error

Jump to

Keyboard shortcuts

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