Documentation ¶
Overview ¶
Package config contains logic for reading dpcmder configuration from commandline parameters, reading and writting configuration to dpcmder JSON configuration file and showing command line usage / help.
Index ¶
Constants ¶
const ( DpInterfaceSoma = "SOMA" DpInterfaceRest = "REST" DpInterfaceUnknown = "Unknown" )
List of DataPower management interfaces - returned by DpManagmentInterface().
const ( // PreviousApplianceName is name of configuration for the last appliance // configured with command-line parameters (without explicitly saving config). PreviousApplianceName = "_PreviousAppliance_" )
Variables ¶
var ( // LocalFolderPath is a folder where dpcmder starts showing files - set by command flag. LocalFolderPath *string // DebugLogFile/TraceLogFile enables writing of debug/trace messages to // dpcmder.log file in current folder. DebugLogFile *bool TraceLogFile *bool )
DataPower Commander command line parameters.
var Conf = Config{ Cmd: Command{ Viewer: "less", Editor: "vi", Diff: "diff"}, Log: Log{MaxEntrySize: logging.MaxEntrySize}, Sync: Sync{Seconds: 4}, DataPowerAppliances: make(map[string]DataPowerAppliance)}
Conf variable contains all configuration parameters for dpcmder. Here are default configuration values which will be merged with values read from JSON configuration file (if configuration file is found).
var CurrentApplianceName string
CurrentApplianceName stores configuration of current appliance name used.
var DpTransientPasswordMap = make(map[string]string)
DpTransientPasswordMap contains passwords entered through dpcmder dialogs, not saved to config during (other) configuration changes.
Functions ¶
Types ¶
type Config ¶
type Config struct { Cmd Command Log Log Sync Sync DataPowerAppliances map[string]DataPowerAppliance }
Config is a structure containing dpcmder configuration (saved to JSON).
func (*Config) CreateDpApplianceConfig ¶ added in v0.3.0
CreateDpApplianceConfig creates empty DataPower appliance JSON configuration as byte array.
func (*Config) DeleteDpApplianceConfig ¶ added in v0.2.1
DeleteDpApplianceConfig deletes DataPower appliance JSON configuration.
func (*Config) GetDpApplianceConfig ¶ added in v0.1.0
GetDpApplianceConfig fetches DataPower appliance JSON configuration as byte array.
type DataPowerAppliance ¶ added in v0.1.0
type DataPowerAppliance struct { RestUrl string SomaUrl string Username string Password string Domain string Proxy string }
DataPowerAppliance is a structure containing dpcmder DataPower appliance configuration details required to connect to appliances.
var CurrentAppliance DataPowerAppliance
CurrentAppliance stores configuration value of current appliance used.
func (*DataPowerAppliance) DpManagmentInterface ¶ added in v0.3.0
func (dpa *DataPowerAppliance) DpManagmentInterface() string
DpManagmentInterface returns management interface used to manage DataPower.
func (*DataPowerAppliance) DpPlaintextPassword ¶ added in v0.2.0
func (dpa *DataPowerAppliance) DpPlaintextPassword() string
DpPlaintextPassword fetches decoded password from DataPowerAppliance struct.
func (*DataPowerAppliance) SetDpPlaintextPassword ¶ added in v0.2.0
func (dpa *DataPowerAppliance) SetDpPlaintextPassword(password string)
SetDpPlaintextPassword sets encoded Password field on DataPowerAppliance from plaintext password.