danbooru

package
v0.37.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidDanbooruPostURL = errors.New("invalid danbooru post url")
)

Functions

This section is empty.

Types

type Danbooru

type Danbooru struct{}

func (*Danbooru) Config

func (d *Danbooru) Config() *config.SourceCommonConfig

func (*Danbooru) FetchNewArtworks

func (d *Danbooru) FetchNewArtworks(limit int) ([]*types.Artwork, error)

func (*Danbooru) FetchNewArtworksWithCh

func (d *Danbooru) FetchNewArtworksWithCh(artworkCh chan *types.Artwork, limit int) error

func (*Danbooru) GetArtworkInfo

func (d *Danbooru) GetArtworkInfo(sourceURL string) (*types.Artwork, error)

func (*Danbooru) GetCommonSourceURL

func (d *Danbooru) GetCommonSourceURL(url string) string

func (*Danbooru) GetFileName

func (d *Danbooru) GetFileName(artwork *types.Artwork, picture *types.Picture) string

func (*Danbooru) GetPictureInfo

func (d *Danbooru) GetPictureInfo(sourceURL string, _ uint) (*types.Picture, error)

func (*Danbooru) GetSourceURLRegexp

func (d *Danbooru) GetSourceURLRegexp() *regexp.Regexp

func (*Danbooru) Init

func (d *Danbooru) Init()

type DanbooruFailJsonResp

type DanbooruFailJsonResp struct {
	Success bool   `json:"success"`
	Error   string `json:"error"`
	Message string `json:"message"`
}

type DanbooruJsonResp

type DanbooruJsonResp struct {
	ID           int    `json:"id"`
	ImageWidth   int    `json:"image_width"`
	ImageHeight  int    `json:"image_height"`
	TagString    string `json:"tag_string"`
	FileURL      string `json:"file_url"`
	LargeFileURL string `json:"large_file_url"`
	DanbooruFailJsonResp
}

func (*DanbooruJsonResp) ToArtwork

func (resp *DanbooruJsonResp) ToArtwork() *types.Artwork

Jump to

Keyboard shortcuts

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