config

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 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 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 Handler added in v0.13.0

type Handler struct {
	sync.RWMutex
	Config *Config
}

func (*Handler) GetConfig added in v0.13.0

func (ch *Handler) GetConfig() *Config

func (*Handler) ReloadConfig added in v0.13.0

func (ch *Handler) ReloadConfig(f string, logger *slog.Logger) error

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