Version: v0.0.0-...-bf3116b Latest Latest

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

Go to latest
Published: Apr 4, 2018 License: Apache-2.0 Imports: 11 Imported by: 0




View Source
const NoThrottle = -1


This section is empty.


This section is empty.


type Client

type Client struct {
	// contains filtered or unexported fields

func (*Client) Search

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

func (*Client) SetHTTPRoundTripper

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

type Gfy

type Gfy struct {
	GfyID      string   `json:"gfyid,omitempty"`
	GfyName    string   `json:"gfyName"`
	GfyNumber  int64    `json:"gfyNumber,string"`
	URL        string   `json:"url"`
	Width      int      `json:"width,omitempty"`
	Height     int      `json:"height,omitempty"`
	FrameRate  float32  `json:"frameRate,omitempty"`
	FrameCount int      `json:"numFrames,omitempty"`
	MP4Size    int64    `json:"mp4Size,omitempty"`
	WebmSize   int64    `json:"webmSize,omitempty"`
	GIFSize    int64    `json:"gifSize,omitempty"`
	MD5Sum     string   `json:"md5,omitempty"`
	Tags       []string `json:"tags,omitempty"`
	Owner      string   `json:"username,omitempty"`
	Title      string   `json:"title,omitempty"`

	Published otils.NumericBool `json:"published,omitempty"`

	ViewCount       int64    `json:"views,omitempty"`
	AverageColor    string   `json:"avgColor,omitempty"`
	CreateDateEpoch int64    `json:"createDate,omitempty"`
	Description     string   `json:"description,omitempty"`
	DomainWhitelist []string `json:"domainWhitelist,omitempty"`

	MP4URL            string `json:"mp4Url"`
	WebmURL           string `json:"webmUrl"`
	MobileURL         string `json:"mobileUrl"`
	MobilePosterURL   string `json:"mobilePosterUrl"`
	MiniURL           string `json:"miniUrl"`
	MiniPosterURL     string `json:"miniPosterUrl"`
	PosterURL         string `json:"posterUrl"`
	Thumb360URL       string `json:"thumb360Url"`
	Thumb360PosterURL string `json:"thumb360PosterUrl"`
	Thumb100PosterURL string `json:"thumb100PosterUrl"`

	Max5MBGIFURL string `json:"max5mbGif"`
	Max2MBGIFURL string `json:"max2mbGif"`
	Max1MBGIFURL string `json:"max1mbGif"`
	GIF100PxURL  string `json:"gif100px"`
	MJPGURL      string `json:"mjpUrl"`
	WebpURL      string `json:"webpUrl"`

	NSFW otils.NumericBool `json:"nsfw"`

type Page

type Page struct {
	Err  error  `json:"error"`
	Gfys []*Gfy `json:"gfys"`

	PageNumber uint64 `json:"page_number"`

type Request

type Request struct {
	Query         string `json:"query"`
	LimitPerPage  int    `json:"limit_per_page"`
	MaxPageNumber uint64 `json:"max_page_number"`

	ThrottleDurationMs int `json:"throttle_duration_ms"`

	// InTest if set, signifies that the app shouldn't
	// use the production endpoint and should instead use the test
	// endpoint. Useful for running tests and before one is authenticated.
	InTest bool `json:"in_test"`

type SearchResponse

type SearchResponse struct {
	Pages  <-chan *Page
	Cancel func() error

Source Files

Jump to

Keyboard shortcuts

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