config

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// KeyClusterUUID is the key for the cluster UUID in the configuration database.
	KeyClusterUUID = "cluster_uuid"
	// KeySecretKey is the key for the secret key in the configuration database.
	KeySecretKey = "secret_key"
)

Variables

View Source
var ErrConfigNotFound = errors.New("no config was found for this key")

ErrConfigNotFound is returned if no config with this key was found.

Functions

This section is empty.

Types

type Config

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

Config provides access to the persistent configuration stored in the database. It uses an RWLocker to ensure thread-safe access to configuration keys.

func New

func New(db database.Querier, rwLocker lock.RWLocker) *Config

New returns a new Config instance.

func (*Config) GetClusterUUID

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

GetClusterUUID returns the cluster UUID from the configuration.

func (*Config) GetSecretKey added in v0.7.0

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

GetSecretKey returns the secret key from the configuration.

func (*Config) SetClusterUUID

func (c *Config) SetClusterUUID(ctx context.Context, value string) error

SetClusterUUID stores the cluster UUID in the configuration.

func (*Config) SetSecretKey added in v0.7.0

func (c *Config) SetSecretKey(ctx context.Context, value string) error

SetSecretKey stores the secret key in the configuration.

Jump to

Keyboard shortcuts

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