auditopt

package
v0.0.0-...-05145c8 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2022 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Overview

Package auditopt configures a client by looking three locations to determine the config variables:

  1. env vars
  2. a config file
  3. 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

View Source
const DefaultConfigFilePath = "/etc/lumberjack/config.yaml"

Variables

This section is empty.

Functions

func FromConfigFile

func FromConfigFile(ctx context.Context, path string) audit.Option

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.

Jump to

Keyboard shortcuts

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