config

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultConfigPath = "nginx-wrapper.toml"

DefaultConfigPath is a best guess of a relative path that may contain the config file.

Variables

View Source
var CoreDefaults = map[string]interface{}{

	"env": envAsMap(os.Environ()),

	"host_id": hostID(),

	"last_reload_time": "not reloaded",

	"modules_path": "/usr/lib/nginx/modules",

	"nginx_binary": "nginx",

	"nginx_version": "unknown",

	"nginx_is_plus": false,

	"plugin_path": "./plugins",

	"enabled_plugins": []string{},

	"run_path": filepath.Clean(fs.TempDirectoryPath("nginx-wrapper")),

	"vcpu_count": runtime.NumCPU(),
}

CoreDefaults for the normal operation of nginx-wrapper.

View Source
var LogDefaults = map[string]interface{}{

	"level": "INFO",

	"destination": "STDOUT",

	"formatter_name": "TextFormatter",

	"formatter_options": TextFormatterOptionsDefaults,
}

LogDefaults for nginx-wrapper log settings.

View Source
var PluginDefaults = map[string]map[string]interface{}{}

PluginDefaults dynamically set defaults by plugins for plugins. This is a map of maps with each plugin getting its own map.

View Source
var TextFormatterOptionsDefaults = map[string]interface{}{

	"full_timestamp": true,

	"pad_level_text": true,
}

TextFormatterOptionsDefaults for text formatter log settings.

Functions

func AllKnownElements

func AllKnownElements(settings api.Settings, delimiter string) map[string]interface{}

AllKnownElements contain all known keys and their values from the passed Viper configuration instance formatted using the supplied delimiter to indicate sub-keys.

func DynamicCoreDefaults

func DynamicCoreDefaults(settings api.Settings) map[string]interface{}

DynamicCoreDefaults are defaults that depend on runtime settings.

func Keys

func Keys() []string

Keys contain all of the known default value keys.

func SubViperConfig

func SubViperConfig(settings api.Settings, subName string) *viper.Viper

SubViperConfig returns a new instance of viper.Viper which contains all of the values for the given key prefix. This function works around deficiencies in Viper's Sub() method.

Types

This section is empty.

Jump to

Keyboard shortcuts

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