e621

package
v0.0.0-...-fc4665f Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPGet

func HTTPGet(url string) (*http.Response, error)

HTTPGet is a helper function that automatically adds the tool's UA to an HTTP GET request

Types

type Post

type Post struct {
	ID            int               `json:"id"`
	CreatedAt     string            `json:"created_at"`
	UpdatedAt     string            `json:"updated_at"`
	File          PostFile          `json:"file"`
	Preview       PostPreview       `json:"preview"`
	Sample        PostSample        `json:"sample"`
	Score         PostScore         `json:"score"`
	Tags          PostTags          `json:"tags"`
	LockedTags    []string          `json:"locked_tags"`
	ChangeSeq     int               `json:"change_seq"`
	Flags         PostFlags         `json:"flags"`
	Rating        string            `json:"rating"`
	FavCount      int               `json:"fav_count"`
	Sources       []string          `json:"sources"`
	Pools         []int             `json:"pools"`
	Relationships PostRelationships `json:"relationships"`
	ApproverID    int               `json:"approver_id"`
	UploaderID    int               `json:"uploader_id"`
	Description   string            `json:"description"`
	CommentCount  int               `json:"comment_count"`
	IsFavorited   bool              `json:"is_favorited"`
}

func GetPostsForTags

func GetPostsForTags(tags string, limit int, sfw bool, page int) ([]Post, error)

GetPostsForTags gets a list of e621 Posts

type PostFile

type PostFile 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 PostFlags

type PostFlags 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 PostPreview

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

type PostRelationships

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

type PostSample

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

type PostScore

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

type PostTags

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

func (*PostTags) All

func (t *PostTags) All() []string

type SerializedDate

type SerializedDate struct {
	JSONClass   string `json:"json_class"`
	Seconds     int64  `json:"s"`
	Nanoseconds int64  `json:"n"`
}

SerializedDate represents a serialized date passed via JSON

func (*SerializedDate) Time

func (date *SerializedDate) Time() time.Time

Time returns a time.Time object representing the SerializedDate

Jump to

Keyboard shortcuts

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