kemono

package
v0.37.0 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: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIndexOOB             = errors.New("index out of artwork pictures bounds")
	ErrInvalidKemonoPostURL = errors.New("invalid kemono post url")
	ErrNotPicture           = errors.New("kemono post files or attachments are not pictures")
)

Functions

This section is empty.

Types

type Kemono

type Kemono struct{}

func (*Kemono) Config

func (k *Kemono) Config() *config.SourceCommonConfig

func (*Kemono) FetchNewArtworks

func (k *Kemono) FetchNewArtworks(limit int) ([]*types.Artwork, error)

func (*Kemono) FetchNewArtworksWithCh

func (k *Kemono) FetchNewArtworksWithCh(artworkCh chan *types.Artwork, limit int) error

func (*Kemono) GetArtworkInfo

func (k *Kemono) GetArtworkInfo(sourceURL string) (*types.Artwork, error)

func (*Kemono) GetCommonSourceURL

func (k *Kemono) GetCommonSourceURL(url string) string

func (*Kemono) GetFileName

func (k *Kemono) GetFileName(artwork *types.Artwork, picture *types.Picture) string

func (*Kemono) GetPictureInfo

func (k *Kemono) GetPictureInfo(sourceURL string, index uint) (*types.Picture, error)

func (*Kemono) GetSourceURLRegexp

func (k *Kemono) GetSourceURLRegexp() *regexp.Regexp

func (*Kemono) Init

func (k *Kemono) Init()

type KemonoCreatorProfileResp

type KemonoCreatorProfileResp struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Service  string `json:"service"`
	PubilcID string `json:"public_id"` // username
}

type KemonoPostAttachment

type KemonoPostAttachment struct {
	Name string `json:"name"`
	Path string `json:"path"`
}

type KemonoPostResp

type KemonoPostResp struct {
	Error   string `json:"error"`
	ID      string `json:"id"`
	User    string `json:"user"`
	Service string `json:"service"`
	Title   string `json:"title"`
	Content string `json:"content"`
	File    struct {
		Name string `json:"name"`
		Path string `json:"path"`
	} `json:"file"`
	Attachments []KemonoPostAttachment `json:"attachments"`
}

func (*KemonoPostResp) ToArtwork

func (resp *KemonoPostResp) ToArtwork() (*types.Artwork, error)

Jump to

Keyboard shortcuts

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