runtimeconfig

package
v0.0.0-...-804b954 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package runtimeconfig defines explicit, validated process configuration.

Index

Constants

View Source
const NtfyTopic = "https://ntfy.sh/0x63616c-ai-agant"

NtfyTopic is the only supported milestone notification topic.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizationSink

type AuthorizationSink interface {
	// SetBearerToken applies the secret directly to a transport boundary.
	SetBearerToken(string)
}

AuthorizationSink accepts a notifier bearer token without exposing it for diagnostics.

type Config

type Config struct {
	// Version is the validated configuration schema version.
	Version int
	// Notifier is the validated fixed-topic notifier configuration.
	Notifier NotifierConfig
}

Config is validated runtime configuration.

func New

func New(input Input) (Config, error)

New validates input once at the composition boundary.

func (Config) Diagnostics

func (c Config) Diagnostics() map[string]string

Diagnostics returns configuration that is safe to expose to authorized diagnostics.

func (Config) LogValue

func (c Config) LogValue() slog.Value

LogValue implements slog.LogValuer with only safe configuration values.

func (Config) String

func (c Config) String() string

String returns a redacted diagnostic representation of Config.

type Input

type Input struct {
	// Version selects the supported configuration schema.
	Version int
	// Notifier supplies explicit milestone notification configuration.
	Notifier NotifierInput
}

Input is explicit unvalidated runtime configuration from a composition root.

type NotifierConfig

type NotifierConfig struct {
	// Topic is the validated fixed notifier topic.
	Topic string
	// contains filtered or unexported fields
}

NotifierConfig is validated fixed-topic notifier configuration.

func (NotifierConfig) ApplyAuthorization

func (c NotifierConfig) ApplyAuthorization(sink AuthorizationSink)

ApplyAuthorization supplies the token only to an explicit notifier transport sink.

func (NotifierConfig) LogValue

func (c NotifierConfig) LogValue() slog.Value

LogValue implements slog.LogValuer with only safe notifier configuration values.

func (NotifierConfig) String

func (c NotifierConfig) String() string

String returns a redacted diagnostic representation of NotifierConfig.

type NotifierInput

type NotifierInput struct {
	// Topic optionally repeats the one allowlisted notifier topic.
	Topic string
	// AccessToken is passed only to an explicit authorization sink.
	AccessToken string
}

NotifierInput is the explicit notifier configuration supplied at startup.

Jump to

Keyboard shortcuts

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