volumes

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const APIName = "kube-workspaces"

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

View Source
const APIVersion = "1.0.0"

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

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

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

func NewCreateEndpoint(s Service) goa.Endpoint

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

func NewDeleteEndpoint

func NewDeleteEndpoint(s Service) goa.Endpoint

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

func NewGetEndpoint

func NewGetEndpoint(s Service) goa.Endpoint

NewGetEndpoint returns an endpoint function that calls the method "get" of service "volumes".

func NewListEndpoint

func NewListEndpoint(s Service) goa.Endpoint

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 NewClient

func NewClient(list, get, create, delete_ goa.Endpoint) *Client

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

func (*Client) Create

func (c *Client) Create(ctx context.Context, p *CreateVolumePayload) (res *Volume, err error)

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

func (*Client) Get

func (c *Client) Get(ctx context.Context, p *GetPayload) (res *Volume, err error)

Get calls the "get" endpoint of the "volumes" service. Get may return the following errors:

  • "not_found" (type NotFound)
  • error: internal error

func (*Client) List

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

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

type CreateVolumePayload

type CreateVolumePayload struct {
	// Volume type: container PVC or reusable CDI blank VM disk
	Type string
	// 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

type DeletePayload struct {
	// Namespace
	Namespace string
	// Volume name
	Name string
}

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

func NewEndpoints(s Service) *Endpoints

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

func (*Endpoints) Use

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

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

type GetPayload

type GetPayload struct {
	// Namespace
	Namespace string
	// Volume name
	Name string
}

GetPayload is the payload type of the volumes service get method.

type Invalid

type Invalid string

Invalid volume specification

func (Invalid) Error

func (e Invalid) Error() string

Error returns an error description.

func (Invalid) ErrorName deprecated

func (e Invalid) ErrorName() string

ErrorName returns the error name.

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

func (Invalid) GoaErrorName

func (e Invalid) GoaErrorName() string

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) Error

func (e NotFound) Error() string

Error returns an error description.

func (NotFound) ErrorName deprecated

func (e NotFound) ErrorName() string

ErrorName returns the error name.

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

func (NotFound) GoaErrorName

func (e NotFound) GoaErrorName() string

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 {
	// Volume type: pvc or vm-disk
	Type string
	// 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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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