api

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	gallium.Client
}

func NewClient

func NewClient() *Client

func (*Client) DownloadPost

func (client *Client) DownloadPost(post *Post) ([]byte, error)

func (*Client) DownloadPostTo

func (client *Client) DownloadPostTo(post *Post, filePath string) error

func (*Client) ListPosts

func (client *Client) ListPosts(tags string, limit, page int) (*ListPostsResponse, error)

type File

type File struct {
	Width  int    `json:"width"`
	Height int    `json:"height"`
	Ext    string `json:"ext"`
	Size   int    `json:"size"`
	Md5    string `json:"md5"`
	URL    string `json:"url"`
}

type Flags

type Flags struct {
	Pending      bool `json:"pending"`
	Flagged      bool `json:"flagged"`
	NoteLocked   bool `json:"note-locked"`
	StatusLocked bool `json:"status-locked"`
	RatingLocked bool `json:"rating-locked"`
	Deleted      bool `json:"deleted"`
}

type ListPostsResponse

type ListPostsResponse struct {
	Posts []Post `json:"posts,omitempty"`
}

type Post

type Post struct {
	ID        int       `json:"id,omitempty"`
	CreatedAt time.Time `json:"created_at,omitempty"`
	UpdatedAt time.Time `json:"updated_at,omitempty"`

	LockedTags     []string `json:"locked_tags,omitempty"`
	ChangeSequence int      `json:"change_seq,omitempty"`
	Rating         string   `json:"rating,omitempty"`
	FavCount       int      `json:"fav_count,omitempty"`
	Pools          []int    `json:"pools,omitempty"`
	ApproverID     int      `json:"approver_id,omitempty"`
	UploaderID     int      `json:"uploader_id,omitempty"`
	Description    string   `json:"description,omitempty"`
	CommentCount   int      `json:"comment_count,omitempty"`
	IsFavorited    bool     `json:"is_favorited,omitempty"`

	File          File          `json:"file,omitempty"`
	Preview       Preview       `json:"preview,omitempty"`
	Sample        Sample        `json:"sample,omitempty"`
	Score         Score         `json:"score,omitempty"`
	Tags          Tags          `json:"tags,omitempty"`
	Flags         Flags         `json:"flags,omitempty"`
	Relationships Relationships `json:"relationships,omitempty"`
}

type Preview

type Preview struct {
	Width  int    `json:"width"`
	Height int    `json:"height"`
	URL    string `json:"url"`
}

type Relationships

type Relationships struct {
	ParentID          int   `json:"parent_id"`
	HasChildren       bool  `json:"has_children"`
	HasActiveChildren bool  `json:"has_active_children"`
	Children          []int `json:"children"`
}

type Sample

type Sample struct {
	HasSample bool   `json:"has"`
	Height    int    `json:"height"`
	Width     int    `json:"width"`
	URL       string `json:"url"`
}

type Score

type Score struct {
	Up    int `json:"up"`
	Down  int `json:"down"`
	Total int `json:"total"`
}

type State

type State struct {
	gallium.AllInvalidStateProvider
}

func (State) Aspect

func (s State) Aspect() gallium.StateAspect

func (State) UserAgent

func (s State) UserAgent() string

type Tags

type Tags struct {
	General   []string `json:"general"`
	Species   []string `json:"species"`
	Character []string `json:"character"`
	Artist    []string `json:"artist"`
	Invalid   []string `json:"invalid"`
	Lore      []string `json:"lore"`
	Meta      []string `json:"meta"`
}

Jump to

Keyboard shortcuts

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