config

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

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

Go to latest
Published: Apr 23, 2020 License: GPL-2.0 Imports: 7 Imported by: 6

Documentation

Index

Constants

View Source
const (
	BMC_HomeDir      = ".bmc"
	BMC_CFG_FileName = "bmc.json"
)

Variables

This section is empty.

Functions

func GetBMCCFGFile

func GetBMCCFGFile() string

func GetBMCHomeDir

func GetBMCHomeDir() string

func IsInitialized

func IsInitialized() bool

Types

type BMCConfig

type BMCConfig struct {
	MgtHttpPort   int             `json:"mgthttpport"`
	KeyPath       string          `json:"keypath"`
	CmdListenPort string          `json:"cmdlistenport"`
	PrivKey       *rsa.PrivateKey `json:"-"`
	PubKey        *rsa.PublicKey  `json:"-"`
	PKAddr        string          `json:"-"`
	RemoteServer  string          `json:"remoteserver"`
}

func GetBMCCfg

func GetBMCCfg() *BMCConfig

func LoadFromCfgFile

func LoadFromCfgFile(file string) *BMCConfig

func LoadFromCmd

func LoadFromCmd(initfromcmd func(cmdbc *BMCConfig) *BMCConfig) *BMCConfig

func PreLoad

func PreLoad() *BMCConfig

func (*BMCConfig) GetKeyPath

func (bc *BMCConfig) GetKeyPath() string

func (*BMCConfig) GetPrivKey

func (bc *BMCConfig) GetPrivKey() (priv *rsa.PrivateKey)

func (*BMCConfig) GetPubKey

func (bc *BMCConfig) GetPubKey() (pub *rsa.PublicKey)

func (*BMCConfig) InitCfg

func (bc *BMCConfig) InitCfg() *BMCConfig

func (*BMCConfig) Load

func (bc *BMCConfig) Load() *BMCConfig

func (*BMCConfig) Save

func (bc *BMCConfig) Save()

func (*BMCConfig) SetPrivKey

func (bc *BMCConfig) SetPrivKey(priv *rsa.PrivateKey)

func (*BMCConfig) SetPubKey

func (bc *BMCConfig) SetPubKey(pub *rsa.PublicKey)

Jump to

Keyboard shortcuts

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