brave

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const ApiKeyID = "BRAVE_SEARCH_API_KEY"

Variables

This section is empty.

Functions

This section is empty.

Types

type FluffyThumbnail

type FluffyThumbnail struct {
	Src      string `json:"src"`
	Original string `json:"original"`
}

type Main

type Main struct {
	Type  Type   `json:"type"`
	Index *int64 `json:"index,omitempty"`
	All   bool   `json:"all"`
}

type MetaURL

type MetaURL struct {
	Scheme   string `json:"scheme"`
	Netloc   string `json:"netloc"`
	Hostname string `json:"hostname"`
	Favicon  string `json:"favicon"`
	Path     string `json:"path"`
}

type Mixed

type Mixed struct {
	Type string `json:"type"`
	Main []Main `json:"main"`
}

type Profile

type Profile struct {
	Name     string `json:"name"`
	URL      string `json:"url"`
	LongName string `json:"long_name"`
	Img      string `json:"img"`
}

type PurpleThumbnail

type PurpleThumbnail struct {
	Src      string `json:"src"`
	Original string `json:"original"`
}

type Query

type Query struct {
	Original             string `json:"original"`
	ShowStrictWarning    bool   `json:"show_strict_warning"`
	IsNavigational       bool   `json:"is_navigational"`
	IsNewsBreaking       bool   `json:"is_news_breaking"`
	SpellcheckOff        bool   `json:"spellcheck_off"`
	Country              string `json:"country"`
	BadResults           bool   `json:"bad_results"`
	ShouldFallback       bool   `json:"should_fallback"`
	PostalCode           string `json:"postal_code"`
	City                 string `json:"city"`
	HeaderCountry        string `json:"header_country"`
	MoreResultsAvailable bool   `json:"more_results_available"`
	State                string `json:"state"`
}

type Results

type Results struct {
	Query  Query       `json:"query"`
	Mixed  Mixed       `json:"mixed"`
	Type   string      `json:"type"`
	Videos VideosClass `json:"videos"`
	Web    WebClass    `json:"web"`
}

func (Results) Text

func (r Results) Text(w io.Writer) error

type Service added in v0.0.5

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

func NewService added in v0.0.5

func NewService(sc service.Context) *Service

func (*Service) Search added in v0.0.5

func (s *Service) Search(ctx context.Context, req search.Request) (search.Results, error)

type Type

type Type string
const (
	Videos Type = "videos"
	Web    Type = "web"
)

type Video

type Video struct {
}

type VideosClass

type VideosClass struct {
	Type             Type           `json:"type"`
	Results          []VideosResult `json:"results"`
	MutatedByGoggles bool           `json:"mutated_by_goggles"`
}

type VideosResult

type VideosResult struct {
	Type        string          `json:"type"`
	URL         string          `json:"url"`
	Title       string          `json:"title"`
	Description string          `json:"description"`
	Age         string          `json:"age,omitempty"`
	Video       Video           `json:"video"`
	MetaURL     MetaURL         `json:"meta_url"`
	Thumbnail   PurpleThumbnail `json:"thumbnail"`
}

type WebClass

type WebClass struct {
	Type           string      `json:"type"`
	Results        []WebResult `json:"results"`
	FamilyFriendly bool        `json:"family_friendly"`
}

type WebResult

type WebResult struct {
	Title          string          `json:"title"`
	URL            string          `json:"url"`
	IsSourceLocal  bool            `json:"is_source_local"`
	IsSourceBoth   bool            `json:"is_source_both"`
	Description    string          `json:"description"`
	Profile        Profile         `json:"profile"`
	Language       string          `json:"language"`
	FamilyFriendly bool            `json:"family_friendly"`
	Type           string          `json:"type"`
	Subtype        string          `json:"subtype"`
	MetaURL        MetaURL         `json:"meta_url"`
	Thumbnail      FluffyThumbnail `json:"thumbnail"`
	Age            string          `json:"age"`
	ExtraSnippets  []string        `json:"extra_snippets"`
}

Jump to

Keyboard shortcuts

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