conf

package
v0.0.0-...-3ebaacc Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: LGPL-2.1 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collectors

type Collectors struct {
	Name         string `toml:"name"`
	SyncInterval uint64 `toml:"sync-interval"`
	Disabled     bool   `toml:"disabled"`
}

Collectors struct defines the structure of collectors configuration

type Config

type Config struct {
	*Globals       `toml:"globals"`
	CollectorsConf map[string]Collectors `toml:"collectors"`
}

Config struct defines overall configurations it embeds 'Globals' configuration

func LoadConfig

func LoadConfig(confFilePath string) (conf *Config, err error)

LoadConfig loads the configuration file

func (*Config) GConfig

func (conf *Config) GConfig() *GConfig

GConfig method helps 'Config' objects to implement 'GConfigInterface'

type GConfig

type GConfig struct {
	GlusterMgmt         string `toml:"gluster-mgmt"`
	Glusterd2Endpoint   string `toml:"gd2-rest-endpoint"`
	GlusterCmd          string `toml:"gluster-binary-path"`
	GlusterRemoteHost   string `toml:"gd1-remote-host"`
	GlusterGlusterdSock string `toml:"gd1-glusterd-sock"`
	GlusterdWorkdir     string `toml:"glusterd-dir"`
	GlusterClusterID    string `toml:"gluster-cluster-id"`
	Glusterd2User       string
	Glusterd2Secret     string
	Glusterd2Cacert     string
	Glusterd2Insecure   bool
	Timeout             int64
}

GConfig represents Glusterd1/Glusterd2 configurations

func GConfigFromInterface

func GConfigFromInterface(iFace interface{}) (*GConfig, error)

GConfigFromInterface method returns a 'GConfig' pointer, if and only if the argument interface implements 'GConfigInterface'

type GConfigInterface

type GConfigInterface interface {
	GConfig() *GConfig
}

GConfigInterface enables to get configuration, with which the gluster management objects are created. Should be implemented by both GD1 and GD2.

type Globals

type Globals struct {
	Port              int      `toml:"port"`
	MetricsPath       string   `toml:"metrics-path"`
	LogDir            string   `toml:"log-dir"`
	LogFile           string   `toml:"log-file"`
	LogLevel          string   `toml:"log-level"`
	CacheTTL          uint64   `toml:"cache-ttl-in-sec"`
	CacheEnabledFuncs []string `toml:"cache-enabled-funcs"`
	*GConfig
}

Globals maintains the global system configurations

Jump to

Keyboard shortcuts

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