Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) Download(ctx context.Context, res Result) ([]byte, error)
- func (c *Client) Get(ctx context.Context, imgUrl string) (color Result, bovw Result, err error)
- func (c *Client) Post(ctx context.Context, imgData []byte) (color Result, bovw Result, err error)
- func (c *Client) Search(ctx context.Context, image any) (color Result, bovw Result, err error)
- type Result
Constants ¶
View Source
const ( API_HOST = `https://ascii2d.net` API_SEARCH_FILE = `/search/file` API_SEARCH_URL = `/search/url` API_RESULT_COLOR = `/search/color` API_RESULT_BOVW = `/search/bovw` )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
Host string
FlareSolverrClient *fs.Client
NumResults int // [TODO] 显式指定返回的结果数量
// contains filtered or unexported fields
}
func (*Client) Download ¶
Download 通过搜索时缓存的 FlareSolverr 凭证下载缩略图,返回图片字节 若缓存为空则现取一次;调用点应对 error 做回退处理
Click to show internal directories.
Click to hide internal directories.