imgur

package module
v0.0.0-...-898b0ca Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2015 License: Apache-2.0 Imports: 6 Imported by: 0

README

imgur

Go client library for the Imgur API

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(clientId string) *Client

func (*Client) Random

func (c *Client) Random(opt SearchOptions) (*Image, error)

func (*Client) Search

func (c *Client) Search(opt SearchOptions) (*SearchResponse, *http.Response, error)

type Image

type Image struct {
	Id          string `json:"id"`
	Title       string `json:"title"`
	Description string `json:"description"`
	DateTime    int    `json:"datetime"`
	Type        string `json:"type"`
	Animated    bool   `json:"animated"`
	Nsfw        bool   `json:"nsfw"`
	Link        string `json:"link"`
}

type Response

type Response struct {
	Success bool `json:"success"`
	Status  int  `json:"status"`
}

type SearchOptions

type SearchOptions struct {
	Query   string `url:"q"`
	All     string `url:"q_all"`
	Any     string `url:"q_any"`
	Exactly string `url:"q_exactly"`
	Not     string `url:"q_not"`
	Type    string `url:"q_type"`
	SizePx  string `url:"q_size_px"`
}

SearchOptions specifies the parameters to the Search method.

type SearchResponse

type SearchResponse struct {
	Response
	Data []Image `json:"data"`
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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