config

package
v0.0.0-...-2557dda Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package config defines the Aetherel configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	Debug     bool
	SSL       bool   `default:"true"`
	Port      uint32 `default:"3000"`
	ProxyPort uint32
	Host      string
	URL       string
	Name      string
	Env       AppEnv `default:"prod"`
	Version   string
}

type AppEnv

type AppEnv string
const (
	AppEnvDev        AppEnv = "dev"
	AppEnvProduction AppEnv = "prod"
)

type Config

type Config struct {
	App            AppConfig
	Database       DatabaseConfig
	Log            LogConfig
	OAuthProviders map[string]OauthProviderConfig `mapstructure:"OAUTH"`
}

func Load

func Load(configFS embed.FS, dotenvFiles ...string) (*Config, error)

func (Config) BaseURL

func (c Config) BaseURL() string

func (*Config) IsTest

func (c *Config) IsTest() bool

type DatabaseConfig

type DatabaseConfig struct {
	URL    string
	Schema string
}

type LogConfig

type LogConfig struct {
	Format  LogFormat `default:"json"`
	Level   LogLevel
	Verbose bool
}

type LogFormat

type LogFormat string
const (
	LogFormatPlaintext LogFormat = "plaintext"
	LogFormatJSON      LogFormat = "json"
)

type LogLevel

type LogLevel string
const (
	LogLevelDebug LogLevel = "DEBUG"
	LogLevelInfo  LogLevel = "INFO"
	LogLevelWarn  LogLevel = "WARN"
	LogLevelError LogLevel = "ERROR"
)

func (LogLevel) ToSlog

func (l LogLevel) ToSlog() slog.Level

type OauthProviderConfig

type OauthProviderConfig struct {
	ID            string
	Secret        string
	Scope         []string
	AuthURL       string
	TokenURL      string
	DeviceAuthURL string `default:""`
	UserURL       string
}

Jump to

Keyboard shortcuts

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