config

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfKeyName = iota
	ConfDefaultValue
)

Variables

This section is empty.

Functions

func GetBackendsMap

func GetBackendsMap() map[string]BackendProperties

Types

type BackendProperties

type BackendProperties struct {
	Name        string `conf:"name"`
	Description string `conf:"description"`
	DriverName  string `conf:"driver_name"`
	ConfigPath  string `conf:"config_path"`
}

type Backends

type Backends struct {
	Ceph         BackendProperties `conf:"ceph"`
	Cinder       BackendProperties `conf:"cinder"`
	Sample       BackendProperties `conf:"sample"`
	LVM          BackendProperties `conf:"lvm"`
	HuaweiDorado BackendProperties `conf:"huawei_dorado"`
}

type Config

type Config struct {
	Default  `conf:"default"`
	OsdsLet  `conf:"osdslet"`
	OsdsDock `conf:"osdsdock"`
	Database `conf:"database"`
	Flag     FlagSet
}
var CONF *Config = GetDefaultConfig()

Global Configuration Variable

func GetDefaultConfig

func GetDefaultConfig() *Config

Create a Config and init default value.

func (*Config) Load

func (c *Config) Load(confFile string)

type Database

type Database struct {
	Credential string `conf:"credential,username:password@tcp(ip:port)/dbname"`
	Driver     string `conf:"driver,etcd"`
	Endpoint   string `conf:"endpoint,localhost:2379,localhost:2380"`
}

type Default

type Default struct{}

type Flag

type Flag struct {
	InValue interface{}
	Value   interface{}
}

type FlagSet

type FlagSet struct {
	// contains filtered or unexported fields
}

func (*FlagSet) Add

func (f *FlagSet) Add(name string, flag *Flag)

func (*FlagSet) AssignValue

func (f *FlagSet) AssignValue()

func (*FlagSet) BoolVar

func (f *FlagSet) BoolVar(p *bool, name string, defValue bool, usage string)

func (*FlagSet) Float64Var

func (f *FlagSet) Float64Var(p *float64, name string, defValue float64, usage string)

func (*FlagSet) Int64Var

func (f *FlagSet) Int64Var(p *int64, name string, defValue int64, usage string)

func (*FlagSet) IntVar

func (f *FlagSet) IntVar(p *int, name string, defValue int, usage string)

func (*FlagSet) Parse

func (f *FlagSet) Parse()

func (*FlagSet) StringVar

func (f *FlagSet) StringVar(p *string, name string, defValue string, usage string)

func (*FlagSet) Uint64Var

func (f *FlagSet) Uint64Var(p *uint64, name string, defValue uint64, usage string)

func (*FlagSet) UintVar

func (f *FlagSet) UintVar(p *uint, name string, defValue uint, usage string)

type OsdsDock

type OsdsDock struct {
	ApiEndpoint     string   `conf:"api_endpoint,localhost:50050"`
	EnabledBackends []string `conf:"enabled_backends,lvm"`
	Daemon          bool     `conf:"daemon,false"`
	Backends
}

type OsdsLet

type OsdsLet struct {
	ApiEndpoint string `conf:"api_endpoint,localhost:50040"`
	Graceful    bool   `conf:"graceful,true"`
	SocketOrder string `conf:"socket_order"`
	Daemon      bool   `conf:"daemon,false"`
}

type Value

type Value interface {
	Set(string) error
}

Jump to

Keyboard shortcuts

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