pagecache

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyStubsInStubs

func AnyStubsInStubs(src, tgt Stubs) (found bool)

func RegisterSearchPageType

func RegisterSearchPageType(pgtype string)

func SearchDocument

func SearchDocument(p *page.Page) (doc search.Document, err error)

func SearchMapping

func SearchMapping(p *page.Page) (doctype string, dm *mapping.DocumentMapping, err error)

Types

type CacheEnjinFeature

type CacheEnjinFeature interface {
	NewCache(bucket string) (err error)
	Mounted(bucket, path string) (ok bool)
	Mount(bucket, mount, path string, mfs fs.FileSystem)
	Rebuild(bucket string) (ok bool)
	Lookup(bucket string, tag language.Tag, url string) (mount, path string, p *page.Page, err error)
	LookupTranslations(bucket, url string) (pgs []*page.Page)
	LookupRedirect(bucket, url string) (p *page.Page, ok bool)
	LookupPrefix(bucket, prefix string) (found []*page.Page)
	TotalCached(bucket string) (count uint64)
}

type KeywordProvider

type KeywordProvider interface {
	KnownKeywords() (keywords []string)
	KeywordStubs(keyword string) (stubs Stubs)
}

type PageContextProvider

type PageContextProvider interface {
	GetPageContextValueStubs(key string) (valueStubs map[interface{}]Stubs, err error)
}

type PageIndexFeature

type PageIndexFeature interface {
	AddToIndex(stub *Stub, p *page.Page) (err error)
	RemoveFromIndex(tag language.Tag, file, shasum string)
}

type QueryEnjinFeature

type QueryEnjinFeature interface {
	PageIndexFeature
	PerformQuery(input string) (stubs []*Stub, err error)
	PerformSelect(input string) (selected map[string]interface{}, err error)
}

type SearchDocumentMapperFeature

type SearchDocumentMapperFeature interface {
	SearchDocumentMapping(tag language.Tag) (doctype string, dm *mapping.DocumentMapping)
	AddSearchDocumentMapping(tag language.Tag, indexMapping *mapping.IndexMappingImpl)
}

type SearchEnjinFeature

type SearchEnjinFeature interface {
	PrepareSearch(tag language.Tag, input string) (query string)
	PerformSearch(tag language.Tag, input string, size, pg int) (results *bleve.SearchResult, err error)
	AddToSearchIndex(stub *Stub, p *page.Page) (err error)
	RemoveFromSearchIndex(tag language.Tag, file, shasum string)
}

type Stub

type Stub struct {
	Bfs      beFs.FileSystem
	Point    string
	Shasum   string
	Source   string
	Language language.Tag
	Fallback language.Tag
	EnjinCtx context.Context
}

func NewStub

func NewStub(enjin context.Context, bfs beFs.FileSystem, point, source, shasum string, fallback language.Tag) (s *Stub, p *page.Page, err error)

func (*Stub) Make

func (s *Stub) Make(formats types.FormatProvider) (p *page.Page, err error)

type Stubs

type Stubs []*Stub

func (Stubs) GetShasum

func (s Stubs) GetShasum(shasum string) (found *Stub)

func (Stubs) GetSource

func (s Stubs) GetSource(source string) (found *Stub)

func (Stubs) HasShasum

func (s Stubs) HasShasum(shasum string) (found bool)

func (Stubs) Random

func (s Stubs) Random() (stub *Stub)

Jump to

Keyboard shortcuts

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