volume

package
v0.0.0-...-0320a89 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrVolumeNotFound TODO
	ErrVolumeNotFound = errors.New("volume not found")

	// ErrVolumeAlreadyExists TODO
	ErrVolumeAlreadyExists = errors.New("volume does already exist")

	// ErrServerNotFound TODO
	ErrServerNotFound = errors.New("server not found")

	// ErrStillAttached TODO
	ErrStillAttached = errors.New("volume is attached")

	// ErrNotAttached TODO
	ErrNotAttached = errors.New("volume is not attached")

	// ErrAttachLimitReached TODO
	ErrAttachLimitReached = errors.New("max number of attachments per server reached")

	// ErrLockedServer TODO
	ErrLockedServer = errors.New("server is locked")
)

Functions

This section is empty.

Types

type AttachOpts

type AttachOpts struct {
	Volume *model.Volume
	Server *model.Server
}

AttachOpts defines the available options for the attach handler.

type CreateOpts

type CreateOpts struct {
	Name    string
	Size    int64
	Profile string
}

CreateOpts defines the available options for the create handler.

type DeleteOpts

type DeleteOpts struct {
	ID string
}

DeleteOpts defines the available options for the delete handler.

type DetachOpts

type DetachOpts struct {
	Volume *model.Volume
	Server *model.Server
}

DetachOpts defines the available options for the detach handler.

type FindOpts

type FindOpts struct {
	ID string
}

FindOpts defines the available options for the find handler.

type Option

type Option func(o *Options)

Option defines a single option function.

func WithClient

func WithClient(v *vcloud.Client) Option

WithClient provides a function to set the client option.

type Options

type Options struct {
	Client *vcloud.Client
}

Options defines the available options for this package.

type ResizeOpts

type ResizeOpts struct {
	Volume *model.Volume
	Size   int64
}

ResizeOpts defines the available options for the resize handler.

type Service

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

Service defines the service for the resize component.

func NewService

func NewService(opts ...Option) *Service

NewService simply initializes a new resize service.

func (*Service) Attach

func (s *Service) Attach(ctx context.Context, opts AttachOpts) error

Attach is handling the attaching of a volume to a server.

func (*Service) Create

func (s *Service) Create(ctx context.Context, opts CreateOpts) error

Create is handling the creation of a volume for a server.

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, opts DeleteOpts) error

Delete is handling the deletion of a volume from a server.

func (*Service) Detach

func (s *Service) Detach(ctx context.Context, opts DetachOpts) error

Detach is handling the detaching of a volume from a server.

func (*Service) Find

func (s *Service) Find(ctx context.Context, opts FindOpts) (*model.Volume, error)

Find simply tries to find the requested volume.

func (*Service) Resize

func (s *Service) Resize(ctx context.Context, opts ResizeOpts) error

Resize is handling the resizing of a volume from a server.

Jump to

Keyboard shortcuts

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