config

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package config manages RouterConfiguration persisted in the instance_settings row: the configuration columns plus the bootstrapped flag.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service manages RouterConfiguration.

func New

func New(sqlite *db.Database) *Service

New constructs a config Service on the SQLite handle.

func (*Service) GetSettings added in v0.4.0

func (s *Service) GetSettings(ctx context.Context) (models.RouterConfiguration, error)

GetSettings returns the stored RouterConfiguration from instance_settings. A missing row returns the zero configuration, matching the previous behavior.

func (*Service) IsBootstrapped added in v0.4.0

func (s *Service) IsBootstrapped(ctx context.Context) (bool, error)

IsBootstrapped reports the instance_settings bootstrapped flag. A missing row reads false: unknown state never reports bootstrapped.

func (*Service) PutSettings added in v0.4.0

func (s *Service) PutSettings(ctx context.Context, configuration models.RouterConfiguration) error

PutSettings validates and persists RouterConfiguration to instance_settings. The bootstrapped flag survives the write: one transaction reads the row and upserts the merged record through the transaction handle only.

func (*Service) SetBootstrapped added in v0.4.0

func (s *Service) SetBootstrapped(ctx context.Context) error

SetBootstrapped marks the instance bootstrapped and preserves the stored configuration columns. One transaction, transaction handle only.

func (*Service) SetLogger added in v0.4.0

func (s *Service) SetLogger(l *slog.Logger)

SetLogger wires structured logging.

Jump to

Keyboard shortcuts

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