Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ConfigurationPointer *atomic.Pointer[Configuration] = &atomic.Pointer[Configuration]{}
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.
Click to show internal directories.
Click to hide internal directories.