gelbooru

package
v0.0.0-...-f5154d6 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2022 License: BSD-3-Clause Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	// contains filtered or unexported fields
}

func NewAPI

func NewAPI(key, user string) API

func (*API) SearchComments

func (a *API) SearchComments(f CommentFilter) (*CommentResults, error)

func (*API) SearchPosts

func (a *API) SearchPosts(f PostFilter) (*PostResults, error)

func (*API) SearchTags

func (a *API) SearchTags(f TagFilter) (*TagResults, error)

func (*API) SearchUsers

func (a *API) SearchUsers(f UserFilter) (*UserResults, error)

func (*API) SetRateLimit

func (a *API) SetRateLimit(ratelimit int64)

type Comment

type Comment struct {
	ID           uint   `xml:"id,attr"`
	PostID       uint   `xml:"post_id,attr"`
	CreationDate string `xml:"created_at,attr"`
	Creator      uint   `xml:"creator,attr"`
	CreatorID    uint   `xml:"creator_id,attr"`
}

type CommentFilter

type CommentFilter struct {
	PostID uint
}

type CommentResults

type CommentResults struct {
	Comments []Comment `xml:"comment"`
}

type OrderBy

type OrderBy string
const (
	Default OrderBy = ""
	Date    OrderBy = "date"
	Count   OrderBy = "count"
	Name    OrderBy = "name"
)

type Post

type Post struct {
	ID            uint   `xml:"id"`
	CreationDate  string `xml:"created_at"`
	Score         int    `xml:"score"`
	Width         uint   `xml:"width"`
	Height        uint   `xml:"height"`
	MD5Hash       string `xml:"md5"`
	Directory     string `xml:"directory"`
	FileName      string `xml:"image"`
	Rating        string `xml:"rating"`
	SourceURL     string `xml:"source"`
	Change        uint   `xml:"change"`
	Owner         string `xml:"owner"`
	CreatorID     uint   `xml:"creator_id"`
	ParentID      uint   `xml:"parent_id"`
	Sample        uint   `xml:"sample"`
	PreviewHeight uint   `xml:"preview_height"`
	PreviewWidth  uint   `xml:"preview_width"`
	Tags          string `xml:"tags"`
	HasNotes      bool   `xml:"has_notes"`
	HasComments   bool   `xml:"has_comments"`
	FileURL       string `xml:"file_url"`
	PreviewURL    string `xml:"preview_url"`
	Status        string `xml:"status"`
	HasChildren   bool   `xml:"has_children"`
}

type PostFilter

type PostFilter struct {
	PostID    uint
	PostLimit uint
	PageNum   uint
	Tags      []string
	ChangeID  uint
}

type PostResults

type PostResults struct {
	Posts  []Post `xml:"post"`
	Limit  uint   `xml:"limit,attr"`
	Offset uint   `xml:"offset,attr"`
	Count  uint   `xml:"count,attr"`
}

type Tag

type Tag struct {
	ID        uint   `xml:"id"`
	Name      string `xml:"name"`
	Count     uint   `xml:"count"`
	Type      uint   `xml:"type"`
	Ambiguous bool   `xml:"ambiguous"`
}

type TagFilter

type TagFilter struct {
	TagID       uint
	TagLimit    uint
	AfterID     uint
	Name        string
	Names       []string
	NamePattern string
	OrderBy     OrderBy
}

type TagResults

type TagResults struct {
	Tags   []Tag `xml:"tag"`
	Limit  uint  `xml:"limit,attr"`
	Offset uint  `xml:"offset,attr"`
	Count  uint  `xml:"count,attr"`
}

type User

type User struct {
	ID     uint   `xml:"id"`
	Name   string `xml:"username"`
	Active bool   `xml:"active"`
}

type UserFilter

type UserFilter struct {
	UserLimit   uint
	PageNum     uint
	UserName    string
	NamePattern string
}

type UserResults

type UserResults struct {
	Users  []User `xml:"user"`
	Limit  uint   `xml:"limit,attr"`
	Offset uint   `xml:"offset,attr"`
	Count  uint   `xml:"count,attr"`
}

Jump to

Keyboard shortcuts

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