Documentation ¶
Index ¶
- type Client
- func (c *Client) Add(ctx context.Context, p *spinbroker.AddPayload) (string, error)
- func (c *Client) Complete(ctx context.Context, uuid string, status bool, reason *string) error
- func (c *Client) Enqueue(ctx context.Context, uuid string) ([]string, error)
- func (c *Client) New(ctx context.Context) (string, error)
- func (c *Client) Next(ctx context.Context, resource string) (*spinbroker.NextResult, error)
- func (c *Client) Status(ctx context.Context, uuid string) (*spinbroker.StatusResult, error)
- type Config
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 is the outer handle for the broker HTTP client.
func (*Client) Add ¶
func (c *Client) Add(ctx context.Context, p *spinbroker.AddPayload) (string, error)
Add adds a command to the package. The ID here is the package UUID, not the one of the command. The UUID of the newly added command will be returned as a part of this call.
func (*Client) Complete ¶
Complete completes a command, with the UUID being that of the command, the status being a pass/fail and the reason provided if the status failed.
func (*Client) Next ¶
func (c *Client) Next(ctx context.Context, resource string) (*spinbroker.NextResult, error)
Next returns the next item in the queue by resource. If there are no items, broker.ErrRecordNotFound will be returned.
func (*Client) Status ¶
func (c *Client) Status(ctx context.Context, uuid string) (*spinbroker.StatusResult, error)
Status checks the status of a package by UUID. It returns a StatusResult on a successful fetch, which may contain a failed value. If the status is failed, the StatusReason may have further information.