imgur

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2021 License: BSD-3-Clause Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	HTTPClient *http.Client
	Imgur      Imgur
}

func (*Client) DeleteImageAuthed

func (client *Client) DeleteImageAuthed(id string) (*ImageInfoWithoutData, int, error)

func (*Client) DeleteImageUnAuthed

func (client *Client) DeleteImageUnAuthed(hash string) (*ImageInfoWithoutData, int, error)

func (*Client) UploadImage

func (client *Client) UploadImage(img string, dtype string, album string) (*ImageInfoData, int, error)

func (*Client) UploadImageFromFile

func (client *Client) UploadImageFromFile(path string, album string) (*ImageInfoData, int, error)

func (*Client) UploadImageFromURL

func (client *Client) UploadImageFromURL(imgUrl string, album string) (*ImageInfoData, int, error)

type ImageInfo

type ImageInfo struct {
	ID          string `json:"id"`
	IDExt       string
	Title       string `json:"title"`
	Description string `json:"description"`
	Datetime    int    `json:"datetime"`
	MimeType    string `json:"type"`
	Animated    bool   `json:"animated"`
	Width       int    `json:"width"`
	Height      int    `json:"height"`
	Size        int    `json:"size"`
	Views       int    `json:"views"`
	Bandwidth   int    `json:"bandwidth"`
	Deletehash  string `json:"deletehash,omitempty"`
	Name        string `json:"name,omitempty"`
	Section     string `json:"section"`
	Link        string `json:"link"`
	Gifv        string `json:"gifv,omitempty"`
	Mp4         string `json:"mp4,omitempty"`
	Mp4Size     int    `json:"mp4_size,omitempty"`
	Looping     bool   `json:"looping,omitempty"`
	Favorite    bool   `json:"favorite"`
	Nsfw        bool   `json:"nsfw"`
	Vote        string `json:"vote"`
	InGallery   bool   `json:"in_gallery"`
}

type ImageInfoData

type ImageInfoData struct {
	Data    *ImageInfo `json:"data"`
	Success bool       `json:"success"`
	Status  int        `json:"status"`
}

type ImageInfoWithoutData

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

type Imgur

type Imgur struct {
	ClientID    string
	AccessToken string
}

Jump to

Keyboard shortcuts

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