repo

package
v0.0.0-...-3cbc7d6 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2016 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BleveCache

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

func (*BleveCache) Add

func (cache *BleveCache) Add(link *RecipeLink) error

func (*BleveCache) Cached

func (cache *BleveCache) Cached(link *RecipeLink) bool

func (*BleveCache) Close

func (cache *BleveCache) Close() error

func (*BleveCache) Search

func (cache *BleveCache) Search(ctx context.Context, term string, options SearchOptions) ([]*RecipeLink, error)

type JsonFileCache

type JsonFileCache struct {
	Entries map[string]*RecipeLink `json:"entries"`
	// contains filtered or unexported fields
}

func (*JsonFileCache) Add

func (cache *JsonFileCache) Add(entry *RecipeLink) error

func (*JsonFileCache) Cached

func (cache *JsonFileCache) Cached(entry *RecipeLink) bool

func (*JsonFileCache) Close

func (cache *JsonFileCache) Close() error

func (*JsonFileCache) Search

func (cache *JsonFileCache) Search(ctx context.Context, term string, options SearchOptions) ([]*RecipeLink, error)

type LocalCache

type LocalCache interface {
	Search(context.Context, string, SearchOptions) ([]*RecipeLink, error)
	Add(*RecipeLink) error
	Close() error
	Cached(*RecipeLink) bool
}

func OpenBleveCache

func OpenBleveCache(dbPath string) (LocalCache, error)

func OpenJsonFileCache

func OpenJsonFileCache(name string) (LocalCache, error)
type RecipeLink struct {
	Title       string `json:"title"`
	Description string `json:"description"`
	URL         string `json:"url"`
}

type Repository

type Repository interface {
	Refresh(context.Context) error
	Get(context.Context, string) ([]*schema.Recipe, error)
	Search(context.Context, string, SearchOptions) ([]*RecipeLink, error)
}

type SearchMode

type SearchMode byte
const (
	Contains SearchMode = iota
	BeginsWith
	ExactMatch
	WildCards
	RegularExpression
)

type SearchOptions

type SearchOptions struct {
	Title       bool
	Description bool
	URL         bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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