config

package
v0.0.0-...-97394dd Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package config contains CLI configuration components.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackendMap

type BackendMap map[*regexp.Regexp]*pgconn.Config

BackendMap matches incoming principals to database connection configurations.

type Cache

type Cache struct {
	*Config

	Backends   BackendMap
	Discovery  *url.URL
	PublicKeys []crypto.PublicKey
	TLSConfig  *tls.Config
}

A Cache wraps a Config to save expensive computations and network fetching. Configuration reloading can be accomplished by simply discarding and recreating the Cache.

type Config

type Config struct {
	BindAddr string // Address to bind the proxy to.

	GracePeriod      time.Duration // The amount of time to wait for open connections to drain.
	JwtField         string        // The JWT claim field to use when selecting a backend.
	MetricsAddr      string        // Address to bind the prometheus metrics server to.
	Refresh          time.Duration // Duration between refreshing configuration data.
	ReportRemoteAddr bool          // If true, add a crdb:remote_addr connection param.
	// contains filtered or unexported fields
}

Config encapsulates the command-line configurations and the logic necessary to make those values usable.

func (*Config) Bind

func (c *Config) Bind(f *pflag.FlagSet)

Bind adds flags to the set.

func (*Config) Cache

func (c *Config) Cache(ctx context.Context) (*Cache, error)

Cache returns a memoized view of the Config.

Jump to

Keyboard shortcuts

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