guggy

package
v0.0.0-...-94552c1 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewClient

func NewClient(apiKey string) (*Client, error)

func NewClientFromEnv

func NewClientFromEnv() (*Client, error)

func (*Client) Search

func (c *Client) Search(ctx context.Context, req *Request) (*Response, error)

func (*Client) SetAPIKey

func (c *Client) SetAPIKey(apiKey string)

func (*Client) SetHTTPRoundTripper

func (c *Client) SetHTTPRoundTripper(rt http.RoundTripper)

type Collection

type Collection struct {
	GIF  *Size `json:"gif,omitempty"`
	MP4  *Size `json:"mp4,omitempty"`
	PNG  *Size `json:"png,omitempty"`
	WEBP *Size `json:"webp,omitempty"`

	Original *Size `json:"original"`

	Thumbnail *Size `json:"thumbnail"`
}

type Dimensions

type Dimensions struct {
	Width  int `json:"width"`
	Height int `json:"height"`
}

type Image

type Image struct {
	URL string `json:"secureUrl,omitempty"`

	Dimensions *Dimensions `json:"dimensions,omitempty"`
}

type Language

type Language string

Languages

const (
	LangSpanish            Language = "es"
	LangPortuguese         Language = "pt"
	LangIndonesian         Language = "id"
	LangFrench             Language = "fr"
	LangArabic             Language = "ar"
	LangTurkish            Language = "tr"
	LangThai               Language = "th"
	LangVietnamese         Language = "vi"
	LangGerman             Language = "de"
	LangItalian            Language = "it"
	LangJapanese           Language = "ja"
	LangChineseSimplified  Language = "zh-CN"
	LangChineseTraditional Language = "zh-TW"
	LangRussian            Language = "ru"
	LangKorean             Language = "ko"
	LangPolish             Language = "pl"
	LangDutch              Language = "nl"
	LangRomanian           Language = "ro"
	LangHungarian          Language = "hu"
	LangSwedish            Language = "sv"
	LangCzech              Language = "cs"
	LangHindi              Language = "hi"
	LangBengali            Language = "bn"
	LangDanish             Language = "da"
	LangFarsi              Language = "fa"
	LangFilipino           Language = "tl"
	LangFinnish            Language = "fi"
	LangHebrew             Language = "iw"
	LangMalay              Language = "ms"
	LangNorwegian          Language = "no"
	LangUkrainian          Language = "uk"
)

type Request

type Request struct {
	Query string `json:"query"`

	Language Language `json:"lang"`
}

type Response

type Response struct {
	RequestID string        `json:"reqId"`
	Stickers  []*Collection `json:"stickers"`
	Gifs      []*Collection `json:"animated"`
}

type Size

type Size struct {
	Original *Image `json:"original"`
	Preview  *Image `json:"preview"`

	LowQuality *Image `json:"lowQuality"`

	HighResolution *Image `json:"hires"`
}

Jump to

Keyboard shortcuts

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