firmware

package
v0.0.0-...-b9360c4 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceName = "firmware"

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 = [4]string{"download", "add", "list", "delete"}

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 MakeBadRequest

func MakeBadRequest(err error) *goa.ServiceError

MakeBadRequest builds a goa.ServiceError from an error.

func MakeForbidden

func MakeForbidden(err error) *goa.ServiceError

MakeForbidden builds a goa.ServiceError from an error.

func MakeNotFound

func MakeNotFound(err error) *goa.ServiceError

MakeNotFound builds a goa.ServiceError from an error.

func MakeUnauthorized

func MakeUnauthorized(err error) *goa.ServiceError

MakeUnauthorized builds a goa.ServiceError from an error.

func NewAddEndpoint

func NewAddEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint

NewAddEndpoint returns an endpoint function that calls the method "add" of service "firmware".

func NewDeleteEndpoint

func NewDeleteEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint

NewDeleteEndpoint returns an endpoint function that calls the method "delete" of service "firmware".

func NewDownloadEndpoint

func NewDownloadEndpoint(s Service) goa.Endpoint

NewDownloadEndpoint returns an endpoint function that calls the method "download" of service "firmware".

func NewListEndpoint

func NewListEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint

NewListEndpoint returns an endpoint function that calls the method "list" of service "firmware".

func NewViewedFirmwares

func NewViewedFirmwares(res *Firmwares, view string) *firmwareviews.Firmwares

NewViewedFirmwares initializes viewed result type Firmwares from result type Firmwares using the given view.

Types

type AddFirmwarePayload

type AddFirmwarePayload struct {
	Etag           string
	Module         string
	Profile        string
	Version        string
	URL            string
	Meta           string
	LogicalAddress *int64
}

type AddPayload

type AddPayload struct {
	Auth     *string
	Firmware *AddFirmwarePayload
}

AddPayload is the payload type of the firmware service add method.

type Auther

type Auther interface {
	// JWTAuth implements the authorization logic for the JWT security scheme.
	JWTAuth(ctx context.Context, token string, schema *security.JWTScheme) (context.Context, error)
}

Auther defines the authorization functions to be implemented by the service.

type Client

type Client struct {
	DownloadEndpoint goa.Endpoint
	AddEndpoint      goa.Endpoint
	ListEndpoint     goa.Endpoint
	DeleteEndpoint   goa.Endpoint
}

Client is the "firmware" service client.

func NewClient

func NewClient(download, add, list, delete_ goa.Endpoint) *Client

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

func (*Client) Add

func (c *Client) Add(ctx context.Context, p *AddPayload) (err error)

Add calls the "add" endpoint of the "firmware" service.

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, p *DeletePayload) (err error)

Delete calls the "delete" endpoint of the "firmware" service.

func (*Client) Download

func (c *Client) Download(ctx context.Context, p *DownloadPayload) (res *DownloadResult, resp io.ReadCloser, err error)

Download calls the "download" endpoint of the "firmware" service.

func (*Client) List

func (c *Client) List(ctx context.Context, p *ListPayload) (res *Firmwares, err error)

List calls the "list" endpoint of the "firmware" service.

type DeletePayload

type DeletePayload struct {
	Auth       *string
	FirmwareID int32
}

DeletePayload is the payload type of the firmware service delete method.

type DownloadPayload

type DownloadPayload struct {
	FirmwareID int32
}

DownloadPayload is the payload type of the firmware service download method.

type DownloadResponseData

type DownloadResponseData struct {
	// Result is the method result.
	Result *DownloadResult
	// Body streams the HTTP response body.
	Body io.ReadCloser
}

DownloadResponseData holds both the result and the HTTP response body reader of the "download" method.

type DownloadResult

type DownloadResult struct {
	Length      int64
	ContentType string
}

DownloadResult is the result type of the firmware service download method.

type Endpoints

type Endpoints struct {
	Download goa.Endpoint
	Add      goa.Endpoint
	List     goa.Endpoint
	Delete   goa.Endpoint
}

Endpoints wraps the "firmware" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

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

func (*Endpoints) Use

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

Use applies the given middleware to all the "firmware" service endpoints.

type FirmwareSummary

type FirmwareSummary struct {
	ID             int32
	Time           string
	Etag           string
	Module         string
	Profile        string
	Version        *string
	URL            string
	Meta           map[string]interface{}
	BuildNumber    int32
	BuildTime      int64
	LogicalAddress *int64
}

type FirmwareSummaryCollection

type FirmwareSummaryCollection []*FirmwareSummary

type Firmwares

type Firmwares struct {
	Firmwares FirmwareSummaryCollection
}

Firmwares is the result type of the firmware service list method.

func NewFirmwares

func NewFirmwares(vres *firmwareviews.Firmwares) *Firmwares

NewFirmwares initializes result type Firmwares from viewed result type Firmwares.

type ListPayload

type ListPayload struct {
	Auth     *string
	Module   *string
	Profile  *string
	PageSize *int32
	Page     *int32
}

ListPayload is the payload type of the firmware service list method.

type Service

type Service interface {
	// Download implements download.
	Download(context.Context, *DownloadPayload) (res *DownloadResult, body io.ReadCloser, err error)
	// Add implements add.
	Add(context.Context, *AddPayload) (err error)
	// List implements list.
	List(context.Context, *ListPayload) (res *Firmwares, err error)
	// Delete implements delete.
	Delete(context.Context, *DeletePayload) (err error)
}

Service is the firmware service interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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