Documentation ¶
Overview ¶
Package client is a client for the Scrap Exchange REST API.
Index ¶
- type Client
- func (c *Client) CreateScrap(ctx context.Context, body scrap.ScrapBody) (scrap.ScrapID, error)
- func (c *Client) DeleteName(ctx context.Context, t scrap.Type, name string) error
- func (c *Client) DeleteScrap(ctx context.Context, t scrap.Type, hashOrName string) error
- func (c *Client) Expand(ctx context.Context, t scrap.Type, hashOrName string, lang scrap.Lang, ...) error
- func (c *Client) GetName(ctx context.Context, t scrap.Type, name string) (scrap.Name, error)
- func (c *Client) ListNames(ctx context.Context, t scrap.Type) ([]string, error)
- func (c *Client) LoadScrap(ctx context.Context, t scrap.Type, hashOrName string) (scrap.ScrapBody, error)
- func (c *Client) PutName(ctx context.Context, t scrap.Type, name string, nameBody scrap.Name) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements api.ScrapExchange using the HTTP REST API talking to a server.
func New ¶
New returns a new instance of Client.
The value of the host should be the base scheme, host, and port that all requests should go to, e.g. "http://scrapexchange:9000".
func (*Client) CreateScrap ¶
CreateScrap implements scrap.ScrapExchange.
func (*Client) DeleteName ¶
DeleteName implements scrap.ScrapExchange.
func (*Client) DeleteScrap ¶
DeleteScrap implements scrap.ScrapExchange.
func (*Client) Expand ¶
func (c *Client) Expand(ctx context.Context, t scrap.Type, hashOrName string, lang scrap.Lang, w io.Writer) error
Expand implements scrap.ScrapExchange.
Click to show internal directories.
Click to hide internal directories.