Documentation ¶
Overview ¶
Package tagbox provides a client for accessing Tagbox services.
Index ¶
- type CheckResponse
- type Client
- func (c *Client) Check(image io.Reader) (CheckResponse, error)
- func (c *Client) CheckBase64(data string) (CheckResponse, error)
- func (c *Client) CheckURL(imageURL *url.URL) (CheckResponse, error)
- func (c *Client) Info() (*boxutil.Info, error)
- func (c *Client) OpenState() (io.ReadCloser, error)
- func (c *Client) PostState(r io.Reader) error
- func (c *Client) PostStateURL(stateURL *url.URL) error
- func (c *Client) Remove(id string) error
- func (c *Client) Rename(id, tag string) error
- func (c *Client) RenameAll(oldTag, newTag string) error
- func (c *Client) Similar(image io.Reader) ([]Tag, error)
- func (c *Client) SimilarBase64(data string) ([]Tag, error)
- func (c *Client) SimilarID(id string) ([]Tag, error)
- func (c *Client) SimilarURL(imageURL *url.URL) ([]Tag, error)
- func (c *Client) Teach(image io.Reader, id, tag string) error
- func (c *Client) TeachBase64(data, id, tag string) error
- func (c *Client) TeachURL(imageURL *url.URL, id, tag string) error
- type Tag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckResponse ¶
type CheckResponse struct { // Tags are the standard tags returned Tags []Tag `json:"tags"` // CustomTags are the custom tags (previously teach) that match CustomTags []Tag `json:"custom_tags"` }
CheckResponse is all the data from /check request to tagbox
type Client ¶
type Client struct { // HTTPClient is the http.Client that will be used to // make requests. HTTPClient *http.Client // contains filtered or unexported fields }
Client is an HTTP client that can make requests to the box.
func (*Client) Check ¶
func (c *Client) Check(image io.Reader) (CheckResponse, error)
Check gets the tags for the image data provided.
func (*Client) CheckBase64 ¶
func (c *Client) CheckBase64(data string) (CheckResponse, error)
CheckBase64 gets the tags for the image in the encoded Base64 data string.
func (*Client) CheckURL ¶
func (c *Client) CheckURL(imageURL *url.URL) (CheckResponse, error)
CheckURL gets the tags for the image at the specified URL.
func (*Client) OpenState ¶
func (c *Client) OpenState() (io.ReadCloser, error)
OpenState opens the state file for reading. Clients must call Close.
func (*Client) PostStateURL ¶
PostStateURL tells tagbox to download the state file specified by the URL.
func (*Client) Similar ¶
Similar checks the image in the io.Reader for similar images based on tags previously taught.
func (*Client) SimilarBase64 ¶
SimilarBase64 checks the image at the specified URL for similar images based on tags previously taught.
func (*Client) SimilarURL ¶
SimilarURL checks the image at the specified URL for similar images based on tags previously taught.
func (*Client) Teach ¶
Teach teaches tagbox the image with a custom tag in the io.Reader. The tag is the string representation of the main thing on the image. The id should be a unique identifier for the image, usually the filename.
func (*Client) TeachBase64 ¶
TeachBase64 teaches tagbox the Base64 encoded image with a custom tag. See Teach for more information.