Versions in this module Expand all Collapse all v0 v0.3.0 Jan 26, 2022 Changes in this version + var ErrClientSide = errors.New("client side error") + var ErrIteratorFinished = errors.New("iterator has finished") + var ErrOptions = errors.New("provided options are not valid") + var ErrServerSide = errors.New("server side error") + var ErrUknownIndex = errors.New("unknown or unsupported index") + type AccountType int + const AnonymousAccount + const NormalAccount + const PremiumAccount + const Unknown + type Client interface + GetSauceForFile func(context.Context, string, ...RequestOption) (*Response, error) + GetSauceForURL func(context.Context, string, ...RequestOption) (*Response, error) + type RequestOption func(*RequestOptions) + func WithHTTPClient(client *http.Client) RequestOption + func WithIndex(index indexes.Index) RequestOption + func WithMinimumSimilarity(minimum int) RequestOption + func WithResultsNumber(num int) RequestOption + func WithSafetyLevel(mode SafetyLevel) RequestOption + func WithTestMode() RequestOption + type RequestOptions struct + DB indexes.Index + HttpClient *http.Client + MinimumSimilarity int + ResultsNumber int + SafetyLevel SafetyLevel + TestMode bool + type Response struct + AccountType AccountType + LongLimit int + LongRemaining int + MinimumSimilarity float64 + QueryImage string + QueryImageDisplay string + Results *ResultsIterator + ResultsRequested int + ResultsReturned int + SearchDepth float64 + ShortLimit int + ShortRemaining int + UserID int + func (r *Response) CanPerformMoreCalls() bool + type ResultsIterator struct + func (r *ResultsIterator) Next() (sauces.Sauce, error) + type SafetyLevel int + const HideExpectedAndSuspectedExplicit + const HideExpectedExplicit + const Safest + const ShowAll + type SauceClient struct + func NewSauceClient(apiKey string, defaultOptions ...RequestOption) (*SauceClient, error) + func (c *SauceClient) GetSauceForFile(ctx context.Context, imagepath string, opts ...RequestOption) (*Response, error) + func (c *SauceClient) GetSauceForURL(ctx context.Context, url string, opts ...RequestOption) (*Response, error)