types

package
v0.8.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2020 License: Apache-2.0 Imports: 3 Imported by: 6

Documentation

Index

Constants

View Source
const (
	WO  = Mode("WO")
	RW  = Mode("RW")
	ERR = Mode("ERR")

	ProcessStateComplete   = ProcessState("complete")
	ProcessStateError      = ProcessState("error")
	ProcessStateInProgress = ProcessState("in_progress")

	StateUp   = State("up")
	StateDown = State("down")

	AWSAccessKey = "AWS_ACCESS_KEY_ID"
	AWSSecretKey = "AWS_SECRET_ACCESS_KEY"
	AWSEndPoint  = "AWS_ENDPOINTS"

	RetryCounts   = 30
	RetryInterval = 1 * time.Second

	EngineFrontendBlockDev = "tgt-blockdev"
	EngineFrontendISCSI    = "tgt-iscsi"
)
View Source
const (
	EventTypeVolume  = "volume"
	EventTypeReplica = "replica"
	EventTypeMetrics = "metrics"
)

Variables

This section is empty.

Functions

func IsAlreadyPurgingError

func IsAlreadyPurgingError(err error) bool

Types

type Backend

type Backend interface {
	ReaderWriterAt
	io.Closer
	Snapshot(name string, userCreated bool, created string, labels map[string]string) error
	Expand(size int64) error
	Size() (int64, error)
	SectorSize() (int64, error)
	RemainSnapshots() (int, error)
	GetRevisionCounter() (int64, error)
	SetRevisionCounter(counter int64) error
	GetMonitorChannel() MonitorChannel
	StopMonitoring()
}

type BackendFactory

type BackendFactory interface {
	Create(address string) (Backend, error)
}

type Controller

type Controller interface {
	AddReplica(address string) error
	RemoveReplica(address string) error
	SetReplicaMode(address string, mode Mode) error
	ListReplicas() []Replica
	Start(address ...string) error
	Shutdown() error
}

type ControllerReplicaInfo

type ControllerReplicaInfo struct {
	Address string `json:"address"`
	Mode    Mode   `json:"mode"`
}

type DataProcessor

type DataProcessor interface {
	ReaderWriterAt
	PingResponse() error
}

type DiffDisk

type DiffDisk interface {
	ReaderWriterAt
	io.Closer
	Fd() uintptr
	Size() (int64, error)
}

type DiskInfo

type DiskInfo struct {
	Name        string            `json:"name"`
	Parent      string            `json:"parent"`
	Children    map[string]bool   `json:"children"`
	Removed     bool              `json:"removed"`
	UserCreated bool              `json:"usercreated"`
	Created     string            `json:"created"`
	Size        string            `json:"size"`
	Labels      map[string]string `json:"labels"`
}

type Frontend

type Frontend interface {
	FrontendName() string
	Startup(name string, size, sectorSize int64, rw ReaderWriterAt) error
	Shutdown() error
	State() State
	Endpoint() string
	Upgrade(name string, size, sectorSize int64, rw ReaderWriterAt) error
	Expand(size int64) error
}

type Metrics

type Metrics struct {
	Bandwidth    RWMetrics // in byte
	TotalLatency RWMetrics // in microsecond(us)
	IOPS         RWMetrics
}

type Mode

type Mode string

type MonitorChannel

type MonitorChannel chan error

type PrepareRemoveAction

type PrepareRemoveAction struct {
	Action string `json:"action"`
	Source string `json:"source"`
	Target string `json:"target"`
}

type ProcessState

type ProcessState string

type RWMetrics

type RWMetrics struct {
	Read  uint64
	Write uint64
}

type ReaderWriterAt

type ReaderWriterAt interface {
	io.ReaderAt
	io.WriterAt
}

type Replica

type Replica struct {
	Address string
	Mode    Mode
}

type ReplicaInfo

type ReplicaInfo struct {
	Dirty           bool                `json:"dirty"`
	Rebuilding      bool                `json:"rebuilding"`
	Head            string              `json:"head"`
	Parent          string              `json:"parent"`
	Size            string              `json:"size"`
	SectorSize      int64               `json:"sectorSize,string"`
	BackingFile     string              `json:"backingFile"`
	State           string              `json:"state"`
	Chain           []string            `json:"chain"`
	Disks           map[string]DiskInfo `json:"disks"`
	RemainSnapshots int                 `json:"remainsnapshots"`
	RevisionCounter int64               `json:"revisioncounter,string"`
}

type Server

type Server interface {
	ReaderWriterAt
	Controller
}

type State

type State string

type SyncFileInfo

type SyncFileInfo struct {
	FromFileName string `json:"fromFileName"`
	ToFileName   string `json:"toFileName"`
	ActualSize   int64  `json:"actualSize"`
}

type VolumeInfo

type VolumeInfo struct {
	Name          string `json:"name"`
	Size          int64  `json:"size"`
	ReplicaCount  int    `json:"replicaCount"`
	Endpoint      string `json:"endpoint"`
	Frontend      string `json:"frontend"`
	FrontendState string `json:"frontendState"`
	IsExpanding   bool   `json:"isExpanding"`
}

Jump to

Keyboard shortcuts

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