ncmcfg

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_CLI_PATH = "/usr/bin"
	NC_HOME_ENV      = "NC_HOME"
	DEFAULT_LXC_MTU  = 9000
)
View Source
const (
	DEFAULT_API_ADDR = "localhost:50056"
	DEFAULT_CONFIG   = "/etc/nc_module/nc_module.conf"
)

Variables

This section is empty.

Functions

func GetCliPathFromEnv

func GetCliPathFromEnv() string

Types

type Cfg

type Cfg struct {
	Config *Config
	Opts   *Opts
}

Cfg

func GetCfg

func GetCfg() *Cfg

func (*Cfg) Init

func (c *Cfg) Init() error

func (*Cfg) String

func (c *Cfg) String() string

type CliConfig

type CliConfig struct {
	Path    string `toml:"path"`
	LxcInit string `toml:"lxcinit"`
	Lxd     string `toml:"lxd"`
	Sys     string `toml:"sys"`
	Vty     string `toml:"vty"`
	GoBgp   string `toml:"gobgp"`
}

Config - cli

func (*CliConfig) GoBgpPath

func (c *CliConfig) GoBgpPath() string

func (*CliConfig) LxcInitPath

func (c *CliConfig) LxcInitPath() string

func (*CliConfig) LxdPath

func (c *CliConfig) LxdPath() string

func (*CliConfig) String

func (c *CliConfig) String() string

func (*CliConfig) SysPath

func (c *CliConfig) SysPath() string

func (*CliConfig) ToPath

func (c *CliConfig) ToPath(name string) string

func (*CliConfig) VtyPath

func (c *CliConfig) VtyPath() string

type Config

type Config struct {
	Global *GlobalConfig `toml:"global"`
	Frr    *FrrConfig    `toml:"frr"`
	Cli    *CliConfig    `toml:"cli"`
}

Config

func GetConfig

func GetConfig() *Config

func (*Config) Load

func (c *Config) Load(path string) error

func (*Config) String

func (c *Config) String() string

type FrrConfig

type FrrConfig struct {
	AutoRstart string `toml:"auto_restart"` // 'restart', 'reload' or others(no operation)
}

Config - FRR

func (*FrrConfig) String

func (c *FrrConfig) String() string

type GlobalConfig

type GlobalConfig struct {
	Persist bool   `toml:"persist"`
	LxcMtu  uint16 `toml:"lxc-mtu"`
}

Config - Global

func (*GlobalConfig) String

func (c *GlobalConfig) String() string

type Opts

type Opts struct {
	Path    string
	DryRun  bool
	Verbose bool
	Trace   bool
}

Options

func GetOpts

func GetOpts() *Opts

func (*Opts) Parse

func (o *Opts) Parse()

func (*Opts) String

func (o *Opts) String() string

Jump to

Keyboard shortcuts

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