spinregistry

package
v0.0.0-...-c0b5b33 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceName = "spin-registry"

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 = [12]string{"vm_create", "vm_update", "vm_delete", "vm_get", "vm_list", "storage_volumes_list", "storage_volumes_create", "storage_volumes_delete", "storage_images_list", "storage_images_create", "storage_images_delete", "storage_images_get"}

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 NewStorageImagesCreateEndpoint

func NewStorageImagesCreateEndpoint(s Service) goa.Endpoint

NewStorageImagesCreateEndpoint returns an endpoint function that calls the method "storage_images_create" of service "spin-registry".

func NewStorageImagesDeleteEndpoint

func NewStorageImagesDeleteEndpoint(s Service) goa.Endpoint

NewStorageImagesDeleteEndpoint returns an endpoint function that calls the method "storage_images_delete" of service "spin-registry".

func NewStorageImagesGetEndpoint

func NewStorageImagesGetEndpoint(s Service) goa.Endpoint

NewStorageImagesGetEndpoint returns an endpoint function that calls the method "storage_images_get" of service "spin-registry".

func NewStorageImagesListEndpoint

func NewStorageImagesListEndpoint(s Service) goa.Endpoint

NewStorageImagesListEndpoint returns an endpoint function that calls the method "storage_images_list" of service "spin-registry".

func NewStorageVolumesCreateEndpoint

func NewStorageVolumesCreateEndpoint(s Service) goa.Endpoint

NewStorageVolumesCreateEndpoint returns an endpoint function that calls the method "storage_volumes_create" of service "spin-registry".

func NewStorageVolumesDeleteEndpoint

func NewStorageVolumesDeleteEndpoint(s Service) goa.Endpoint

NewStorageVolumesDeleteEndpoint returns an endpoint function that calls the method "storage_volumes_delete" of service "spin-registry".

func NewStorageVolumesListEndpoint

func NewStorageVolumesListEndpoint(s Service) goa.Endpoint

NewStorageVolumesListEndpoint returns an endpoint function that calls the method "storage_volumes_list" of service "spin-registry".

func NewVMCreateEndpoint

func NewVMCreateEndpoint(s Service) goa.Endpoint

NewVMCreateEndpoint returns an endpoint function that calls the method "vm_create" of service "spin-registry".

func NewVMDeleteEndpoint

func NewVMDeleteEndpoint(s Service) goa.Endpoint

NewVMDeleteEndpoint returns an endpoint function that calls the method "vm_delete" of service "spin-registry".

func NewVMGetEndpoint

func NewVMGetEndpoint(s Service) goa.Endpoint

NewVMGetEndpoint returns an endpoint function that calls the method "vm_get" of service "spin-registry".

func NewVMListEndpoint

func NewVMListEndpoint(s Service) goa.Endpoint

NewVMListEndpoint returns an endpoint function that calls the method "vm_list" of service "spin-registry".

func NewVMUpdateEndpoint

func NewVMUpdateEndpoint(s Service) goa.Endpoint

NewVMUpdateEndpoint returns an endpoint function that calls the method "vm_update" of service "spin-registry".

Types

type Client

type Client struct {
	VMCreateEndpoint             goa.Endpoint
	VMUpdateEndpoint             goa.Endpoint
	VMDeleteEndpoint             goa.Endpoint
	VMGetEndpoint                goa.Endpoint
	VMListEndpoint               goa.Endpoint
	StorageVolumesListEndpoint   goa.Endpoint
	StorageVolumesCreateEndpoint goa.Endpoint
	StorageVolumesDeleteEndpoint goa.Endpoint
	StorageImagesListEndpoint    goa.Endpoint
	StorageImagesCreateEndpoint  goa.Endpoint
	StorageImagesDeleteEndpoint  goa.Endpoint
	StorageImagesGetEndpoint     goa.Endpoint
}

Client is the "spin-registry" service client.

func NewClient

func NewClient(vMCreate, vMUpdate, vMDelete, vMGet, vMList, storageVolumesList, storageVolumesCreate, storageVolumesDelete, storageImagesList, storageImagesCreate, storageImagesDelete, storageImagesGet goa.Endpoint) *Client

NewClient initializes a "spin-registry" service client given the endpoints.

func (*Client) StorageImagesCreate

func (c *Client) StorageImagesCreate(ctx context.Context, p *Storage) (res *Image, err error)

StorageImagesCreate calls the "storage_images_create" endpoint of the "spin-registry" service.

func (*Client) StorageImagesDelete

func (c *Client) StorageImagesDelete(ctx context.Context, p *StorageImagesDeletePayload) (err error)

StorageImagesDelete calls the "storage_images_delete" endpoint of the "spin-registry" service.

func (*Client) StorageImagesGet

func (c *Client) StorageImagesGet(ctx context.Context, p *StorageImagesGetPayload) (res *Image, err error)

StorageImagesGet calls the "storage_images_get" endpoint of the "spin-registry" service.

func (*Client) StorageImagesList

func (c *Client) StorageImagesList(ctx context.Context, p *StorageImagesListPayload) (res []string, err error)

StorageImagesList calls the "storage_images_list" endpoint of the "spin-registry" service.

func (*Client) StorageVolumesCreate

func (c *Client) StorageVolumesCreate(ctx context.Context, p *StorageVolumesCreatePayload) (err error)

StorageVolumesCreate calls the "storage_volumes_create" endpoint of the "spin-registry" service.

func (*Client) StorageVolumesDelete

func (c *Client) StorageVolumesDelete(ctx context.Context, p *StorageVolumesDeletePayload) (err error)

StorageVolumesDelete calls the "storage_volumes_delete" endpoint of the "spin-registry" service.

func (*Client) StorageVolumesList

func (c *Client) StorageVolumesList(ctx context.Context) (res map[string]string, err error)

StorageVolumesList calls the "storage_volumes_list" endpoint of the "spin-registry" service.

func (*Client) VMCreate

func (c *Client) VMCreate(ctx context.Context, p *UpdatedVM) (res uint64, err error)

VMCreate calls the "vm_create" endpoint of the "spin-registry" service.

func (*Client) VMDelete

func (c *Client) VMDelete(ctx context.Context, p *VMDeletePayload) (err error)

VMDelete calls the "vm_delete" endpoint of the "spin-registry" service.

func (*Client) VMGet

func (c *Client) VMGet(ctx context.Context, p *VMGetPayload) (res *UpdatedVM, err error)

VMGet calls the "vm_get" endpoint of the "spin-registry" service.

func (*Client) VMList

func (c *Client) VMList(ctx context.Context) (res []uint64, err error)

VMList calls the "vm_list" endpoint of the "spin-registry" service.

func (*Client) VMUpdate

func (c *Client) VMUpdate(ctx context.Context, p *UpdateVM) (err error)

VMUpdate calls the "vm_update" endpoint of the "spin-registry" service.

type Endpoints

type Endpoints struct {
	VMCreate             goa.Endpoint
	VMUpdate             goa.Endpoint
	VMDelete             goa.Endpoint
	VMGet                goa.Endpoint
	VMList               goa.Endpoint
	StorageVolumesList   goa.Endpoint
	StorageVolumesCreate goa.Endpoint
	StorageVolumesDelete goa.Endpoint
	StorageImagesList    goa.Endpoint
	StorageImagesCreate  goa.Endpoint
	StorageImagesDelete  goa.Endpoint
	StorageImagesGet     goa.Endpoint
}

Endpoints wraps the "spin-registry" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "spin-registry" service with endpoints.

func (*Endpoints) Use

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

Use applies the given middleware to all the "spin-registry" service endpoints.

type Image

type Image struct {
	// Image path
	Path string
	// Is this a cdrom image?
	Cdrom bool
	// Volume name
	Volume *string
}

Image is the result type of the spin-registry service storage_images_create method.

type Service

type Service interface {
	// Create a VM
	VMCreate(context.Context, *UpdatedVM) (res uint64, err error)
	// Update a VM
	VMUpdate(context.Context, *UpdateVM) (err error)
	// Delete a VM by ID
	VMDelete(context.Context, *VMDeletePayload) (err error)
	// Retrieve a VM by ID
	VMGet(context.Context, *VMGetPayload) (res *UpdatedVM, err error)
	// Retrieve all VM IDs
	VMList(context.Context) (res []uint64, err error)
	// list all volumes
	StorageVolumesList(context.Context) (res map[string]string, err error)
	// create a new volume
	StorageVolumesCreate(context.Context, *StorageVolumesCreatePayload) (err error)
	// delete an existing volume
	StorageVolumesDelete(context.Context, *StorageVolumesDeletePayload) (err error)
	// list all images by volume
	StorageImagesList(context.Context, *StorageImagesListPayload) (res []string, err error)
	// add an image definition to the registry
	StorageImagesCreate(context.Context, *Storage) (res *Image, err error)
	// remove an image definition from the registry
	StorageImagesDelete(context.Context, *StorageImagesDeletePayload) (err error)
	// retrieves an image definition from the registry
	StorageImagesGet(context.Context, *StorageImagesGetPayload) (res *Image, err error)
}

Keeper of the VMs

type Storage

type Storage struct {
	// Volume name; required if image is not a cdrom
	Volume *string
	// Image filename, no `/` characters
	Image string
	// Image size (in gigabytes); required if image is not a cdrom
	ImageSize *uint
	// Is this image a cdrom?
	Cdrom bool
}

Storage is the payload type of the spin-registry service storage_images_create method.

type StorageImagesDeletePayload

type StorageImagesDeletePayload struct {
	// name of volume
	VolumeName string
	// name of image
	ImageName string
}

StorageImagesDeletePayload is the payload type of the spin-registry service storage_images_delete method.

type StorageImagesGetPayload

type StorageImagesGetPayload struct {
	// name of volume
	VolumeName string
	// name of image
	ImageName string
}

StorageImagesGetPayload is the payload type of the spin-registry service storage_images_get method.

type StorageImagesListPayload

type StorageImagesListPayload struct {
	// name of volume to list images for
	VolumeName string
}

StorageImagesListPayload is the payload type of the spin-registry service storage_images_list method.

type StorageVolumesCreatePayload

type StorageVolumesCreatePayload struct {
	// name of volume
	Name string
	// path to volume
	Path string
}

StorageVolumesCreatePayload is the payload type of the spin-registry service storage_volumes_create method.

type StorageVolumesDeletePayload

type StorageVolumesDeletePayload struct {
	// name of volume
	Name string
}

StorageVolumesDeletePayload is the payload type of the spin-registry service storage_volumes_delete method.

type UpdateVM

type UpdateVM struct {
	// ID of VM to update
	ID uint64
	// VM to publish
	VM *UpdatedVM
}

UpdateVM is the payload type of the spin-registry service vm_update method.

type UpdatedVM

type UpdatedVM struct {
	// Image references
	Images []*Image
	// Name of VM; does not need to be unique
	Name string
	// CPU count
	Cpus uint
	// Memory (in megabytes)
	Memory uint
}

UpdatedVM is the payload type of the spin-registry service vm_create method.

type VMDeletePayload

type VMDeletePayload struct {
	// ID of VM to remove
	ID uint64
}

VMDeletePayload is the payload type of the spin-registry service vm_delete method.

type VMGetPayload

type VMGetPayload struct {
	// ID of VM to remove
	ID uint64
}

VMGetPayload is the payload type of the spin-registry service vm_get method.

Jump to

Keyboard shortcuts

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