Documentation ¶
Index ¶
- Constants
- func NewMockServer() (*http.ServeMux, *url.URL)
- type CheckMD5
- type Client
- func (c *Client) CheckMD5(ctx context.Context, md5 string) (*CheckMD5, error)
- func (c *Client) GetPostByID(ctx context.Context, id uint) (*Post, error)
- func (c *Client) GetPostByMD5(ctx context.Context, md5 string) (*Post, error)
- func (c *Client) List(ctx context.Context, p ListParams) (*[]Post, error)
- func (c *Client) ListWithTypedTags(ctx context.Context, p ListParams) (*[]TypedTagsPost, error)
- func (client *Client) NewRequest(ctx context.Context, subURL string, query map[string]string, method string, ...) (*http.Request, error)
- func (c *Client) Popular(ctx context.Context, interval string) (*[]Post, error)
- func (c *Client) PostTagHistory(ctx context.Context, p PostTagHistoryParams) (*[]PostTagHistory, error)
- type CreatedAt
- type FileExt
- type ListParams
- type Post
- type PostTagHistory
- type PostTagHistoryParams
- type Rating
- type Status
- type TypedTags
- type TypedTagsPost
Constants ¶
View Source
const ( NO_PARENT int = -1 NO_CHILDREN int = -1 )
View Source
const ( Safe Rating = "s" Questionable = "q" Explicit = "e" )
View Source
const ( JPG FileExt = "jpg" PNG = "png" GIF = "gif" SWF = "swf" WEBM = "webm" )
View Source
const (
NO_POST int = -1
)
View Source
const (
TestFileGetPost = "testdata/getpost.json"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
func NewTestClient ¶
func (*Client) GetPostByID ¶
post/show
func (*Client) GetPostByMD5 ¶
func (*Client) ListWithTypedTags ¶
func (c *Client) ListWithTypedTags(ctx context.Context, p ListParams) (*[]TypedTagsPost, error)
func (*Client) NewRequest ¶
func (*Client) PostTagHistory ¶
func (c *Client) PostTagHistory(ctx context.Context, p PostTagHistoryParams) (*[]PostTagHistory, error)
type Post ¶
type Post struct { ID int `json:"id"` TagsString string `json:"tags"` LockedTagsString string `json:"locked_tags"` Tags []string LockedTags []string Description string `json:"description"` CreatedAt CreatedAt `json:"created_at"` CreatorID int `json:"creator_id"` Author string `json:"author"` Change int `json:"change"` Source string `json:"source"` Score int `json:"score"` FavCount int `json:"fav_count"` Md5 string `json:"md5"` FileSize int `json:"file_size"` FileURL string `json:"file_url"` FileExt FileExt `json:"file_ext"` PreviewURL string `json:"preview_url"` PreviewWidth int `json:"preview_width"` PreviewHeight int `json:"preview_height"` SampleURL string `json:"sample_url"` SampleWidth int `json:"sample_width"` SampleHeight int `json:"sample_height"` Rating Rating `json:"rating"` Status Status `json:"status"` Width int `json:"width"` Height int `json:"height"` HasComments bool `json:"has_comments"` HasNotes bool `json:"has_notes"` HasChildren bool `json:"has_children"` ChildrenPtr string `json:"children"` //null or id ParentIDPtr string `json:"parent_id"` //null or id Children int ParentID int Artist []string `json:"artist"` Sources []string `json:"sources"` Delreason string `json:"delreason"` }
Note: the following fields are not available for deleted posts: source, sources, md5, file_size, file_ext, preview_width, preview_height, sample_url, sample_width, sample_height, has_children, children
type PostTagHistory ¶
type PostTagHistoryParams ¶
type TypedTagsPost ¶
type TypedTagsPost struct { ID int `json:"id"` LockedTagsString string `json:"locked_tags"` Tags TypedTags `json:"tags"` LockedTags []string Description string `json:"description"` CreatedAt CreatedAt `json:"created_at"` CreatorID int `json:"creator_id"` Author string `json:"author"` Change int `json:"change"` Source string `json:"source"` Score int `json:"score"` FavCount int `json:"fav_count"` Md5 string `json:"md5"` FileSize int `json:"file_size"` FileURL string `json:"file_url"` FileExt FileExt `json:"file_ext"` PreviewURL string `json:"preview_url"` PreviewWidth int `json:"preview_width"` PreviewHeight int `json:"preview_height"` SampleURL string `json:"sample_url"` SampleWidth int `json:"sample_width"` SampleHeight int `json:"sample_height"` Rating Rating `json:"rating"` Status Status `json:"status"` Width int `json:"width"` Height int `json:"height"` HasComments bool `json:"has_comments"` HasNotes bool `json:"has_notes"` HasChildren bool `json:"has_children"` ChildrenPtr string `json:"children"` //null or id ParentIDPtr string `json:"parent_id"` //null or id Children int ParentID int Artist []string `json:"artist"` Sources []string `json:"sources"` Delreason string `json:"delreason"` }
Click to show internal directories.
Click to hide internal directories.