config

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: Apache-2.0 Imports: 12 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"`
}

func DecodeConfig added in v0.20.0

func DecodeConfig(r io.Reader) (*Config, error)

func LoadConfig added in v0.20.0

func LoadConfig(f string) (*Config, 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 Handler added in v0.13.0

type Handler struct {
	sync.RWMutex
	Config *Config
	// contains filtered or unexported fields
}

func NewHandler added in v0.20.0

func NewHandler(registerer prometheus.Registerer) (*Handler, error)

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

func (*Handler) SetConfig added in v0.20.0

func (ch *Handler) SetConfig(config *Config)

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