Documentation ¶
Index ¶
- type AccessTokenResponse
- type Client
- func (client *Client) DeleteImageAuthed(id string) (*ImageInfoWithoutData, int, error)
- func (client *Client) DeleteImageUnAuthed(hash string) (*ImageInfoWithoutData, int, error)
- func (client *Client) GenerateAccessToken(refreshToken string) (*AccessTokenResponse, error)
- func (client *Client) GetImageInfo(imageID string) (*ImageInfoData, int, error)
- func (client *Client) RateLimits() (*RateLimitsStruct, int, error)
- func (client *Client) UploadImage(img string, dtype string, album string) (*ImageInfoData, int, error)
- func (client *Client) UploadImageFromFile(path string, album string) (*ImageInfoData, int, error)
- func (client *Client) UploadImageFromURL(imgUrl string, album string) (*ImageInfoData, int, error)
- type ImageInfo
- type ImageInfoData
- type ImageInfoWithoutData
- type Imgur
- type RateLimitsData
- type RateLimitsStruct
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessTokenResponse ¶ added in v0.2.0
type AccessTokenResponse struct { // Access Token AccessToken string `json:"access_token"` // Token Expires Time Expires uint `json:"expires_in"` // Tonen Type "bearer" TokenType string `json:"token_type"` // Refresh Token RefreshToken string `json:"refresh_token"` // Imgur Account ID AccountID uint `json:"account_id"` // Account Username Username string `json:"account_username"` }
type Client ¶
Imgur API Client
func (*Client) DeleteImageAuthed ¶
func (client *Client) DeleteImageAuthed(id string) (*ImageInfoWithoutData, int, error)
Delete Image from Ingur using Bearer
info, status, err := DeleteImageAuthed("abc")
func (*Client) DeleteImageUnAuthed ¶
func (client *Client) DeleteImageUnAuthed(hash string) (*ImageInfoWithoutData, int, error)
Delete Image from Ingur using Client-ID
info, status, err := DeleteImageUnAuthed("deleteHash")
func (*Client) GenerateAccessToken ¶ added in v0.2.0
func (client *Client) GenerateAccessToken(refreshToken string) (*AccessTokenResponse, error)
Generate Access Token (Bearer)
res, err := client.GenerateAccessToken("abc")
func (*Client) GetImageInfo ¶ added in v0.3.0
func (client *Client) GetImageInfo(imageID string) (*ImageInfoData, int, error)
Get Image Info from Imgur
info, status, err := client.GetImageInfo("abc")
func (*Client) RateLimits ¶ added in v0.8.0
func (client *Client) RateLimits() (*RateLimitsStruct, int, error)
Get Image Info from Imgur
info, status, err := client.RateLimits()
func (*Client) UploadImage ¶
func (client *Client) UploadImage(img string, dtype string, album string) (*ImageInfoData, int, error)
Upload Image to Imgur
info, status, err := client.UploadImage("https://example.com/example.png", "url", "abc")
func (*Client) UploadImageFromFile ¶
Upload Image to Imgur by File
info, status, err := client.UploadImageFromURL("path/to/img", "")
func (*Client) UploadImageFromURL ¶
Upload Image to Imgur by URL
info, status, err := client.UploadImageFromURL("https://abc/img", "")
type ImageInfo ¶
type ImageInfo struct { // Imgur img ID e.g. abcde123098 ID string `json:"id"` // ID with extention e.g. abcde123098.png IDExt string // Image Title Title string `json:"title"` // Image Description Description string `json:"description"` // Image Upload Datetime Datetime int `json:"datetime"` // Type Format MimeType string `json:"type"` // Image is animated? Animated bool `json:"animated"` // Image width Width int `json:"width"` // Image height Height int `json:"height"` // Image File Size Size int `json:"size"` // Image Views Views int `json:"views"` // Imgur Bandwidth Bandwidth int `json:"bandwidth"` // Imgur Delete Hash Deletehash string `json:"deletehash,omitempty"` // The name of the file Name string `json:"name,omitempty"` Section string `json:"section"` // Image URL e.g. https://i.imgur.com/abcde123098.png 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"` // Image is Nsfw? Nsfw bool `json:"nsfw"` Vote string `json:"vote"` InGallery bool `json:"in_gallery"` }
type ImageInfoData ¶
type ImageInfoWithoutData ¶
type RateLimitsData ¶ added in v0.8.0
type RateLimitsStruct ¶ added in v0.8.0
type RateLimitsStruct struct { Data RateLimitsData `json:"data"` Success bool `json:"success"` Status int `json:"status"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.