config

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthModule

type AuthModule struct {
	Type     string   `yaml:"type"`
	UserPass UserPass `yaml:"userpass,omitempty"`
	// Add alternative auth modules here
	Options map[string]string `yaml:"options"`
}

func (AuthModule) ConfigureTarget

func (m AuthModule) ConfigureTarget(target string) (DSN, error)

type Config

type Config struct {
	AuthModules map[string]AuthModule `yaml:"auth_modules"`
}

type ConfigHandler

type ConfigHandler struct {
	sync.RWMutex
	Config *Config
}

func (*ConfigHandler) GetConfig

func (ch *ConfigHandler) GetConfig() *Config

func (*ConfigHandler) ReloadConfig

func (ch *ConfigHandler) ReloadConfig(f string, logger log.Logger) error

type DSN

type DSN struct {
	// contains filtered or unexported fields
}

DSN represents a parsed datasource. It contains fields for the individual connection components.

func (DSN) GetConnectionString

func (d DSN) GetConnectionString() string

GetConnectionString returns the URL to pass to the driver for database connections. This value should not be logged.

func (DSN) String

func (d DSN) String() string

String makes a dsn safe to print by excluding any passwords. This allows dsn to be used in strings and log messages without needing to call a redaction function first.

type UserPass

type UserPass struct {
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

Jump to

Keyboard shortcuts

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