Documentation
¶
Index ¶
- Constants
- Variables
- func NewViewedOrderListRT(res *OrderListRT, view string) *serviceviews.OrderListRT
- func NewViewedServiceListRT(res *ServiceListRT, view string) *serviceviews.ServiceListRT
- func NewViewedServiceStatusRT(res *ServiceStatusRT, view string) *serviceviews.ServiceStatusRT
- type Auther
- type BadRequestT
- type BasicWorkflowOptsT
- type CreatePayload
- type DeletePayload
- type DescribedByT
- type InvalidCredentialsT
- type InvalidParameterValue
- type InvalidScopesT
- type ListOrdersPayload
- type ListPayload
- type NavT
- type NotImplementedT
- type OrderListItem
- type OrderListRT
- type ParameterDefT
- type ParameterOptT
- type ParameterT
- type ReadPayload
- type RefT
- type ReferenceT
- type ResourceAlreadyCreatedT
- type ResourceMemoryT
- type ResourceNotFoundT
- type SelfT
- type Service
- type ServiceDescriptionT
- type ServiceListItem
- type ServiceListRT
- type ServiceStatusRT
- type UnauthorizedT
- type UpdatePayload
- type WorkflowT
Constants ¶
const ServiceName = "service"
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{"list", "create", "read", "update", "delete", "listOrders"}
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 NewViewedOrderListRT ¶
func NewViewedOrderListRT(res *OrderListRT, view string) *serviceviews.OrderListRT
NewViewedOrderListRT initializes viewed result type OrderListRT from result type OrderListRT using the given view.
func NewViewedServiceListRT ¶
func NewViewedServiceListRT(res *ServiceListRT, view string) *serviceviews.ServiceListRT
NewViewedServiceListRT initializes viewed result type ServiceListRT from result type ServiceListRT using the given view.
func NewViewedServiceStatusRT ¶
func NewViewedServiceStatusRT(res *ServiceStatusRT, view string) *serviceviews.ServiceStatusRT
NewViewedServiceStatusRT initializes viewed result type ServiceStatusRT from result type ServiceStatusRT 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 BasicWorkflowOptsT ¶
type BasicWorkflowOptsT struct { // container image name Image *string // Command to start the container - needed for some container runtimes Command []string // Defines memory resource requests and limits Memory *ResourceMemoryT // Defines cpu resource requests and limits // (see // https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu) CPU *ResourceMemoryT }
type CreatePayload ¶
type CreatePayload struct { // New services description Services *ServiceDescriptionT // JWT used for authentication JWT string }
CreatePayload is the payload type of the service service create method.
type DeletePayload ¶
type DeletePayload struct { // ID of services to update ID string // JWT used for authentication JWT string }
DeletePayload is the payload type of the service service delete method.
type DescribedByT ¶
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 ListOrdersPayload ¶
type ListOrdersPayload struct { // ID of services to show ID string // JWT used for authentication JWT string }
ListOrdersPayload is the payload type of the service service listOrders method.
type ListPayload ¶
type ListPayload struct { // 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 // The $top system query option requests the number of items in the queried // collection to be included in the result. Top int // The $skip query option requests the number of items in the queried collection // that are to be skipped and not included in the result. Skip int // The $select system query option allows the clients to requests a limited set // of properties for each entity or complex type. The example returns Name and // IcaoCode // of all Airports. Select string // DEPRECATED: List offset. Use '$skip' instead Offset *int // DEPRECATED: Max. number of records to return. Use '$top' instead Limit *int // DEPRECATED: Page token PageToken string }
ListPayload is the payload type of the service service list 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 { // Order ID ID *string // Optional customer provided name Name *string // Order status Status *string // DateTime order was placed OrderedAt *string // DateTime processing of order started StartedAt *string // DateTime order was finished FinishedAt *string // ID of ordered service ServiceID *string // ID of ordered service AccountID *string Links *SelfT }
type OrderListRT ¶
type OrderListRT struct { // Orders Orders []*OrderListItem // Navigation links Links *NavT }
OrderListRT is the result type of the service service listOrders method.
func NewOrderListRT ¶
func NewOrderListRT(vres *serviceviews.OrderListRT) *OrderListRT
NewOrderListRT initializes result type OrderListRT from viewed result type OrderListRT.
type ParameterDefT ¶
type ParameterOptT ¶
type ParameterT ¶
type ReadPayload ¶
type ReadPayload struct { // ID of services to show ID string }
ReadPayload is the payload type of the service service read method.
type ReferenceT ¶
type ResourceAlreadyCreatedT ¶
type ResourceAlreadyCreatedT struct { // ID of already existing resource ID string // Message of error Message string }
Will be returned when receiving a request to create and already existing resource.
func (*ResourceAlreadyCreatedT) Error ¶
func (e *ResourceAlreadyCreatedT) Error() string
Error returns an error description.
func (*ResourceAlreadyCreatedT) ErrorName
deprecated
func (e *ResourceAlreadyCreatedT) ErrorName() string
ErrorName returns "ResourceAlreadyCreatedT".
Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105
func (*ResourceAlreadyCreatedT) GoaErrorName ¶
func (e *ResourceAlreadyCreatedT) GoaErrorName() string
GoaErrorName returns "ResourceAlreadyCreatedT".
type ResourceMemoryT ¶
type ResourceMemoryT struct { // minimal requirements [0] Request *string // minimal requirements [system limit] Limit *string }
See and https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/quantity/ for units
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 SelfT ¶
type SelfT struct { Self *string DescribedBy *DescribedByT }
type Service ¶
type Service interface { // services List(context.Context, *ListPayload) (res *ServiceListRT, err error) // Create a new services and return its status. // The "view" return value must have one of the following views // - "default" // - "tiny" Create(context.Context, *CreatePayload) (res *ServiceStatusRT, view string, err error) // Show services by ID // The "view" return value must have one of the following views // - "default" // - "tiny" Read(context.Context, *ReadPayload) (res *ServiceStatusRT, view string, err error) // Update an existing services and return its status. // The "view" return value must have one of the following views // - "default" // - "tiny" Update(context.Context, *UpdatePayload) (res *ServiceStatusRT, view string, err error) // Delete an existing services. Delete(context.Context, *DeletePayload) (err error) // List all orders for a services by ID ListOrders(context.Context, *ListOrdersPayload) (res *OrderListRT, err error) }
Manage the life cycle of a service offered on the CRE marketplace.
type ServiceDescriptionT ¶
type ServiceDescriptionT struct { // Provider provided reference. Should to be a single string with punctuations // allowed. Might be changed, so please check result ProviderRef *string // Reference to service provider ProviderID string // More detailed description of the service Description string // Optional provider provided meta tags Metadata []*ParameterT // Reference to account revenues for this service should be credited to AccountID string // Reference to account revenues for this service should be credited to References []*ReferenceT // Link to banner image oprionally used for this service Banner *string // Definition of the workflow to use for executing this service Workflow *WorkflowT // Optional provider provided name Name *string // Optional provider provided tags Tags []string // Service parameter definitions Parameters []*ParameterDefT }
type ServiceListItem ¶
type ServiceListRT ¶
type ServiceListRT struct { // Services Services []*ServiceListItem // Navigation links Links *NavT }
ServiceListRT is the result type of the service service list method.
func NewServiceListRT ¶
func NewServiceListRT(vres *serviceviews.ServiceListRT) *ServiceListRT
NewServiceListRT initializes result type ServiceListRT from viewed result type ServiceListRT.
type ServiceStatusRT ¶
type ServiceStatusRT struct { // Service ID ID string // Provider provided ID. Needs to be a single string with punctuations allowed. // Might have been changed ProviderRef *string // More detailed description of the service Description *string // Service status Status *string // Optional provider provided meta tags Metadata []*ParameterT // Reference to service provider Provider *RefT // Reference to billable account Account *RefT Links *SelfT // Optional provider provided name Name *string // Optional provider provided tags Tags []string // Service parameter definitions Parameters []*ParameterDefT }
ServiceStatusRT is the result type of the service service create method.
func NewServiceStatusRT ¶
func NewServiceStatusRT(vres *serviceviews.ServiceStatusRT) *ServiceStatusRT
NewServiceStatusRT initializes result type ServiceStatusRT from viewed result type ServiceStatusRT.
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".
type UpdatePayload ¶
type UpdatePayload struct { // ID of services to update ID *string // Create if not already exist ForceCreate *bool // Updated services description Services *ServiceDescriptionT // JWT used for authentication JWT string }
UpdatePayload is the payload type of the service service update method.
type WorkflowT ¶
type WorkflowT struct { // Type of workflow Type *string // Type of workflow Basic *BasicWorkflowOptsT // Defines the workflow using argo's WF schema Argo interface{} // Type specific options - left for backward compatibility, if possible use // type specific elements Opts interface{} }
Defines the workflow to use to execute this service. Currently supported 'types' are 'basic' and 'argo'. In case of 'basic', use the 'basic' element for further parameters. In the current implementation 'opts' is expected to contain the same schema as 'basic'