Documentation
¶
Index ¶
- Constants
- func TranslateItem(i rest.Item) (*assets.Item, error)
- func TranslateItemChange(i assets.ItemChange) (rest.ItemRequest, error)
- type Client
- func (c Client) CreateItem(ctx context.Context, item assets.ItemCreate) (*assets.Item, error)
- func (c Client) GetItem(ctx context.Context, id assets.ItemID) (*assets.Item, error)
- func (c Client) ListItems(ctx context.Context, filter assets.ItemFilter) ([]*assets.Item, error)
- func (c Client) RemoveItem(ctx context.Context, id assets.ItemID) error
- func (c Client) UpdateItem(ctx context.Context, id assets.ItemID, item assets.ItemUpdate) (*assets.Item, error)
- type ClientOption
Constants ¶
View Source
const (
V1ItemsRoute string = "/v1/items"
)
Variables ¶
This section is empty.
Functions ¶
func TranslateItem ¶
TranslateItem translates a network item into an assets item.
func TranslateItemChange ¶
func TranslateItemChange(i assets.ItemChange) (rest.ItemRequest, error)
TranslateItemChange translates an asset item change struct to a network item request.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides a client for the assets api.
func New ¶
func New(baseURL string, opts ...ClientOption) *Client
New returns a new client for the assets API.
func (Client) CreateItem ¶
CreateItem creates an item.
func (Client) RemoveItem ¶
RemoveItem deletes an item.
type ClientOption ¶
type ClientOption interface {
// contains filtered or unexported methods
}
ClientOption provides options for configuring the creation of an assets client.
func WithTimeout ¶
func WithTimeout(timeout time.Duration) ClientOption
WithTime sets the client timeout.
Click to show internal directories.
Click to hide internal directories.