config

package
v0.0.0-...-3e6b536 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GCThresholdPercent = 0.7 // GCThresholdPercent is the threshold for garbage collection

	GCLimit = 1024 * 1024 * 1024 // GCLimit is the limit for garbage collection

	MB = 1024 * 1024 // MB is the number of bytes in a megabyte

	SentryFlushTimeout = 2 * time.Second // SentryFlushTimeout is the timeout for flushing sentry

	NonceLength = 16 // NonceLength is the length of the nonce : 16 bytes * 8 bits/byte = 128 bits
)

Variables

This section is empty.

Functions

func GetCallbackURL

func GetCallbackURL() string

func GetConfigPath

func GetConfigPath(isDevelopment bool) string

func IsDevelopment

func IsDevelopment() bool

func IsProduction

func IsProduction() bool

Types

type AuthConfigStruct

type AuthConfigStruct struct {
	Discord       oauth.DiscordConfig
	Github        oauth.GithubConfig
	JWTSecret     string
	JWTHeaderLen  int
	JWTExpiration int
}

AuthConfigStruct is the auth configuration.

type Config

type Config struct {
	Auth   AuthConfigStruct
	Server ServerConfig
	Log    LogConfig
	Pgx    infrastructures.PgxConfig
}

func LoadConfig

func LoadConfig(filename string) (*Config, error)

LoadConfig loads the configuration from a file.

type LogConfig

type LogConfig struct {
	Level string
}

LogConfig holds the configuration for the logger.

func (*LogConfig) GetSlogLevel

func (logConfig *LogConfig) GetSlogLevel() slog.Level

type ServerConfig

type ServerConfig struct {
	Port        string
	AppVersion  string
	JaegerURL   string
	Host        string
	FrontendURL string
	LogLevel    string
}

ServerConfig holds the configuration for the server.

Jump to

Keyboard shortcuts

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