runtimeconfig

package
v0.220.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package runtimeconfig loads non-policy process settings for server and MCP operations. input: optional YAML runtime config path output: structured runtime Config for logging and metadata settings pos: infrastructure adapter for runtime configuration loading note: if this file changes, update this header and module README.md.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseConnectTimeout

func ParseConnectTimeout(raw string) (time.Duration, bool, error)

ParseConnectTimeout parses a duration string for metadata connect timeout. Empty string and zero duration return (0, false, nil) indicating "use default". Positive durations return (duration, true, nil). Negative or invalid durations return an error.

Types

type Config

type Config struct {
	Logging  LoggingConfig  `yaml:"logging"`
	Metadata MetadataConfig `yaml:"metadata"`
}

Config holds runtime (non-policy) process settings.

func Load

func Load(path string) (Config, error)

Load reads a runtime config YAML file. An empty path returns a zero Config. Unknown YAML fields are rejected. Read and parse errors include the path.

type LoggingConfig

type LoggingConfig struct {
	Level  string       `yaml:"level"`
	Format string       `yaml:"format"`
	Output string       `yaml:"output"`
	File   string       `yaml:"file"`
	Rotate RotateConfig `yaml:"rotate"`
}

LoggingConfig controls structured logging behavior.

type MetadataConfig

type MetadataConfig struct {
	ConnectTimeout string `yaml:"connect_timeout"`
}

MetadataConfig controls metadata connection behavior.

type RotateConfig

type RotateConfig struct {
	Enabled    *bool `yaml:"enabled"`
	MaxSizeMB  *int  `yaml:"max_size_mb"`
	MaxBackups *int  `yaml:"max_backups"`
	MaxAgeDays *int  `yaml:"max_age_days"`
	Compress   *bool `yaml:"compress"`
}

RotateConfig controls log file rotation settings. Pointer fields distinguish "unset" from "explicit zero".

Jump to

Keyboard shortcuts

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