Documentation
¶
Overview ¶
Package auditopt configures a client by looking three locations to determine the config variables:
- env vars
- a config file
- defaults
Each location takes precedence on the one below it. For example, if you set the config variable `FOO` in both env vars and a config file, the env var value overwrites the config file value.
Usually, auditopt should be used once on program initialization (e.g. in main.go). For example, in main.go:
opts, err := auditopt.FromConfigFile("path/to/config.yaml") if err != nil { // Handle err } client, err := audit.NewClient(opts...) if err != nil { // Handle err }
Index ¶
Constants ¶
const DefaultConfigFilePath = "/etc/lumberjack/config.yaml"
Variables ¶
This section is empty.
Functions ¶
func FromConfigFile ¶
FromConfigFile specifies a config file to configure the audit client. If `path` is nil, we use a default well known path. If the config file is not found, we keep going by using env vars and default values to configure the client.
func InterceptorFromConfigFile ¶
func InterceptorFromConfigFile(ctx context.Context, path string) audit.InterceptorOption
InterceptorFromConfigFile returns an interceptor option from the given config file. The returned option can be used to create an interceptor to add capability to gRPC server.
Types ¶
This section is empty.