Documentation ¶
Index ¶
- Constants
- Variables
- func MakeRecordNotFound(err error) *goa.ServiceError
- func NewAddEndpoint(s Service) goa.Endpoint
- func NewCompleteEndpoint(s Service) goa.Endpoint
- func NewEnqueueEndpoint(s Service) goa.Endpoint
- func NewNewEndpoint(s Service) goa.Endpoint
- func NewNextEndpoint(s Service) goa.Endpoint
- func NewStatusEndpoint(s Service) goa.Endpoint
- type AddPayload
- type Client
- func (c *Client) Add(ctx context.Context, p *AddPayload) (res string, err error)
- func (c *Client) Complete(ctx context.Context, p *CompletePayload) (err error)
- func (c *Client) Enqueue(ctx context.Context, p *EnqueuePayload) (res []string, err error)
- func (c *Client) New(ctx context.Context) (res string, err error)
- func (c *Client) Next(ctx context.Context, p *NextPayload) (res *NextResult, err error)
- func (c *Client) Status(ctx context.Context, p *StatusPayload) (res *StatusResult, err error)
- type CompletePayload
- type Endpoints
- type EnqueuePayload
- type NextPayload
- type NextResult
- type Service
- type StatusPayload
- type StatusResult
Constants ¶
const ServiceName = "spin-broker"
ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.
Variables ¶
var MethodNames = [6]string{"new", "add", "enqueue", "status", "next", "complete"}
MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.
Functions ¶
func MakeRecordNotFound ¶
func MakeRecordNotFound(err error) *goa.ServiceError
MakeRecordNotFound builds a goa.ServiceError from an error.
func NewAddEndpoint ¶
NewAddEndpoint returns an endpoint function that calls the method "add" of service "spin-broker".
func NewCompleteEndpoint ¶
NewCompleteEndpoint returns an endpoint function that calls the method "complete" of service "spin-broker".
func NewEnqueueEndpoint ¶
NewEnqueueEndpoint returns an endpoint function that calls the method "enqueue" of service "spin-broker".
func NewNewEndpoint ¶
NewNewEndpoint returns an endpoint function that calls the method "new" of service "spin-broker".
func NewNextEndpoint ¶
NewNextEndpoint returns an endpoint function that calls the method "next" of service "spin-broker".
func NewStatusEndpoint ¶
NewStatusEndpoint returns an endpoint function that calls the method "status" of service "spin-broker".
Types ¶
type AddPayload ¶
type AddPayload struct { // Package ID ID string // Resource name Resource string // Action name Action string // Action parameters Parameters map[string]interface{} // Dependency UUIDs Dependencies []string }
AddPayload is the payload type of the spin-broker service add method.
type Client ¶
type Client struct { NewEndpoint goa.Endpoint AddEndpoint goa.Endpoint EnqueueEndpoint goa.Endpoint StatusEndpoint goa.Endpoint NextEndpoint goa.Endpoint CompleteEndpoint goa.Endpoint }
Client is the "spin-broker" service client.
func (*Client) Complete ¶
func (c *Client) Complete(ctx context.Context, p *CompletePayload) (err error)
Complete calls the "complete" endpoint of the "spin-broker" service.
func (*Client) Next ¶
func (c *Client) Next(ctx context.Context, p *NextPayload) (res *NextResult, err error)
Next calls the "next" endpoint of the "spin-broker" service. Next may return the following errors:
- "record_not_found" (type *goa.ServiceError)
- error: internal error
func (*Client) Status ¶
func (c *Client) Status(ctx context.Context, p *StatusPayload) (res *StatusResult, err error)
Status calls the "status" endpoint of the "spin-broker" service. Status may return the following errors:
- "record_not_found" (type *goa.ServiceError)
- error: internal error
type CompletePayload ¶
type CompletePayload struct { // Command ID ID string // status of work Status bool // reason of success/failure StatusReason *string }
CompletePayload is the payload type of the spin-broker service complete method.
type Endpoints ¶
type Endpoints struct { New goa.Endpoint Add goa.Endpoint Enqueue goa.Endpoint Status goa.Endpoint Next goa.Endpoint Complete goa.Endpoint }
Endpoints wraps the "spin-broker" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "spin-broker" service with endpoints.
type EnqueuePayload ¶
type EnqueuePayload struct { // Package ID ID string }
EnqueuePayload is the payload type of the spin-broker service enqueue method.
type NextPayload ¶
type NextPayload struct { // resource type Resource string }
NextPayload is the payload type of the spin-broker service next method.
type NextResult ¶
type NextResult struct { // Command ID UUID string // resource type Resource string // action name Action string // Action parameters Parameters map[string]json.RawMessage }
NextResult is the result type of the spin-broker service next method.
type Service ¶
type Service interface { // Create a new package; a collection of items to join into the queue // simultaneously New(context.Context) (res string, err error) // Add a command to the package Add(context.Context, *AddPayload) (res string, err error) // Enqueue the package into the various resource queues Enqueue(context.Context, *EnqueuePayload) (res []string, err error) // Get the status for a package Status(context.Context, *StatusPayload) (res *StatusResult, err error) // Get the next command for a given resource Next(context.Context, *NextPayload) (res *NextResult, err error) // Mark a command as completed with a result status Complete(context.Context, *CompletePayload) (err error) }
The message broker for the other services
type StatusPayload ¶
type StatusPayload struct { // Package ID ID string }
StatusPayload is the payload type of the spin-broker service status method.
type StatusResult ¶
type StatusResult struct { // Pass/Fail status Status bool // Failure reason (if any) Reason *string // Failure causer as UUID (if any) Causer *string }
StatusResult is the result type of the spin-broker service status method.