config

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package config loads and validates application configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(path string) mo.Result[*Config]

Load resolves configuration from defaults, environment variables, and an optional file.

Types

type AppConfig

type AppConfig struct {
	Name string `json:"name" mapstructure:"name" yaml:"name"`
	Env  string `json:"env" mapstructure:"env" yaml:"env"`
}

AppConfig contains application identity and environment settings.

type Config

type Config struct {
	App     AppConfig     `json:"app" mapstructure:"app" yaml:"app"`
	Logging LoggingConfig `json:"logging" mapstructure:"logging" yaml:"logging"`
}

Config is the fully resolved application configuration.

func (*Config) IsDev

func (c *Config) IsDev() bool

IsDev reports whether the application is running in development mode.

func (*Config) Validate

func (c *Config) Validate() error

Validate ensures the configuration is internally consistent.

type LoggingConfig

type LoggingConfig struct {
	Level  string `json:"level" mapstructure:"level" yaml:"level"`
	Format string `json:"format" mapstructure:"format" yaml:"format"`
}

LoggingConfig contains runtime logging settings.

Jump to

Keyboard shortcuts

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