config

package
v0.0.0-...-20be9f3 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModeDev = iota
	ModeProd
)

Variables

View Source
var ErrInvalidMode = errors.New("invalid mode")

Functions

This section is empty.

Types

type Config

type Config struct {
	Mode       Mode       `env:"MODE,required"`
	LogLevel   slog.Level `env:"LOG_LEVEL,required"`
	AppRoot    string     `env:"APP_ROOT,required"`
	ServerAddr string     `env:"SERVER_ADDR,required"`
}

func Load

func Load() (Config, error)

type Mode

type Mode int

func (Mode) MarshalText

func (m Mode) MarshalText() ([]byte, error)

func (*Mode) UnmarshalText

func (m *Mode) UnmarshalText(text []byte) error

Jump to

Keyboard shortcuts

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