config

package
v0.0.0-...-9e98dbc Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	Enabled        bool
	APIKey         string
	MinDurationSec int
	MaxDurationSec int
}

type Config

type Config struct {
	Log    *LogConfig
	HTTP   *HTTPConfig
	Redict *RedictConfig

	Public *AppConfig

	Apps map[string]*AppConfig

	AppByAPIKey map[string]*AppConfig `yaml:"-" json:"-"`
}

func LoadConfigFromData

func LoadConfigFromData(data []byte) (*Config, error)

func LoadConfigFromFile

func LoadConfigFromFile(configPath string) (*Config, error)

type HTTPConfig

type HTTPConfig struct {
	Port int
}

type LogConfig

type LogConfig struct {
	Level      slog.Level
	Type       LogType
	ShowSource bool
}

type LogType

type LogType string
const (
	LogTypeText    LogType = "text"
	LogTypeJSON    LogType = "json"
	LogTypeColored LogType = "colored"
)

type RedictConfig

type RedictConfig struct {
	Address  string
	Password string
	DB       int
}

Jump to

Keyboard shortcuts

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