config

package
v0.0.0-...-c7e2dc1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Any copy of this pointer is guaranteed to be consistent (immutable)

Functions

func InitializeConfiguration

func InitializeConfiguration()

Types

type Configuration

type Configuration struct {
	Policy struct {
		Directories      []string `default:"[\"./policies/\"]" json:"directories"`
		WatchDirectories bool     `default:"true" json:"watch_directories"`
		StrictMode       bool     `default:"true" json:"strict_mode"`
		PrintTo          string   `default:"stdout" json:"print_to"`
	} `json:"policy"`
	Reflection struct {
		Enabled bool `default:"true" json:"enabled"`
	} `json:"reflection"`
	Authorizer struct {
		IncludesMetrics bool `default:"false" json:"includes_metrics"`
		Listener        struct {
			Type    string `default:"unix" json:"type"`
			Address string `default:"./serve.sock" json:"address"`
		} `json:"listener"`
	} `json:"authorizer"`
	Metrics struct {
		Enabled  bool   `default:"true" json:"enabled"`
		Path     string `default:"/metrics" json:"path"`
		Listener struct {
			Type    string `default:"tcp" json:"type"`
			Address string `default:":9100" json:"address"`
		} `json:"listener"`
	} `json:"metrics"`
	Reload struct {
		Configuration bool `default:"true" json:"configuration"`
		Policies      bool `default:"true" json:"policies"`
		ReopenLogFile bool `default:"true" json:"reopen_log_file"`
	} `json:"reload"`
	Log struct {
		Filename string   `default:"stderr" json:"filename"`
		Level    string   `default:"info" json:"level"`
		Input    []string `default:"[]" json:"input"`
		Result   []string `default:"[\"ok\"]" json:"result"`
	} `json:"log"`
}

func DefaultConfiguration

func DefaultConfiguration() *Configuration

func LoadConfiguration

func LoadConfiguration() (*Configuration, error)

Thread safe: we atomically swap in the new ConfigurationPointer object; while we don't guarantee a winner, we do guarantee a valid ConfigurationPointer. We return the new Configuration that we Store()d in the ConfigurationPointer.

Jump to

Keyboard shortcuts

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