config

package
v0.0.0-...-cdbd8f0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	LogLevel         *slog.LevelVar `yaml:"log_level"`
	Port             int            `yaml:"port"`
	Database         DatabaseConfig `yaml:"database"`
	ErrorsInResponse bool           `yaml:"errors_in_response"`
	IPRateLimit      rate.Limit     `yaml:"ip_rate_limit"`
	BurstRateLimit   int            `yaml:"burst_rate_limit"`
}

func LoadConfig

func LoadConfig() (*Config, error)

1. Load defaults 2. Load config file (lowest priority) first in the current directory, then in the home directory, then in the /etc directory 3. Override with environment variables 4. Override with command flags

type DatabaseConfig

type DatabaseConfig struct {
	Driver     string `yaml:"driver"`
	Source     string `yaml:"source"`
	Reset      bool   `yaml:"reset"`
	LogQueries bool   `yaml:"log_queries"`
}

Jump to

Keyboard shortcuts

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