Documentation
¶
Index ¶
Constants ¶
View Source
const ( API_HOST = `https://saucenao.com` API_PATH = `/search.php` USER_PATH = `/user.php` // 必定触发 cf )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
ApiKey string
Host string
NumRes int
Hide int
FlareSolverrClient *fs.Client
// contains filtered or unexported fields
}
type IndexEntry ¶
type Response ¶
type Response struct {
Header ResponseHeader `json:"header"`
Results []Result `json:"results"`
RawBody string `json:"-"` // for debug
}
type ResponseHeader ¶
type ResponseHeader struct {
UserId string `json:"user_id"` // api key 所属
AccountType string `json:"account_type"` // "1"
ShortLimit string `json:"short_limit"` // "4" // 30s
LongLimit string `json:"long_limit"` // "100" // 24h
LongRemaining int `json:"long_remaining"` // 85
ShortRemaining int `json:"short_remaining"` // 3
Status int `json:"status"` // 0
ResultsRequested int `json:"results_requested"` // 对应 numres 参数
SearchDepth string `json:"search_depth"` // "128"
MinimumSimilarity float64 `json:"minimum_similarity"` // 41.49
QueryImageDisplay string `json:"query_image_display"` // 提交的图片 url
QueryImage string `json:"query_image"` // 提交的图片文件名
ResultsReturned int `json:"results_returned"` // 最终返回的结果数量
Index map[string]IndexEntry `json:"index"` // "0","2","44" ...
}
type Result ¶
type Result struct {
Header ResultHeader `json:"header"`
Data map[string]any `json:"data"` // delay decode using [mapstructure.Decode]
}
func (Result) DecodeData ¶
Click to show internal directories.
Click to hide internal directories.