lolicon_pool

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2021 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const Host = "https://api.lolicon.app/setu"

Variables

View Source
var (
	ErrNotFound    = fmt.Errorf("没有符合条件的图片")
	ErrAPIKeyError = fmt.Errorf("APIKEY 不存在或被封禁")
	ErrQuotaExceed = fmt.Errorf("达到调用额度限制")
)

Functions

func KeywordOption

func KeywordOption(keyword string) image_pool.OptionFunc

func R18Option

func R18Option(r18Type R18Type) image_pool.OptionFunc

Types

type Config

type Config struct {
	ApiKey   string
	CacheMin int
	CacheMax int
}

type LoliconPool

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

func NewLoliconPool

func NewLoliconPool(config *Config) (*LoliconPool, error)

func (*LoliconPool) Get

func (pool *LoliconPool) Get(options ...image_pool.OptionFunc) ([]image_pool.Image, error)

type R18Type

type R18Type int
const (
	R18Off R18Type = iota
	R18On
)

func (R18Type) String

func (r R18Type) String() string

type Request

type Request struct {
	Apikey   string `json:"apikey"`
	R18      int    `json:"r18"`
	Keyword  string `json:"keyword"`
	Num      int    `json:"num"`
	Proxy    string `json:"proxy"`
	Size1200 bool   `json:"size1200"`
}

type Response

type Response struct {
	Code        int     `json:"code"`
	Msg         string  `json:"msg"`
	Quota       int     `json:"quota"`
	QuotaMinTTL int     `json:"quota_min_ttl"`
	Count       int     `json:"count"`
	Data        []*Setu `json:"data"`
}

func LoliconAppSetu

func LoliconAppSetu(apikey string, R18 R18Type, keyword string, num int) (*Response, error)

type Setu

type Setu struct {
	Pid    int      `json:"pid"`
	P      int      `json:"p"`
	Uid    int      `json:"uid"`
	Title  string   `json:"title"`
	Author string   `json:"author"`
	Url    string   `json:"url"`
	R18    bool     `json:"r18"`
	Width  int      `json:"width"`
	Height int      `json:"height"`
	Tags   []string `json:"tags"`
}

func (*Setu) Content

func (s *Setu) Content() ([]byte, error)

Jump to

Keyboard shortcuts

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