memory

package
v0.0.0-...-f1b23c0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Memory

type Memory struct {
	// im-memory storage engine (ex: Dorado)
	Volumes        map[string]europa.Volume // ID: Volume
	Mu             sync.RWMutex
	BackendendName string
	// contains filtered or unexported fields
}

A Memory is backend of europa by in-memory for testing.

func New

func New(ds datastore.Datastore) *Memory

New create on memory backend

func (*Memory) AttachVolume

func (m *Memory) AttachVolume(ctx context.Context, id string, hostname string) (int, string, error)

AttachVolume write attach information in-memory

func (*Memory) AttachVolumeSatelit

func (m *Memory) AttachVolumeSatelit(ctx context.Context, id string, hostname string) (int, string, error)

AttachVolumeSatelit write attach information in-memory

func (*Memory) AttachVolumeTeleskop

func (m *Memory) AttachVolumeTeleskop(ctx context.Context, id string, hostname string) (int, string, error)

AttachVolumeTeleskop write attach information in-memory

func (*Memory) CreateVolume

func (m *Memory) CreateVolume(ctx context.Context, name uuid.UUID, capacityGB int) (*europa.Volume, error)

CreateVolume write volume information to in-memory

func (*Memory) CreateVolumeFromImage

func (m *Memory) CreateVolumeFromImage(ctx context.Context, name uuid.UUID, capacityGB int, imageID uuid.UUID) (*europa.Volume, error)

CreateVolumeFromImage write volume info to in-memory

func (*Memory) DeleteImage

func (m *Memory) DeleteImage(ctx context.Context, id uuid.UUID) error

DeleteImage delete from in-memory

func (*Memory) DeleteVolume

func (m *Memory) DeleteVolume(ctx context.Context, id string) error

DeleteVolume delete volume in-memory

func (*Memory) DetachVolume

func (m *Memory) DetachVolume(ctx context.Context, id string) error

DetachVolume delete attach information in-memory

func (*Memory) DetachVolumeSatelit

func (m *Memory) DetachVolumeSatelit(ctx context.Context, hyperMetroPairID string, hostLUNID int) error

DetachVolumeSatelit detach volume from satelit server

func (*Memory) GetImage

func (m *Memory) GetImage(imageID uuid.UUID) (*europa.BaseImage, error)

GetImage retrieves image

func (*Memory) GetVolume

func (m *Memory) GetVolume(ctx context.Context, id string) (*europa.Volume, error)

GetVolume get volume in-memory

func (*Memory) ListImage

func (m *Memory) ListImage() ([]europa.BaseImage, error)

ListImage return image from in-memory

func (*Memory) ListVolume

func (m *Memory) ListVolume(ctx context.Context) ([]europa.Volume, error)

ListVolume return list of volume in-memory

func (*Memory) UploadImage

func (m *Memory) UploadImage(ctx context.Context, image []byte, name, description string, imageSizeGB int) (*europa.BaseImage, error)

UploadImage upload image to in-memory

Jump to

Keyboard shortcuts

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