Documentation
¶
Index ¶
- Constants
- Variables
- func NewCreateEndpoint(s Service) goa.Endpoint
- func NewDeleteEndpoint(s Service) goa.Endpoint
- func NewGetEndpoint(s Service) goa.Endpoint
- func NewListEndpoint(s Service) goa.Endpoint
- func NewViewedVolume(res *Volume, view string) *volumesviews.Volume
- type AlreadyExists
- type Client
- func (c *Client) Create(ctx context.Context, p *CreateVolumePayload) (res *Volume, err error)
- func (c *Client) Delete(ctx context.Context, p *DeletePayload) (err error)
- func (c *Client) Get(ctx context.Context, p *GetPayload) (res *Volume, err error)
- func (c *Client) List(ctx context.Context, p *ListPayload) (res []*Volume, err error)
- type CreateVolumePayload
- type DeletePayload
- type Endpoints
- type GetPayload
- type Invalid
- type ListPayload
- type NotFound
- type Service
- type Volume
Constants ¶
const APIName = "kube-workspaces"
APIName is the name of the API as defined in the design.
const APIVersion = "1.0.0"
APIVersion is the version of the API as defined in the design.
const ServiceName = "volumes"
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 = [4]string{"list", "get", "create", "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 NewCreateEndpoint ¶
NewCreateEndpoint returns an endpoint function that calls the method "create" of service "volumes".
func NewDeleteEndpoint ¶
NewDeleteEndpoint returns an endpoint function that calls the method "delete" of service "volumes".
func NewGetEndpoint ¶
NewGetEndpoint returns an endpoint function that calls the method "get" of service "volumes".
func NewListEndpoint ¶
NewListEndpoint returns an endpoint function that calls the method "list" of service "volumes".
func NewViewedVolume ¶
func NewViewedVolume(res *Volume, view string) *volumesviews.Volume
NewViewedVolume initializes viewed result type Volume from result type Volume using the given view.
Types ¶
type AlreadyExists ¶
type AlreadyExists string
Volume already exists
func (AlreadyExists) Error ¶
func (e AlreadyExists) Error() string
Error returns an error description.
func (AlreadyExists) ErrorName
deprecated
func (e AlreadyExists) ErrorName() string
ErrorName returns the error name.
Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105
func (AlreadyExists) GoaErrorName ¶
func (e AlreadyExists) GoaErrorName() string
GoaErrorName returns the error name.
type Client ¶
type Client struct {
ListEndpoint goa.Endpoint
GetEndpoint goa.Endpoint
CreateEndpoint goa.Endpoint
DeleteEndpoint goa.Endpoint
}
Client is the "volumes" service client.
func (*Client) Create ¶
Create calls the "create" endpoint of the "volumes" service. Create may return the following errors:
- "already_exists" (type AlreadyExists)
- "invalid" (type Invalid)
- error: internal error
func (*Client) Delete ¶
func (c *Client) Delete(ctx context.Context, p *DeletePayload) (err error)
Delete calls the "delete" endpoint of the "volumes" service. Delete may return the following errors:
- "not_found" (type NotFound)
- error: internal error
type CreateVolumePayload ¶
type CreateVolumePayload struct {
// PVC name
Name string
// Target namespace
Namespace string
// Storage size
Size string
// Storage class name
StorageClass *string
// Access mode
AccessMode string
}
CreateVolumePayload is the payload type of the volumes service create method.
type DeletePayload ¶
DeletePayload is the payload type of the volumes service delete method.
type Endpoints ¶
type Endpoints struct {
List goa.Endpoint
Get goa.Endpoint
Create goa.Endpoint
Delete goa.Endpoint
}
Endpoints wraps the "volumes" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "volumes" service with endpoints.
type GetPayload ¶
GetPayload is the payload type of the volumes service get method.
type Invalid ¶
type Invalid string
Invalid volume specification
func (Invalid) ErrorName
deprecated
ErrorName returns the error name.
Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105
func (Invalid) GoaErrorName ¶
GoaErrorName returns the error name.
type ListPayload ¶
type ListPayload struct {
// Filter by namespace
Namespace string
}
ListPayload is the payload type of the volumes service list method.
type NotFound ¶
type NotFound string
Volume not found
func (NotFound) ErrorName
deprecated
ErrorName returns the error name.
Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105
func (NotFound) GoaErrorName ¶
GoaErrorName returns the error name.
type Service ¶
type Service interface {
// List all volumes
List(context.Context, *ListPayload) (res []*Volume, err error)
// Get a volume by name
Get(context.Context, *GetPayload) (res *Volume, err error)
// Create a new volume (PVC)
Create(context.Context, *CreateVolumePayload) (res *Volume, err error)
// Delete a volume
Delete(context.Context, *DeletePayload) (err error)
}
Volume (PVC) management service
type Volume ¶
type Volume struct {
// PVC name
Name string
// Kubernetes namespace
Namespace string
// Storage size
Size string
// Storage class
StorageClass *string
// Access mode
AccessMode *string
// PVC phase (Bound, Pending, etc.)
Phase string
// Creation timestamp
CreatedAt *string
// Kubernetes labels on the PVC
Labels map[string]string
}
Volume is the result type of the volumes service get method.
func NewVolume ¶
func NewVolume(vres *volumesviews.Volume) *Volume
NewVolume initializes result type Volume from viewed result type Volume.