Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) GIFByID(ctx context.Context, id string) (*Giph, error)
- func (c *Client) RandomGIF(ctx context.Context, req *Request) (*Giph, error)
- func (c *Client) RandomSticker(ctx context.Context, req *Request) (*Giph, error)
- func (c *Client) Search(ctx context.Context, req *Request) (*ResponsePager, error)
- func (c *Client) SearchStickers(ctx context.Context, req *Request) (*ResponsePager, error)
- func (c *Client) SetAPIKey(key string)
- func (c *Client) SetHTTPRoundTripper(rt http.RoundTripper)
- func (c *Client) Trending(ctx context.Context, req *Request) (*ResponsePager, error)
- func (c *Client) TrendingStickers(ctx context.Context, req *Request) (*ResponsePager, error)
- type Format
- type GIF
- type Giph
- type GiphyTime
- type Language
- type Page
- type Pagination
- type Rating
- type Request
- type Response
- type ResponsePager
- type SortOrder
Constants ¶
View Source
const (
NoThrottle = int64(-1)
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
func (*Client) RandomSticker ¶
func (*Client) SearchStickers ¶
func (*Client) SetHTTPRoundTripper ¶
func (c *Client) SetHTTPRoundTripper(rt http.RoundTripper)
func (*Client) TrendingStickers ¶
type GIF ¶
type GIF struct { Type string `json:"type,omitempty"` ID string `json:"id,omitempty"` URL string `json:"url"` Width int `json:"width,string,omitempty"` Height int `json:"height,string,omitempty"` Size int64 `json:"size,string,omitempty"` MP4 string `json:"mp4,omitempty"` MP4Size int64 `json:"mp4_size,string,omitempty"` Webp string `json:"webp,omitempty"` WebpSize int64 `json:"webp_size,string,omitempty"` }
type Giph ¶
type Giph struct { Type string `json:"type,omitempty"` ID string `json:"id,omitempty"` Slug string `json:"slug,omitempty"` URL string `json:"url,omitempty"` BitlyURL string `json:"bitly_url,omitempty"` BitlyGIFURL string `json:"bitly_gif_url,omitempty"` EmbedURL string `json:"embed_url,omitempty"` Owner string `json:"username,omitempty"` Source string `json:"source,omitempty"` Rating string `json:"rating,omitempty"` Caption string `json:"caption,omitempty"` ContentURL string `json:"content_url,omitempty"` SourceTopLevelDomain string `json:"source_tld,omitempty"` SourcePostURL string `json:"source_post_url,omitempty"` ImportDate *GiphyTime `json:"import_datetime,omitempty"` TrendingDate *GiphyTime `json:"trending_datetime,omitempty"` Sizes map[string]*GIF `json:"images"` ImageOriginalURL string `json:"image_original_url,omitempty"` ImageURL string `json:"image_url,omitempty"` FrameCount uint `json:"image_frames,string,omitempty"` ImageWidth int `json:"image_width,string,omitempty"` ImageHeight int `json:"image_height,string,omitempty"` FixedHeightDownsampledURL string `json:"fixed_height_downsampled_url,omitempty"` FixedHeightDownsampledHeight int `json:"fixed_height_downsampled_height,string,omitempty"` FixedHeightDownsampledWidth int `json:"fixed_height_downsampled_width,string,omitempty"` FixedHeightSmallURL string `json:"fixed_height_small_url,omitempty"` FixedHeightSmallHeight int `json:"fixed_height_small_height,string,omitempty"` FixedHeightSmallWidth int `json:"fixed_height_small_width,string,omitempty"` FixedHeightSmallStillURL string `json:"fixed_height_small_still_url,omitempty"` FixedHeightSmallStillHeight int `json:"fixed_height_small_still_height,string,omitempty"` FixedHeightSmallStillWidth int `json:"fixed_height_small_still_width,string,omitempty"` FixedWidthDownsampledURL string `json:"fixed_width_downsampled_url,omitempty"` FixedWidthDownsampledHeight int `json:"fixed_width_downsampled_height,string,omitempty"` FixedWidthDownsampledWidth int `json:"fixed_width_downsampled_width,string,omitempty"` FixedWidthSmallURL string `json:"fixed_width_small_url,omitempty"` FixedWidthSmallHeight int `json:"fixed_width_small_height,string,omitempty"` FixedWidthSmallWidth int `json:"fixed_width_small_width,string,omitempty"` FixedWidthSmallStillURL string `json:"fixed_width_small_still_url,omitempty"` FixedWidthSmallStillHeight int `json:"fixed_width_small_still_height,string,omitempty"` FixedWidthSmallStillWidth int `json:"fixed_width_small_still_width,string,omitempty"` }
type GiphyTime ¶
GiphyTime sends time back in the format:
2015-08-22 15:23:22 and that trips out the default
JSON unmarshaling, so make a custom unmarshaling.
func (*GiphyTime) UnmarshalJSON ¶
type Language ¶
type Language string
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 Pagination ¶
type Request ¶
type Request struct { Query string `json:"query"` Rating Rating `json:"rating"` Format Format `json:"format"` MaxPageNumber uint64 `json:"max_page_number"` LimitPerPage uint64 `json:"limit_per_page"` Language Language `json:"lang"` SortBy SortOrder `json:"sort_by"` Tag string `json:"tag"` ThrottleDurationMs int64 `json:"throttle_duration_ms"` }
type Response ¶
type Response struct { Giphs []*Giph `json:"data,omitempty"` Pagination *Pagination `json:"pagination,omitempty"` Meta map[string]interface{} `json:"meta,omitempty"` }
type ResponsePager ¶
Click to show internal directories.
Click to hide internal directories.