search

package
v0.0.0-...-9336e07 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Empty

type Empty struct {
	base.Empty
}

func (Empty) Result

func (Empty) Result() Result

func (Empty) Token

func (Empty) Token() Token

type EntityResult

type EntityResult struct {
	LinkResult
	Type     string
	Category string
	Image    *Image
}

func (*EntityResult) GetThumbnail

func (r *EntityResult) GetThumbnail() *Image

type Image

type Image struct {
	URL    url.URL
	Width  int
	Height int
}

func (*Image) GetURL

func (r *Image) GetURL() *url.URL

type ImageResult

type ImageResult struct {
	Image
	Title     string
	Desc      string
	PageURL   *url.URL
	Thumbnail *Image
}

func (*ImageResult) GetDesc

func (r *ImageResult) GetDesc() string

func (*ImageResult) GetThumbnail

func (r *ImageResult) GetThumbnail() *Image

func (*ImageResult) GetTitle

func (r *ImageResult) GetTitle() string

type LangCode

type LangCode = language.Tag

func MustParseLangCode

func MustParseLangCode(s string) LangCode

func ParseLangCode

func ParseLangCode(s string) (LangCode, error)

type Language

type Language struct {
	Code LangCode
	Name string
}

type LinkResult

type LinkResult struct {
	URL   url.URL
	Title string
	Desc  string
}

func (*LinkResult) GetDesc

func (r *LinkResult) GetDesc() string

func (*LinkResult) GetTitle

func (r *LinkResult) GetTitle() string

func (*LinkResult) GetURL

func (r *LinkResult) GetURL() *url.URL

type Region

type Region struct {
	Code RegionCode
	Name string
}

type RegionCode

type RegionCode = language.Region

func MustParseRegionCode

func MustParseRegionCode(s string) RegionCode

func ParseRegionCode

func ParseRegionCode(s string) (RegionCode, error)

type Request

type Request struct {
	Query  string
	Lang   LangCode
	Region RegionCode
	Safe   bool
}

type Result

type Result interface {
	GetURL() *url.URL
	GetTitle() string
	GetDesc() string
}

type ResultIterator

type ResultIterator interface {
	base.PagedIterator
	Result() Result
	Token() Token
}

type Searcher

type Searcher interface {
	Search(ctx context.Context, req Request) ResultIterator
	ContinueSearch(ctx context.Context, tok Token) ResultIterator
}

type Service

type Service interface {
	base.Provider
	Languages(ctx context.Context) ([]Language, error)
	Regions(ctx context.Context) ([]Region, error)

	Searcher
}

type ThumbnailResult

type ThumbnailResult interface {
	Result
	GetThumbnail() *Image
}

type Token

type Token []byte

type VideoResult

type VideoResult struct {
	LinkResult
	Thumbnail *Image
}

func (*VideoResult) GetThumbnail

func (r *VideoResult) GetThumbnail() *Image

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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