types

package
v0.0.0-...-b0fc717 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeletedPostsAfterId

func DeletedPostsAfterId(id int) string

func PostsAfterChangeSeq

func PostsAfterChangeSeq(change int) string

func PostsAfterId

func PostsAfterId(id int) string

func SinglePostByMd5

func SinglePostByMd5(md5 string) string

Types

type AliasSearchOrder

type AliasSearchOrder string
const ASOCount AliasSearchOrder = "tag_count"
const ASOCreated AliasSearchOrder = "created_at"
const ASOName AliasSearchOrder = "name"
const ASOStatus AliasSearchOrder = "status"
const ASOUpdated AliasSearchOrder = "updated_at"

func (AliasSearchOrder) String

func (this AliasSearchOrder) String() string

type AliasStatus

type AliasStatus string
const ASActive AliasStatus = "Active"
const ASApproved AliasStatus = "Approved"
const ASDeleted AliasStatus = "Deleted"
const ASPending AliasStatus = "Pending"
const ASProcessing AliasStatus = "Processing"
const ASQueued AliasStatus = "Queued"
const ASRetired AliasStatus = "Retired"

func (AliasStatus) String

func (this AliasStatus) String() string

type ListPostOptions

type ListPostOptions struct {
	Page        PageSelector
	Limit       int
	SearchQuery string
}

type ListTagAliasOptions

type ListTagAliasOptions struct {
	Page         PageSelector
	Limit        int
	MatchAliases string
	//	AntecedentCategory *TagCategory
	//	ConsequentCategory *TagCategory // disabled right now due to unexpected behavior
	Status AliasStatus
	Order  AliasSearchOrder
}

type ListTagsOptions

type ListTagsOptions struct {
	Page      PageSelector
	Limit     int
	MatchTags string
	Category  *TagCategory
	Order     TagSearchOrder
	HideEmpty bool
	HasWiki   *bool
	HasArtist *bool
}

type PageSelector

type PageSelector struct {
	Before *int
	After  *int
	Page   *int
}

func After

func After(i int) PageSelector

func Before

func Before(i int) PageSelector

func Page

func Page(i int) PageSelector

func (PageSelector) String

func (this PageSelector) String() string

type PostRating

type PostRating string
const (
	Explicit     PostRating = "e"
	Questionable PostRating = "q"
	Safe         PostRating = "s"
	Original     PostRating = ""
	Invalid      PostRating = "invalid"
)

func RatingFromTagSet

func RatingFromTagSet(ts tags.TagSet) PostRating

attempts to find a "rating:*" tag and interpret it, returning a rating string if it does and returning nothing if there isn't one.

func (PostRating) String

func (r PostRating) String() string

type PostVote

type PostVote int
const Downvote PostVote = -1
const Neutral PostVote = 0 // this can show up in API responses but you can't vote by specifying it, if you want to delete your vote, use the endpoint for that
const Upvote PostVote = 1

func (PostVote) Value

func (this PostVote) Value() int

type TAliasData

type TAliasData struct {
	Id    int    `json:"id"`
	Name  string `json:"consequent_name"`
	Alias string `json:"antecedent_name"`
}

type TAliasInfoArray

type TAliasInfoArray []TAliasData

type TAliasListing

type TAliasListing struct {
	Aliases TAliasInfoArray
}

func (*TAliasListing) UnmarshalJSON

func (this *TAliasListing) UnmarshalJSON(b []byte) error

type TApiStatus

type TApiStatus struct {
	Success bool    `json:"success"`
	Message string  `json:"message"`
	Reason  string  `json:"reason"`
	Code    *string `json:"code"`
}

type THistoryArray

type THistoryArray []TTagHistory

type TPostFile

type TPostFile struct {
	Width     int    `json:"width"`
	Height    int    `json:"height"`
	File_ext  string `json:"ext"`
	File_size int    `json:"size"`
	File_url  string `json:"url"`
	Md5       string `json:"md5"`
}

type TPostFlags

type TPostFlags struct {
	Pending       bool `json:"pending"`
	Flagged       bool `json:"flagged"`
	Locked_notes  bool `json:"note_locked"`
	Locked_status bool `json:"status_locked"`
	Locked_rating bool `json:"rating_locked"`
	Deleted       bool `json:"deleted"`
}

type TPostInfo

type TPostInfo struct {
	// anonymous nested subcomponents
	TPostScore         `json:"score"`
	TPostFile          `json:"file"`
	TPostPreview       `json:"preview"`
	TPostSample        `json:"sample"`
	TPostFlags         `json:"flags"`
	TPostRelationships `json:"relationships"`
	TPostTags          `json:"tags"`

	Id            int        `json:"id"`
	Description   string     `json:"description"`
	Creator_id    int        `json:"uploader_id"`
	Change        int        `json:"change_seq"`
	Fav_count     int        `json:"fav_count"`
	Rating        PostRating `json:"rating"`
	Comment_count int        `json:"comment_count"`
	Sources       []string   `json:"sources,omitempty"`
	// contains filtered or unexported fields
}

func (*TPostInfo) ExtendedTagSet

func (this *TPostInfo) ExtendedTagSet() tags.TagSet

func (*TPostInfo) GetFields

func (this *TPostInfo) GetFields() (dml.NamedFields, error)

func (*TPostInfo) MatchesBlacklist

func (this *TPostInfo) MatchesBlacklist(blacklist string) bool

func (*TPostInfo) PostScan

func (this *TPostInfo) PostScan() error

func (*TPostInfo) TagSet

func (this *TPostInfo) TagSet() tags.TagSet

func (*TPostInfo) Tags

func (this *TPostInfo) Tags() []string

type TPostInfoArray

type TPostInfoArray []TPostInfo

type TPostListing

type TPostListing struct {
	Posts TPostInfoArray
}

func (*TPostListing) UnmarshalJSON

func (this *TPostListing) UnmarshalJSON(b []byte) error

type TPostPreview

type TPostPreview struct {
	Preview_width  int    `json:"width"`
	Preview_height int    `json:"height"`
	Preview_url    string `json:"url"`
}

type TPostRelationships

type TPostRelationships struct {
	Parent_id           int   `json:"parent_id,omitempty"`
	Has_children        bool  `json:"has_children"`
	Has_active_children bool  `json:"has_active_children"`
	Children            []int `json:"children,omitempty"`
}

type TPostSample

type TPostSample struct {
	Sample_width  int    `json:"width"`
	Sample_height int    `json:"height"`
	Sample_url    string `json:"url"`
	Has_sample    bool   `json:"has"`
}

type TPostScore

type TPostScore struct {
	Upvotes   int      `json:"up"`
	Downvotes int      `json:"down"`
	Score     int      `json:"total"`
	OurScore  PostVote `json:"our_score"` // only shown when actually voting
}

type TPostTags

type TPostTags 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"`
}

type TSinglePostListing

type TSinglePostListing struct {
	Post TPostInfo
}

func (*TSinglePostListing) UnmarshalJSON

func (this *TSinglePostListing) UnmarshalJSON(b []byte) error

type TTagData

type TTagData struct {
	Id        int         `json:"id"         dml:"tag_id"`
	Name      string      `json:"name"       dml:"tag_name"`
	Count     int         `json:"post_count" dml:"tag_count"`
	FullCount int         `dml:"tag_count_full"` // this field is only present in the local DB
	Type      TagCategory `json:"category"   dml:"tag_type"`
	Locked    *bool       `json:"is_locked"  dml:"tag_type_locked"`
}

func (TTagData) ApparentCount

func (this TTagData) ApparentCount(include_deleted bool) int

type TTagHistory

type TTagHistory struct {
	Id      int    `json:"id"`
	Post_id int    `json:"post_id"`
	Tags    string `json:"tags"`
}

type TTagInfoArray

type TTagInfoArray []TTagData

type TTagListing

type TTagListing struct {
	Tags TTagInfoArray
}

func (*TTagListing) UnmarshalJSON

func (this *TTagListing) UnmarshalJSON(b []byte) error

type TUserInfo

type TUserInfo struct {
	Id              int    `json:"id"`
	CreatedAt       string `json:"created_at"`
	Name            string `json:"name"`
	Level           int    `json:"level"`
	BaseUploadLimit int    `json:"base_upload_limit"`
	PostUploadCount int    `json:"post_upload_count"`
	PostUpdateCount int    `json:"post_update_count"`
	NoteUpdateCount int    `json:"note_update_count"`
	IsBanned        bool   `json:"is_banned"`
	CanApprovePosts bool   `json:"can_approve_posts"`
	CanUploadFree   bool   `json:"can_upload_free"`
	LevelString     string `json:"level_string"`
	Email           string `json:"email"` // only present when logged in, and only for your own account
	Blacklist       string `json:"blacklisted_tags"`
}

type TUserInfoArray

type TUserInfoArray []TUserInfo

type TagCategory

type TagCategory int
const TCArtist TagCategory = 1
const TCCharacter TagCategory = 4
const TCCopyright TagCategory = 3
const TCGeneral TagCategory = 0
const TCInvalid TagCategory = 6
const TCLore TagCategory = 8
const TCMeta TagCategory = 7
const TCSpecies TagCategory = 5

func (TagCategory) Value

func (this TagCategory) Value() int

type TagSearchOrder

type TagSearchOrder string
const TSOCount TagSearchOrder = "count"
const TSOName TagSearchOrder = "name"
const TSONewest TagSearchOrder = "date" // default

func (TagSearchOrder) String

func (this TagSearchOrder) String() string

Jump to

Keyboard shortcuts

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