registryclient

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is the outer handle for the registry HTTP client.

func New

func New(cc Config) *Client

New constructs a new http client from the configuration provided.

func (*Client) StorageImageCreate

func (c *Client) StorageImageCreate(ctx context.Context, s *spinregistry.Storage) (*spinregistry.Image, error)

StorageImageCreate creates an image

func (*Client) StorageImageDelete

func (c *Client) StorageImageDelete(ctx context.Context, volumeName, imageName string) error

StorageImageDelete deletes an image by name & volume name

func (*Client) StorageImageGet

func (c *Client) StorageImageGet(ctx context.Context, volumeName, imageName string) (*spinregistry.Storage, error)

StorageImageGet retrieves an image by name w/ volume name.

func (*Client) StorageImageList

func (c *Client) StorageImageList(ctx context.Context, name string) ([]string, error)

StorageImageList lists images for a given volume.

func (*Client) StorageVolumeCreate

func (c *Client) StorageVolumeCreate(ctx context.Context, name, path string) error

StorageVolumeCreate creates a volume by name.

func (*Client) StorageVolumeDelete

func (c *Client) StorageVolumeDelete(ctx context.Context, name string) error

StorageVolumeDelete deletes a volume by name.

func (*Client) StorageVolumeList

func (c *Client) StorageVolumeList(ctx context.Context) ([]string, error)

StorageVolumeList lists all volumes by name.

func (*Client) VMCreate

func (c *Client) VMCreate(ctx context.Context, vm *spinregistry.UpdatedVM) (uint64, error)

VMCreate creates a new vm.

func (*Client) VMDelete

func (c *Client) VMDelete(ctx context.Context, id uint64) error

VMDelete deletes a vm by id.

func (*Client) VMGet

func (c *Client) VMGet(ctx context.Context, id uint64) (*spinregistry.UpdatedVM, error)

VMGet retrieves a vm by id.

func (*Client) VMList

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

VMList retrieves all IDs of all VMs.

func (*Client) VMUpdate

func (c *Client) VMUpdate(ctx context.Context, id uint64, vm *spinregistry.UpdatedVM) error

VMUpdate updates a vm by id.

type Config

type Config struct {
	Host    string
	Timeout int
}

Config is the configuration struct for the HTTP client. Timeout is in seconds. Host should contain a port if not port 80.

Jump to

Keyboard shortcuts

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