Documentation
¶
Index ¶
Constants ¶
const ( VdiskTypeNil = VdiskType("") VdiskTypeBoot = VdiskType("boot") VdiskTypeDB = VdiskType("db") VdiskTypeCache = VdiskType("cache") )
valid vdisk types
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { StorageClusters map[string]StorageClusterConfig `yaml:"storageClusters" valid:"required"` Vdisks map[string]VdiskConfig `yaml:"vdisks" valid:"required"` }
Config for the blockstor backends
func ReadConfig ¶
ReadConfig reads the config used to configure the blockstor
type StorageClusterConfig ¶
type StorageClusterConfig struct { DataStorage []StorageServerConfig `yaml:"dataStorage" valid:"required"` MetadataStorage StorageServerConfig `yaml:"metadataStorage" valid:"required"` }
StorageClusterConfig defines the config for a storageCluster
type StorageServerConfig ¶
type StorageServerConfig struct { Address string `yaml:"address" valid:"dialstring,required"` Database int `yaml:"db" valid:"optional"` }
StorageServerConfig defines the config for a storage server
func ParseCSStorageServerConfigStrings ¶
func ParseCSStorageServerConfigStrings(dialCSConfigString string) (configs []StorageServerConfig, err error)
ParseCSStorageServerConfigStrings allows you to parse a slice of raw dial config strings. Dial Config Strings are a simple format used to specify ardb connection configs easily as a command line argument. The format is as follows: `<ip>:<port>[@<db_index>][,<ip>:<port>[@<db_index>]]`, where the db_index is optional, and you can give multiple configs by seperating them with a comma.
type StorageType ¶
type StorageType uint8
StorageType represents the type of storage of a vdisk
const ( StorageNil StorageType = 0 StorageDeduped StorageType = 1 << iota StorageNondeduped )
Different types of storage
func (StorageType) String ¶
func (st StorageType) String() string
String returns the name of the storage type
func (StorageType) UInt8 ¶
func (st StorageType) UInt8() uint8
UInt8 returns the storage type as an uint8 value
type VdiskConfig ¶
type VdiskConfig struct { BlockSize uint64 `yaml:"blockSize" valid:"required"` ReadOnly bool `yaml:"readOnly" valid:"optional"` Size uint64 `yaml:"size" valid:"required"` StorageCluster string `yaml:"storageCluster" valid:"required"` RootStorageCluster string `yaml:"rootStorageCluster" valid:"optional"` TlogStorageCluster string `yaml:"tlogStorageCluster" valid:"optional"` Type VdiskType `yaml:"type" valid:"required"` }
VdiskConfig defines the config for a vdisk
func (*VdiskConfig) StorageType ¶
func (cfg *VdiskConfig) StorageType() StorageType
StorageType returns the type of storage this vdisk uses
type VdiskType ¶
type VdiskType string
VdiskType represents the type of a vdisk
func (*VdiskType) MarshalYAML ¶
MarshalYAML implements yaml.Marshaler.MarshalYAML
func (*VdiskType) UnmarshalYAML ¶
UnmarshalYAML implements yaml.Unmarshaler.UnmarshalYAML