types

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

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"
)
View Source
const (
	EventTypeVolume  = "volume"
	EventTypeReplica = "replica"
	EventTypeMetrics = "metrics"
)

Variables

This section is empty.

Functions

func IsAlreadyPurgingError added in v0.6.0

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
	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 added in v0.6.0

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

type DataProcessor added in v0.3.0

type DataProcessor interface {
	ReaderWriterAt
	PingResponse() error
}

type DiffDisk

type DiffDisk interface {
	ReaderWriterAt
	io.Closer
	Fd() uintptr
}

type DiskInfo added in v0.6.0

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
}

type Metrics added in v0.3.3

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

type Mode

type Mode string

type MonitorChannel added in v0.3.0

type MonitorChannel chan error

type PrepareRebuildOutput added in v0.6.0

type PrepareRebuildOutput struct {
	Disks []string `json:"disks"`
}

type PrepareRemoveAction added in v0.6.0

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

type ProcessState added in v0.6.0

type ProcessState string

type RWMetrics added in v0.3.3

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 added in v0.6.0

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 added in v0.3.0

type State string

type VolumeInfo added in v0.6.0

type VolumeInfo struct {
	Name          string `json:"name"`
	ReplicaCount  int    `json:"replicaCount"`
	Endpoint      string `json:"endpoint"`
	Frontend      string `json:"frontend"`
	FrontendState string `json:"frontendState"`
	IsRestoring   bool   `json:"isRestoring"`
	LastRestored  string `json:"lastRestored"`
}

Jump to

Keyboard shortcuts

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