config

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package config holds the runtime configuration populated from CLI flags.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// DashboardAddr is the address the dashboard HTTP server binds to (e.g. "localhost:8080").
	DashboardAddr string

	// APIAddr is the address the /v1 OpenAI-compatible API binds to (e.g. "localhost:8081").
	APIAddr string

	// DBPath is the path to the bbolt database file.
	DBPath string

	// LogLevel controls slog verbosity.
	LogLevel LogLevel

	// TestingKeyPath is the path to the file holding the ephemeral testing bearer token.
	// Empty means the feature is disabled.
	TestingKeyPath string

	// TestingKey is the raw testing token value (never persisted to DB, never logged).
	TestingKey string

	// DevUIRedirect, when non-empty, is the origin (e.g. "http://localhost:8080")
	// that the dashboard 302-redirects browser navigations to instead of
	// serving its own embedded SPA. Set only by `make start` (via
	// --dev-ui-redirect) in dev; empty disables the redirect — the normal/production behavior.
	DevUIRedirect string
}

Config is the central runtime configuration for llm-router. All values originate from CLI flags — there is no config file.

func (*Config) Validate

func (c *Config) Validate() error

Validate checks that all required configuration fields are set.

type LogLevel

type LogLevel string

LogLevel controls slog verbosity. Implements pflag.Value.

const (
	LogLevelDebug LogLevel = "debug"
	LogLevelInfo  LogLevel = "info"
	LogLevelWarn  LogLevel = "warn"
	LogLevelError LogLevel = "error"
)

func (*LogLevel) Set

func (l *LogLevel) Set(s string) error

func (LogLevel) SlogLevel

func (l LogLevel) SlogLevel() slog.Level

SlogLevel returns the slog.Level for this LogLevel.

func (*LogLevel) String

func (l *LogLevel) String() string

func (*LogLevel) Type

func (l *LogLevel) Type() string

type Port

type Port uint16

Port is a TCP port number (1-65535). Implements pflag.Value.

func (*Port) Set

func (p *Port) Set(s string) error

func (*Port) String

func (p *Port) String() string

func (*Port) Type

func (p *Port) Type() string

Jump to

Keyboard shortcuts

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