search

package
v0.0.0-...-181bd46 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound      = errors.New("no result found")
	ErrIndexNotFound = errors.New("index not found")
	FuncMap          = template.FuncMap{}
)

Functions

This section is empty.

Types

type Config

type Config struct {
	URL string
}

func Flags

func Flags(fs *flag.FlagSet, prefix string, overrides ...flags.Override) *Config

type Service

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

func New

func New(config *Config, rendererService *renderer.Service) Service

func (Service) GetByID

func (s Service) GetByID(ctx context.Context, indexName, id string) (model.Quote, error)

func (Service) HasIndex

func (s Service) HasIndex(ctx context.Context, indexName string) bool

func (Service) Random

func (s Service) Random(ctx context.Context, indexName string) (model.Quote, error)

func (Service) Search

func (s Service) Search(ctx context.Context, indexName, query string, offset int) (model.Quote, error)

func (Service) TemplateFunc

func (s Service) TemplateFunc(w http.ResponseWriter, r *http.Request) (renderer.Page, error)

Jump to

Keyboard shortcuts

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