search

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Match added in v0.1.9

type Match struct {
	Key   string `json:"k"`
	Value string `json:"v"`
}

func (*Match) ValueSplit added in v0.1.9

func (m *Match) ValueSplit(q string) []string

type Matches added in v0.1.9

type Matches []*Match

func MatchesFrom added in v0.1.9

func MatchesFrom(a []string) Matches

type Params

type Params struct {
	Q string `json:"q"`
}

func (*Params) String

func (r *Params) String() string

type Provider

type Provider func(context.Context, *app.State, *Params) (Results, error)

type Result

type Result struct {
	ID      string      `json:"id,omitempty"`
	Type    string      `json:"type,omitempty"`
	Title   string      `json:"title,omitempty"`
	Icon    string      `json:"icon,omitempty"`
	URL     string      `json:"url,omitempty"`
	Matches []*Match    `json:"matches,omitempty"`
	Data    interface{} `json:"data,omitempty"`
	HTML    string      `json:"-"`
}

type Results

type Results []*Result
func Search(ctx context.Context, as *app.State, params *Params) (Results, []error)

func (Results) Sort

func (rs Results) Sort()

Jump to

Keyboard shortcuts

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