Documentation ¶
Index ¶
- type Client
- func (c *Client) Acquire(rtype, state, dest string) (*common.Resource, error)
- func (c *Client) AcquireByState(state, dest string, names []string) ([]common.Resource, error)
- func (c *Client) HasResource() bool
- func (c *Client) Metric(rtype string) (common.Metric, error)
- func (c *Client) ReleaseAll(dest string) error
- func (c *Client) ReleaseOne(name, dest string) error
- func (c *Client) Reset(rtype, state string, expire time.Duration, dest string) (map[string]string, error)
- func (c *Client) SyncAll() error
- func (c *Client) UpdateAll(state string) error
- func (c *Client) UpdateOne(name, state string, userData *common.UserData) 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 defines the public Boskos client object
func (*Client) Acquire ¶
Acquire asks boskos for a resource of certain type in certain state, and set the resource to dest state. Returns the resource on success.
func (*Client) AcquireByState ¶
AcquireByState asks boskos for a resources of certain type, and set the resource to dest state. Returns a list of resources on success.
func (*Client) HasResource ¶
HasResource tells if current client holds any resources
func (*Client) Metric ¶
Metric will query current metric for target resource type. Return a common.Metric object on success.
func (*Client) ReleaseAll ¶
ReleaseAll returns all resources hold by the client back to boskos and set them to dest state.
func (*Client) ReleaseOne ¶
ReleaseOne returns one of owned resources back to boskos and set it to dest state.
func (*Client) Reset ¶
func (c *Client) Reset(rtype, state string, expire time.Duration, dest string) (map[string]string, error)
Reset will scan all boskos resources of type, in state, last updated before expire, and set them to dest state. Returns a map of {resourceName:owner} for further actions.