europa

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

README

Europa

Europa is component of storage.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseImage

type BaseImage struct {
	UUID          uuid.UUID `db:"uuid"`
	Name          string    `db:"name"`
	Description   string    `db:"description"`
	CacheVolumeID string    `db:"volume_id"` // if CacheVolumeID is blank, not have cache image
	CreatedAt     time.Time `db:"created_at"`
	UpdatedAt     time.Time `db:"updated_at"`
}

BaseImage is os Image

func (*BaseImage) ToPb

func (bi *BaseImage) ToPb() *pb.Image

ToPb parse to Satelit API Server pb.Image

type Europa

type Europa interface {
	CreateVolume(ctx context.Context, name uuid.UUID, capacityGB int) (*Volume, error)
	CreateVolumeFromImage(ctx context.Context, name uuid.UUID, capacityGB int, imageID uuid.UUID) (*Volume, error)
	DeleteVolume(ctx context.Context, id string) error
	ListVolume(ctx context.Context) ([]Volume, error)
	GetVolume(ctx context.Context, id string) (*Volume, error)
	AttachVolumeTeleskop(ctx context.Context, id string, hostname string) (int, string, error)
	AttachVolumeSatelit(ctx context.Context, id string, hostname string) (int, string, error)
	DetachVolume(ctx context.Context, id string) error
	GetImage(imageID uuid.UUID) (*BaseImage, error)
	ListImage() ([]BaseImage, error)
	UploadImage(ctx context.Context, image []byte, name, description string, imageSizeGB int) (*BaseImage, error)
	DeleteImage(ctx context.Context, id uuid.UUID) error
}

Europa is interface of volume operation.

type Volume

type Volume struct {
	ID          string    `db:"id"` // equal HyperMetroPair ID in dorado
	Attached    bool      `db:"attached"`
	HostName    string    `db:"hostname"`
	CapacityGB  uint32    `db:"capacity_gb"`
	BaseImageID uuid.UUID `db:"base_image_id"`
	HostLUNID   int       `db:"host_lun_id"` // set when attached
	BackendName string    `db:"backend_name"`
	CreatedAt   time.Time `db:"created_at"`
	UpdatedAt   time.Time `db:"updated_at"`
}

A Volume is volume information

func (*Volume) ToPb

func (v *Volume) ToPb() *pb.Volume

ToPb parse to Satelit API Server pb.Volume

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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