config

package
v0.3.10 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 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

	// NoAuth disables all authorization: /v1 requests validate without
	// bearer tokens, dashboard APIs skip session checks, and status
	// reports authenticated. Bootstrap state stays real: a fresh DB
	// still opens the account-creation page. Dev and AI debugging only —
	// never enable on shared or public instances.
	NoAuth bool

	// 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