service

package
v0.42.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 4 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.41"

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

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

View Source
var MethodNames = [5]string{"list", "create_service", "read", "update", "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 NewCreateServiceEndpoint

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

NewCreateServiceEndpoint returns an endpoint function that calls the method "create_service" of service "service".

func NewDeleteEndpoint

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

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

func NewListEndpoint

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

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

func NewReadEndpoint

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

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

func NewUpdateEndpoint

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

NewUpdateEndpoint returns an endpoint function that calls the method "update" of service "service".

func NewViewedServiceListRT

func NewViewedServiceListRT(res *ServiceListRT, view string) *serviceviews.ServiceListRT

NewViewedServiceListRT initializes viewed result type ServiceListRT from result type ServiceListRT 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
}

Something wasn't right with this request

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
	// Optionally definesq the image pull policy
	ImagePullPolicy string `json:"image-pull-policy,omitempty"`
	// 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
	// Defines ephemeral storage resource requests and limits
	// (see
	// https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#local-ephemeral-storage)
	EphemeralStorage *ResourceMemoryT `json:"ephemeral-storage,omitempty"`
	// Defines required gpu type
	GpuType *string `json:"gpu-type,omitempty"`
	// Defines number of required gpu
	GpuNumber *int `json:"gpu-number,omitempty"`
	// Defines needed amount of shared-memory
	SharedMemory *string `json:"shared-memory,omitempty"`
}

type CreateServicePayload

type CreateServicePayload struct {
	// New services description
	Services *ServiceDefinitionT
	// JWT used for authentication
	JWT string
}

CreateServicePayload is the payload type of the service service create_service 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 Endpoints

type Endpoints struct {
	List          goa.Endpoint
	CreateService goa.Endpoint
	Read          goa.Endpoint
	Update        goa.Endpoint
	Delete        goa.Endpoint
}

Endpoints wraps the "service" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

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

func (*Endpoints) Use

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

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

type InvalidParameterT added in v0.39.0

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

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

func (*InvalidParameterT) Error added in v0.39.0

func (e *InvalidParameterT) Error() string

Error returns an error description.

func (*InvalidParameterT) ErrorName deprecated added in v0.39.0

func (e *InvalidParameterT) ErrorName() string

ErrorName returns "InvalidParameterT".

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

func (*InvalidParameterT) GoaErrorName added in v0.39.0

func (e *InvalidParameterT) GoaErrorName() string

GoaErrorName returns "InvalidParameterT".

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' query option sets the maximum number of items
	// 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 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 ParameterDefT

type ParameterDefT struct {
	Name        string
	Label       *string
	Type        string
	Description string
	Unit        *string
	Constant    *bool
	Optional    *bool
	Default     *string
	Options     []*ParameterOptT
	Unary       *bool
}

type ParameterOptT

type ParameterOptT struct {
	Value       *string
	Description *string
}

type ReadPayload

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

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

type ReferenceT

type ReferenceT struct {
	// Title of reference document
	Title *string
	// Link to document
	URI *string
}

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 https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes 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 Service

type Service interface {
	// list services
	List(context.Context, *ListPayload) (res *ServiceListRT, err error)
	// Create a new services and return its status.
	CreateService(context.Context, *CreateServicePayload) (res *ServiceStatusRT, err error)
	// Show services by ID
	Read(context.Context, *ReadPayload) (res *ServiceStatusRT, err error)
	// Update an existing services and return its status.
	Update(context.Context, *UpdatePayload) (res *ServiceStatusRT, err error)
	// Delete an existing services.
	Delete(context.Context, *DeletePayload) (err error)
}

Manage the life cycle of a service offered on the CRE marketplace.

type ServiceDefinitionT added in v0.30.0

type ServiceDefinitionT struct {
	// More detailed description of the service
	Description string
	// Reference to account revenues for this service should be credited to
	References []*ReferenceT
	// Link to banner image optionally used for this service
	Banner *string
	// Definition of the workflow to use for executing this service
	Workflow *WorkflowT
	// Reference to policy used
	Policy *string
	// Optional provider provided name
	Name *string
	// Optional provider provided tags
	Tags []string
	// Service parameter definitions
	Parameters []*ParameterDefT
}

type ServiceListItem

type ServiceListItem struct {
	// ID
	ID string
	// Optional customer provided name
	Name *string
	// Optional description of the service
	Description *string
	// Optional banner image for this service
	Banner *string
	// time this service was published
	PublishedAt *string
	// Reference to policy used
	Policy *string
	// Reference to billable account
	Account string
	Href    string `json:"href,omitempty"`
}

type ServiceListRT

type ServiceListRT struct {
	// Services
	Items []*ServiceListItem
	// Time at which this list was valid
	AtTime string
	Links  []*LinkT
}

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 ServiceNotAvailableT added in v0.39.0

type ServiceNotAvailableT struct {
}

Service necessary to fulfil the request is currently not available.

func (*ServiceNotAvailableT) Error added in v0.39.0

func (e *ServiceNotAvailableT) Error() string

Error returns an error description.

func (*ServiceNotAvailableT) ErrorName deprecated added in v0.39.0

func (e *ServiceNotAvailableT) ErrorName() string

ErrorName returns "ServiceNotAvailableT".

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

func (*ServiceNotAvailableT) GoaErrorName added in v0.39.0

func (e *ServiceNotAvailableT) GoaErrorName() string

GoaErrorName returns "ServiceNotAvailableT".

type ServiceStatusRT

type ServiceStatusRT struct {
	// ID
	ID string
	// More detailed description of the service
	Description *string
	// Service status
	Status string
	// Reference to billable account
	Account string
	Links   []*LinkT
	// 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_service 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".

type UpdatePayload

type UpdatePayload struct {
	// ID of services to update
	ID *string
	// Create if not already exist
	ForceCreate *bool
	// Updated services description
	Services *ServiceDefinitionT
	// 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 any
}

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'

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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