Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Init ¶
Init initializes the configuration module and loads a JSON configuration. If JSON is not existing, a default configuration will be generated.
func Load ¶
Load reads a configuration from a file, de-serializes it and sets it as the global configuration
func Save ¶
func Save(conf *ManagerConfig, path string) error
Save serializes a given configuration and writes it to a file
func Set ¶
func Set(conf *ManagerConfig)
Set sets a passed configuration as the global configuration
Types ¶
type Database ¶
type Database struct { Connections int `json:"connections"` // Connections used by the manager component itself ConnectionsClient int `json:"connections_client"` // Connections allowed for any user client PasswordExpiryHours float64 `json:"password_expiry_hours"` // Exact expiry interval of user access token PasswordExpiry time.Duration `json:"-"` // TokenExpiryDays float64 `json:"token_expiry_days"` // Maximum allowed expiry interval for none user bound access token TokenExpiry time.Duration `json:"-"` }
func (*Database) UnmarshalJSON ¶
UnmarshalJSON reads a JSON file, validates values and populates the configuration struct
type ManagerConfig ¶
type ManagerConfig struct { // The root configuration object tying all configuration segments together. ListenAddress string `json:"listen_address"` PrivilegeSecrets []string `json:"privilege_secrets"` // Tokens granting the privilege to query full scope details, including scope secret and the scope's database credentials. E.g. the web backend does not require these details, in contrast to the broker. Database Database `json:"database"` Logging log.Settings `json:"logging"` ScanDefaults database.T_scan_settings `json:"scan_defaults"` }
func GetConfig ¶
func GetConfig() *ManagerConfig
GetConfig returns a pointer to the current global configuration.
Click to show internal directories.
Click to hide internal directories.