order

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const APIName = "ivcap"

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

View Source
const APIVersion = "0.32"

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

View Source
const ServiceName = "order"

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{"read", "list", "create", "logs", "top"}

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 NewCreateEndpoint

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

NewCreateEndpoint returns an endpoint function that calls the method "create" of service "order".

func NewListEndpoint

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

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

func NewLogsEndpoint

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

NewLogsEndpoint returns an endpoint function that calls the method "logs" of service "order".

func NewReadEndpoint

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

NewReadEndpoint returns an endpoint function that calls the method "read" of service "order".

func NewTopEndpoint

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

NewTopEndpoint returns an endpoint function that calls the method "top" of service "order".

func NewViewedOrderListRT

func NewViewedOrderListRT(res *OrderListRT, view string) *orderviews.OrderListRT

NewViewedOrderListRT initializes viewed result type OrderListRT from result type OrderListRT using the given view.

func NewViewedOrderTopResultItemCollection

func NewViewedOrderTopResultItemCollection(res OrderTopResultItemCollection, view string) orderviews.OrderTopResultItemCollection

NewViewedOrderTopResultItemCollection initializes viewed result type OrderTopResultItemCollection from result type OrderTopResultItemCollection using the given view.

Types

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 BadRequestT

type BadRequestT struct {
	// Information message
	Message string
}

Bad arguments supplied.

func (*BadRequestT) Error

func (e *BadRequestT) Error() string

Error returns an error description.

func (*BadRequestT) ErrorName deprecated

func (e *BadRequestT) ErrorName() string

ErrorName returns "BadRequestT".

Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105

func (*BadRequestT) GoaErrorName

func (e *BadRequestT) GoaErrorName() string

GoaErrorName returns "BadRequestT".

type CreatePayload

type CreatePayload struct {
	// New orders description
	Orders *OrderRequestT
	// JWT used for authentication
	JWT string
}

CreatePayload is the payload type of the order service create method.

type Endpoints

type Endpoints struct {
	Read   goa.Endpoint
	List   goa.Endpoint
	Create goa.Endpoint
	Logs   goa.Endpoint
	Top    goa.Endpoint
}

Endpoints wraps the "order" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

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

func (*Endpoints) Use

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

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

type InvalidCredentialsT

type InvalidCredentialsT struct {
}

Provided credential is not valid.

func (*InvalidCredentialsT) Error

func (e *InvalidCredentialsT) Error() string

Error returns an error description.

func (*InvalidCredentialsT) ErrorName deprecated

func (e *InvalidCredentialsT) ErrorName() string

ErrorName returns "InvalidCredentialsT".

Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105

func (*InvalidCredentialsT) GoaErrorName

func (e *InvalidCredentialsT) GoaErrorName() string

GoaErrorName returns "InvalidCredentialsT".

type InvalidParameterValue

type InvalidParameterValue struct {
	// message describing expected type or pattern.
	Message string
	// name of parameter.
	Name string
	// provided parameter value.
	Value *string
}

InvalidParameterValue is the error returned when a parameter has the wrong value.

func (*InvalidParameterValue) Error

func (e *InvalidParameterValue) Error() string

Error returns an error description.

func (*InvalidParameterValue) ErrorName deprecated

func (e *InvalidParameterValue) ErrorName() string

ErrorName returns "InvalidParameterValue".

Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105

func (*InvalidParameterValue) GoaErrorName

func (e *InvalidParameterValue) GoaErrorName() string

GoaErrorName returns "InvalidParameterValue".

type InvalidScopesT

type InvalidScopesT struct {
	// ID of involved resource
	ID *string
	// Message of error
	Message string
}

Caller not authorized to access required scope.

func (*InvalidScopesT) Error

func (e *InvalidScopesT) Error() string

Error returns an error description.

func (*InvalidScopesT) ErrorName deprecated

func (e *InvalidScopesT) ErrorName() string

ErrorName returns "InvalidScopesT".

Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105

func (*InvalidScopesT) GoaErrorName

func (e *InvalidScopesT) GoaErrorName() string

GoaErrorName returns "InvalidScopesT".

type LinkT added in v0.30.0

type LinkT struct {
	// relation type
	Rel string
	// mime type
	Type string
	// web link
	Href string
}

type ListPayload

type ListPayload struct {
	// The $limit system query option requests the number of items in the queried
	// collection to be included in the result.
	Limit int
	// The 'filter' system query option allows clients to filter a collection of
	// resources that are addressed by a request URL. The expression specified with
	// 'filter'
	// is evaluated for each resource in the collection, and only items where the
	// expression
	// evaluates to true are included in the response.
	Filter *string
	// The 'orderby' query option allows clients to request resources in either
	// ascending order using asc or descending order using desc. If asc or desc not
	// specified,
	// then the resources will be ordered in ascending order. The request below
	// orders Trips on
	// property EndsAt in descending order.
	OrderBy *string
	// When set order result in descending order. Ascending order is the lt.
	OrderDesc bool
	// Return the state of the respective resources at that time [now]
	AtTime *string
	// The content of 'page' is returned in the 'links' part of a previous query and
	// will when set, ALL other parameters, except for 'limit' are ignored.
	Page *string
	// JWT used for authentication
	JWT string
}

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

type LogsPayload

type LogsPayload struct {
	// From unix time, seconds since 1970-01-01
	From *int64
	// To unix time, seconds since 1970-01-01
	To *int64
	// Reference to order requested
	OrderID string
	// JWT used for authentication
	JWT string
}

LogsPayload is the payload type of the order service logs method.

type LogsResponseData

type LogsResponseData struct {
	// Body streams the HTTP response body.
	Body io.ReadCloser
}

LogsResponseData holds both the result and the HTTP response body reader of the "logs" method.

type NotImplementedT

type NotImplementedT struct {
	// Information message
	Message string
}

Method is not yet implemented.

func (*NotImplementedT) Error

func (e *NotImplementedT) Error() string

Error returns an error description.

func (*NotImplementedT) ErrorName deprecated

func (e *NotImplementedT) ErrorName() string

ErrorName returns "NotImplementedT".

Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105

func (*NotImplementedT) GoaErrorName

func (e *NotImplementedT) GoaErrorName() string

GoaErrorName returns "NotImplementedT".

type OrderListItem

type OrderListItem struct {
	// ID
	ID string
	// Optional customer provided name
	Name *string
	// Order status
	Status string
	// DateTime order was placed
	OrderedAt *string
	// DateTime order processing started
	StartedAt *string
	// DateTime order processing finished
	FinishedAt *string
	// Reference to service requested
	Service string `json:"service"`
	// Reference to billable account
	Account string `json:"account"`
	Href    string `json:"href,omitempty"`
}

type OrderListRT

type OrderListRT struct {
	// Orders
	Items []*OrderListItem
	// Time at which this list was valid
	AtTime string
	Links  []*LinkT
}

OrderListRT is the result type of the order service list method.

func NewOrderListRT

func NewOrderListRT(vres *orderviews.OrderListRT) *OrderListRT

NewOrderListRT initializes result type OrderListRT from viewed result type OrderListRT.

type OrderRequestT

type OrderRequestT struct {
	// Reference to service requested
	Service string `json:"service"`
	// Reference to policy used
	Policy *string `json:"policy"`
	// Optional customer provided name
	Name *string
	// Optional customer provided tags
	Tags []string
	// Service parameters
	Parameters []*ParameterT
}

type OrderStatusRT

type OrderStatusRT struct {
	// ID
	ID string
	// Order status
	Status string
	// DateTime order was placed
	OrderedAt *string
	// DateTime order processing started
	StartedAt *string
	// DateTime order processing finished
	FinishedAt *string
	Products   *PartialProductListT
	// Reference to service requested
	Service string `json:"service"`
	// Reference to billable account
	Account string `json:"account"`
	Links   []*LinkT
	// Optional customer provided name
	Name *string
	// Optional customer provided tags
	Tags []string
	// Service parameters
	Parameters []*ParameterT
}

OrderStatusRT is the result type of the order service read method.

type OrderTopResultItem

type OrderTopResultItem struct {
	// container
	Container string
	// cpu
	CPU string
	// memory
	Memory string
	// storage
	Storage string
	// ephemeral-storage
	EphemeralStorage string
}

type OrderTopResultItemCollection

type OrderTopResultItemCollection []*OrderTopResultItem

OrderTopResultItemCollection is the result type of the order service top method.

func NewOrderTopResultItemCollection

func NewOrderTopResultItemCollection(vres orderviews.OrderTopResultItemCollection) OrderTopResultItemCollection

NewOrderTopResultItemCollection initializes result type OrderTopResultItemCollection from viewed result type OrderTopResultItemCollection.

type ParameterT

type ParameterT struct {
	Name  *string
	Value *string
}

type PartialProductListT added in v0.30.0

type PartialProductListT struct {
	// (Partial) list of products delivered by this order
	Items []*ProductListItemT
	// Links to more products, if there are any
	Links []*LinkT
}

type ProductListItemT added in v0.30.0

type ProductListItemT struct {
	ID       string
	Name     *string
	Status   string
	MimeType *string `json:"mime-type,omitempty"`
	Size     *int64
	Href     string  `json:"href,omitempty"`
	DataHref *string `json:"dataRef,omitempty"`
}

type ReadPayload

type ReadPayload struct {
	// ID of orders to show
	ID string
	// JWT used for authentication
	JWT string
}

ReadPayload is the payload type of the order service read method.

type ResourceNotFoundT

type ResourceNotFoundT struct {
	// ID of missing resource
	ID string
	// Message of error
	Message string
}

NotFound is the type returned when attempting to manage a resource that does not exist.

func (*ResourceNotFoundT) Error

func (e *ResourceNotFoundT) Error() string

Error returns an error description.

func (*ResourceNotFoundT) ErrorName deprecated

func (e *ResourceNotFoundT) ErrorName() string

ErrorName returns "ResourceNotFoundT".

Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105

func (*ResourceNotFoundT) GoaErrorName

func (e *ResourceNotFoundT) GoaErrorName() string

GoaErrorName returns "ResourceNotFoundT".

type Service

type Service interface {
	// Show orders by ID
	Read(context.Context, *ReadPayload) (res *OrderStatusRT, err error)
	// list orders
	List(context.Context, *ListPayload) (res *OrderListRT, err error)
	// Create a new orders and return its status.
	Create(context.Context, *CreatePayload) (res *OrderStatusRT, err error)
	// download order logs
	Logs(context.Context, *LogsPayload) (body io.ReadCloser, err error)
	// top order resources
	Top(context.Context, *TopPayload) (res OrderTopResultItemCollection, err error)
}

Manage the life cycle of an order for CRE services.

type ServiceNotAvailableT

type ServiceNotAvailableT struct {
}

ServiceNotAvailable is the type returned when the service necessary to fulfil the request is currently not available.

func (*ServiceNotAvailableT) Error

func (e *ServiceNotAvailableT) Error() string

Error returns an error description.

func (*ServiceNotAvailableT) ErrorName deprecated

func (e *ServiceNotAvailableT) ErrorName() string

ErrorName returns "ServiceNotAvailableT".

Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105

func (*ServiceNotAvailableT) GoaErrorName

func (e *ServiceNotAvailableT) GoaErrorName() string

GoaErrorName returns "ServiceNotAvailableT".

type TopPayload

type TopPayload struct {
	// Reference to order requested
	OrderID string
	// JWT used for authentication
	JWT string
}

TopPayload is the payload type of the order service top method.

type UnauthorizedT

type UnauthorizedT struct {
}

Unauthorized access to resource

func (*UnauthorizedT) Error

func (e *UnauthorizedT) Error() string

Error returns an error description.

func (*UnauthorizedT) ErrorName deprecated

func (e *UnauthorizedT) ErrorName() string

ErrorName returns "UnauthorizedT".

Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105

func (*UnauthorizedT) GoaErrorName

func (e *UnauthorizedT) GoaErrorName() string

GoaErrorName returns "UnauthorizedT".

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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