config

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Debug              bool          `json:"debug" yaml:"debug"`   // 是否进入调试模式
	Remote             bool          `json:"remote" yaml:"remote"` // 是否开启远程接口获取IP信息
	Shell              bool          `json:"shell" yaml:"shell"`   // 是否支持本地SHELL模式
	Backup             string        `json:"backup" yaml:"backup"` // 是否支持审计模式
	Script             string        `json:"script" yaml:"script"` // 自动更新主机列表脚本, 只有Remote为false时生效
	Global             *ssh.Endpoint `json:"global" yaml:"global"` // global config
	endpoint.Endpoints `json:"endpoints" yaml:"endpoints"`
}

Config config

func Init

func Init() *Config

Init config init

func (*Config) Add

func (c *Config) Add(name, host, ip, port, user, password, key string) error

Add add

func (*Config) ConsoleAdd

func (c *Config) ConsoleAdd() error

ConsoleAdd ConsoleAdd

func (*Config) Dump

func (c *Config) Dump(f string) error

Dump config to a file

func (*Config) LoadConfig

func (c *Config) LoadConfig(f string) error

LoadConfig loadconfig form a file

func (*Config) LoadEndpointsConfig

func (c *Config) LoadEndpointsConfig() error

LoadEndpointsConfig load endpoints config

func (*Config) LoadRootConfig

func (c *Config) LoadRootConfig() error

LoadRootConfig load rot config

func (*Config) LoadUserConfig

func (c *Config) LoadUserConfig() error

LoadUserConfig load user config

func (*Config) UseGlobalValues

func (c *Config) UseGlobalValues()

UseGlobalValues UseGlobalValues

Jump to

Keyboard shortcuts

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