config

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultEnvPrefix    = "APP_"
	DefaultEnvDelimiter = "__"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminConfig

type AdminConfig struct {
	BasePath      string `koanf:"base_path" json:"base_path" yaml:"base_path"`
	Title         string `koanf:"title" json:"title" yaml:"title"`
	DefaultLocale string `koanf:"default_locale" json:"default_locale" yaml:"default_locale"`
}

AdminConfig captures go-admin quickstart settings.

type AppConfig

type AppConfig struct {
	Name     string          `koanf:"name" json:"name" yaml:"name"`
	Env      string          `koanf:"env" json:"env" yaml:"env"`
	Server   ServerConfig    `koanf:"server" json:"server" yaml:"server"`
	Admin    AdminConfig     `koanf:"admin" json:"admin" yaml:"admin"`
	Auth     AuthConfig      `koanf:"auth" json:"auth" yaml:"auth"`
	Features map[string]bool `koanf:"features" json:"features" yaml:"features"`

	ConfigPath string `koanf:"-" json:"-" yaml:"-"`
}

AppConfig defines runtime configuration for the admin shell example.

func Defaults

func Defaults() *AppConfig

Defaults returns baseline example config values.

func Load

Load resolves configuration from struct defaults, optional file, and env variables.

func (AppConfig) Validate

func (c AppConfig) Validate() error

Validate satisfies go-config Validable.

type AuthConfig

type AuthConfig struct {
	SigningKey   string `koanf:"signing_key" json:"signing_key" yaml:"signing_key"`
	DemoUsername string `koanf:"demo_username" json:"demo_username" yaml:"demo_username"`
	DemoEmail    string `koanf:"demo_email" json:"demo_email" yaml:"demo_email"`
	DemoPassword string `koanf:"demo_password" json:"demo_password" yaml:"demo_password"`
}

AuthConfig captures go-auth demo identity settings.

type ServerConfig

type ServerConfig struct {
	Address     string `koanf:"address" json:"address" yaml:"address"`
	PrintRoutes bool   `koanf:"print_routes" json:"print_routes" yaml:"print_routes"`
}

ServerConfig captures transport options.

Jump to

Keyboard shortcuts

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