wcconfig

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsEmpty

func IsEmpty(c Config) bool

IsEmpty will compare the current instance of Config against an empty instance and return the result of the comparison

Types

type Config

type Config struct {
	WingCommander WingCommanderParameters `mapstructure:"wingcommander"`
	AppAnalytics  WingCommanderAnalytics  `mapstructure:"appanalytics"`
	Telegram      TelegramParameters      `mapstructure:"telegram"`
	Monitor       MonitorParameters       `mapstructure:"monitor"`
	SkyManager    SkyManagerParameters    `mapstructure:"skymanager"`
}

Config structure models the applications configuration structure

func LoadConfigParameters

func LoadConfigParameters(filename, pathname string, defaults map[string]interface{}) (config Config, err error)

LoadConfigParameters will load the applications configuration from the specified configuration file `filename` (note file extension must not be provided) in the specified path `pathname`. The function also provides the ability to specify configuration defaults. An `error` will be returned if any errors occur. A valid `Config` struct will be returned on success.

func (*Config) PrintConfig

func (c *Config) PrintConfig()

PrintConfig will log debug information for the passed Config structure

func (*Config) String

func (c *Config) String() string

String is the stringer function for the Config struct

type MonitorParameters

type MonitorParameters struct {
	IntervalSec            time.Duration `mapstructure:"intervalsec"`
	HeartbeatIntMin        time.Duration `mapstructure:"heartbeatintmin"`
	DiscoveryMonitorIntMin time.Duration `mapstructure:"discoverymonitorintmin"`
}

MonitorParameters struct defines the configuration parameters that are used by the Monitor which polls the SkyManager

type SkyManagerParameters

type SkyManagerParameters struct {
	Address          string `mapstructure:"address"`
	DiscoveryAddress string `mapstructure:"discoveryaddress"`
}

SkyManagerParameters struct defines the configuration parameters that are used to manage connectivity with the Skywire Manager

type TelegramParameters

type TelegramParameters struct {
	APIKey string `mapstructure:"apikey"`
	ChatID int64  `mapstructure:"chatid"`
	Admin  string `mapstructure:"admin"`
	Debug  bool   `mapstructure:"debug"`
}

TelegramParameters struct defines the configuration parameters that are used to manage Wing Commander application integrationw it Telegram

type WingCommanderAnalytics

type WingCommanderAnalytics struct {
	ClientUUID string `mapstructure:"clientuuid"`
	UserID     string `mapstructure:"userid"`
}

WingCommanderAnalytics struct defines the parameters that are used if Analytics is enabled

type WingCommanderParameters

type WingCommanderParameters struct {
	TwoFactorEnabled bool `mapstructure:"twofactorenabled"`
	AnalyticsEnabled bool `mapstructure:"analyticsenabled"`
}

WingCommanderParameters struct defines the configuration parameters that are used to manage runtime config for the Wing Commander application

Jump to

Keyboard shortcuts

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