Documentation
¶
Overview ¶
Package client talks to import-deploy.
Every call has a Context variant. Use it: it carries the caller's trace and baggage onto the wire, which is what lets import-deploy -- and the import container it deploys -- log under the context of whatever caused the call. A smart service worker that passes its instance id this way gets it back on every log line the resulting import ever writes.
The variants without a context are kept so existing callers still build. They pass context.TODO(), so import-deploy starts a trace of its own and the connection to the caller is lost.
Index ¶
- type Client
- func (c *Client) CountInstances(jwt jwt.Token, search string, includeGenerated bool) (count int64, err error, errCode int)
- func (c *Client) CountInstancesContext(ctx context.Context, jwt jwt.Token, search string, includeGenerated bool) (count int64, err error, errCode int)
- func (c *Client) CreateInstance(instance model.Instance, jwt jwt.Token) (result model.Instance, err error, code int)
- func (c *Client) CreateInstanceContext(ctx context.Context, instance model.Instance, jwt jwt.Token) (result model.Instance, err error, code int)
- func (c *Client) DeleteInstance(id string, jwt jwt.Token, forUser string) (err error, errCode int)
- func (c *Client) DeleteInstanceContext(ctx context.Context, id string, jwt jwt.Token, forUser string) (err error, errCode int)
- func (c *Client) ListInstances(jwt jwt.Token, limit int64, offset int64, sort string, asc bool, search string, ...) (results []model.Instance, err error, errCode int)
- func (c *Client) ListInstancesContext(ctx context.Context, jwt jwt.Token, limit int64, offset int64, sort string, ...) (results []model.Instance, err error, errCode int)
- func (c *Client) ReadInstance(id string, jwt jwt.Token, forUser string) (result model.Instance, err error, errCode int)
- func (c *Client) ReadInstanceContext(ctx context.Context, id string, jwt jwt.Token, forUser string) (result model.Instance, err error, errCode int)
- func (c *Client) SetInstance(importType model.Instance, jwt jwt.Token) (err error, code int)
- func (c *Client) SetInstanceContext(ctx context.Context, importType model.Instance, jwt jwt.Token) (err error, code int)
- type Interface
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
}
func (*Client) CountInstances ¶ added in v0.0.3
func (*Client) CountInstancesContext ¶ added in v0.2.0
func (*Client) CreateInstance ¶
func (*Client) CreateInstanceContext ¶ added in v0.2.0
func (*Client) DeleteInstance ¶
func (*Client) DeleteInstanceContext ¶ added in v0.2.0
func (*Client) ListInstances ¶
func (*Client) ListInstancesContext ¶ added in v0.2.0
func (*Client) ReadInstance ¶
func (*Client) ReadInstanceContext ¶ added in v0.2.0
func (*Client) SetInstance ¶
type Interface ¶
type Interface interface {
ListInstances(jwt jwt.Token, limit int64, offset int64, sort string, asc bool, search string, includeGenerated bool, forUser string) (results []model.Instance, err error, errCode int)
ListInstancesContext(ctx context.Context, jwt jwt.Token, limit int64, offset int64, sort string, asc bool, search string, includeGenerated bool, forUser string) (results []model.Instance, err error, errCode int)
ReadInstance(id string, jwt jwt.Token, forUser string) (result model.Instance, err error, errCode int)
ReadInstanceContext(ctx context.Context, id string, jwt jwt.Token, forUser string) (result model.Instance, err error, errCode int)
CreateInstance(instance model.Instance, jwt jwt.Token) (result model.Instance, err error, code int)
CreateInstanceContext(ctx context.Context, instance model.Instance, jwt jwt.Token) (result model.Instance, err error, code int)
SetInstance(importType model.Instance, jwt jwt.Token) (err error, code int)
SetInstanceContext(ctx context.Context, importType model.Instance, jwt jwt.Token) (err error, code int)
DeleteInstance(id string, jwt jwt.Token, forUser string) (err error, errCode int)
DeleteInstanceContext(ctx context.Context, id string, jwt jwt.Token, forUser string) (err error, errCode int)
CountInstances(jwt jwt.Token, search string, includeGenerated bool) (count int64, err error, errCode int)
CountInstancesContext(ctx context.Context, jwt jwt.Token, search string, includeGenerated bool) (count int64, err error, errCode int)
}
Click to show internal directories.
Click to hide internal directories.