tools

package
v0.0.0-...-d36d0e1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2024 License: AGPL-3.0 Imports: 3 Imported by: 8

Documentation

Index

Constants

View Source
const APIName = "arduino-create-agent"

APIName is the name of the API as defined in the design.

View Source
const APIVersion = "0.0.1"

APIVersion is the version of the API as defined in the design.

View Source
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

View Source
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

func NewAvailableEndpoint(s Service) goa.Endpoint

NewAvailableEndpoint returns an endpoint function that calls the method "available" of service "tools".

func NewInstallEndpoint

func NewInstallEndpoint(s Service) goa.Endpoint

NewInstallEndpoint returns an endpoint function that calls the method "install" of service "tools".

func NewInstalledEndpoint

func NewInstalledEndpoint(s Service) goa.Endpoint

NewInstalledEndpoint returns an endpoint function that calls the method "installed" of service "tools".

func NewInstalledheadEndpoint

func NewInstalledheadEndpoint(s Service) goa.Endpoint

NewInstalledheadEndpoint returns an endpoint function that calls the method "installedhead" of service "tools".

func NewRemoveEndpoint

func NewRemoveEndpoint(s Service) goa.Endpoint

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 NewClient

func NewClient(available, installedhead, installed, install, remove goa.Endpoint) *Client

NewClient initializes a "tools" service client given the endpoints.

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

func (c *Client) Install(ctx context.Context, p *ToolPayload) (res *Operation, err error)

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

func (c *Client) Installedhead(ctx context.Context) (err error)

Installedhead calls the "installedhead" endpoint of the "tools" service.

func (*Client) Remove

func (c *Client) Remove(ctx context.Context, p *ToolPayload) (res *Operation, err error)

Remove calls the "remove" 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

func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "tools" service with endpoints.

func (*Endpoints) Use

func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint)

Use applies the given middleware to all the "tools" service 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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL