config

package
v0.0.0-...-0fdad5e Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: Apache-2.0 Imports: 7 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 {
	// Server
	HostAndPort string `env:"RANGI_HOST_AND_PORT,default=:6532"`
	// Log
	LogLevel  string `env:"RANGI_LOG_LEVEL,default=info" validate:"oneof=debug info warn error"`
	LogFormat string `env:"RANGI_LOG_FROMAT,default=text" validate:"oneof=text json"`
	// Templates
	EnableTemplateDevelopment bool `env:"RANGI_ENABLE_TEMPLATE_DEVELOPMENT,default=false"`
	// Blueprints
	BlueprintsPath string `env:"RANGI_BLUEPRINTS_PATH"`
	// Database
	DatabaseType string `env:"RANGI_DATABASE_TYPE,default=sqlite3" validate:"oneof=sqlite3 postgresql"`
	// Sqlite3
	// Used to override the default file path
	Sqlite3DatabaseFile string `env:"RANGI_SQLITE3_DATABASE_FILE"`
	// Admin interface
	AdminItemsLimit int `env:"RANGI_ADMIN_ITEMS_LIMIT,default=50" validate:"gte=1,lte=200"`

	// Used to reference assets that are stored relative to the binary. TODO: Do we want to store everything relative to the binary as default behavior?
	ExecutableDir    string
	Logger           *slog.Logger
	DatabaseInstance *database.DB
	Validate         *validator.Validate
}

func New

func New() *Config

Jump to

Keyboard shortcuts

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