Documentation ¶
Index ¶
- Constants
- Variables
- func MakeNotFound(err error) *goa.ServiceError
- func NewAvailableEndpoint(s Service) goa.Endpoint
- func NewInstallEndpoint(s Service) goa.Endpoint
- func NewInstalledEndpoint(s Service) goa.Endpoint
- func NewInstalledheadEndpoint(s Service) goa.Endpoint
- func NewRemoveEndpoint(s Service) goa.Endpoint
- func NewViewedOperation(res *Operation, view string) *toolsviews.Operation
- func NewViewedToolCollection(res ToolCollection, view string) toolsviews.ToolCollection
- type Client
- func (c *Client) Available(ctx context.Context) (res ToolCollection, err error)
- func (c *Client) Install(ctx context.Context, p *ToolPayload) (res *Operation, err error)
- func (c *Client) Installed(ctx context.Context) (res ToolCollection, err error)
- func (c *Client) Installedhead(ctx context.Context) (err error)
- func (c *Client) Remove(ctx context.Context, p *ToolPayload) (res *Operation, err error)
- type Endpoints
- type Operation
- type Service
- type Tool
- type ToolCollection
- type ToolPayload
Constants ¶
const APIName = "arduino-create-agent"
APIName is the name of the API as defined in the design.
const APIVersion = "0.0.1"
APIVersion is the version of the API as defined in the design.
const ServiceName = "tools"
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 = [5]string{"available", "installedhead", "installed", "install", "remove"}
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 MakeNotFound ¶
func MakeNotFound(err error) *goa.ServiceError
MakeNotFound builds a goa.ServiceError from an error.
func NewAvailableEndpoint ¶
NewAvailableEndpoint returns an endpoint function that calls the method "available" of service "tools".
func NewInstallEndpoint ¶
NewInstallEndpoint returns an endpoint function that calls the method "install" of service "tools".
func NewInstalledEndpoint ¶
NewInstalledEndpoint returns an endpoint function that calls the method "installed" of service "tools".
func NewInstalledheadEndpoint ¶
NewInstalledheadEndpoint returns an endpoint function that calls the method "installedhead" of service "tools".
func NewRemoveEndpoint ¶
NewRemoveEndpoint returns an endpoint function that calls the method "remove" of service "tools".
func NewViewedOperation ¶
func NewViewedOperation(res *Operation, view string) *toolsviews.Operation
NewViewedOperation initializes viewed result type Operation from result type Operation using the given view.
func NewViewedToolCollection ¶
func NewViewedToolCollection(res ToolCollection, view string) toolsviews.ToolCollection
NewViewedToolCollection initializes viewed result type ToolCollection from result type ToolCollection using the given view.
Types ¶
type Client ¶
type Client struct { AvailableEndpoint goa.Endpoint InstalledheadEndpoint goa.Endpoint InstalledEndpoint goa.Endpoint InstallEndpoint goa.Endpoint RemoveEndpoint goa.Endpoint }
Client is the "tools" service client.
func (*Client) Available ¶
func (c *Client) Available(ctx context.Context) (res ToolCollection, err error)
Available calls the "available" endpoint of the "tools" service.
func (*Client) Install ¶
Install calls the "install" endpoint of the "tools" service. Install may return the following errors:
- "not_found" (type *goa.ServiceError): tool not found
- error: internal error
func (*Client) Installed ¶
func (c *Client) Installed(ctx context.Context) (res ToolCollection, err error)
Installed calls the "installed" endpoint of the "tools" service.
func (*Client) Installedhead ¶
Installedhead calls the "installedhead" endpoint of the "tools" service.
type Endpoints ¶
type Endpoints struct { Available goa.Endpoint Installedhead goa.Endpoint Installed goa.Endpoint Install goa.Endpoint Remove goa.Endpoint }
Endpoints wraps the "tools" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "tools" service with endpoints.
type Operation ¶
type Operation struct { // The status of the operation Status string }
Operation is the result type of the tools service install method.
func NewOperation ¶
func NewOperation(vres *toolsviews.Operation) *Operation
NewOperation initializes result type Operation from viewed result type Operation.
type Service ¶
type Service interface { // Available implements available. Available(context.Context) (res ToolCollection, err error) // Installedhead implements installedhead. Installedhead(context.Context) (err error) // Installed implements installed. Installed(context.Context) (res ToolCollection, err error) // Install implements install. Install(context.Context, *ToolPayload) (res *Operation, err error) // Remove implements remove. Remove(context.Context, *ToolPayload) (res *Operation, err error) }
The tools service manages the available and installed tools
type Tool ¶
type Tool struct { // The name of the tool Name string // The version of the tool Version string // The packager of the tool Packager string }
A tool is an executable program that can upload sketches.
type ToolCollection ¶
type ToolCollection []*Tool
ToolCollection is the result type of the tools service available method.
func NewToolCollection ¶
func NewToolCollection(vres toolsviews.ToolCollection) ToolCollection
NewToolCollection initializes result type ToolCollection from viewed result type ToolCollection.
type ToolPayload ¶
type ToolPayload struct { // The name of the tool Name string // The version of the tool Version string // The packager of the tool Packager string // The url where the package can be found. Optional. // If present checksum must also be present. URL *string // A checksum of the archive. Mandatory when url is present. // This ensures that the package is downloaded correcly. Checksum *string // The signature used to sign the url. Mandatory when url is present. // This ensure the security of the file downloaded Signature *string }
ToolPayload is the payload type of the tools service install method.