config

package
v0.0.0-...-1858810 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: BSD-3-Clause Imports: 2 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 {
	DebugMode  bool       `env:"DEBUG_MODE" envDefault:"true"`
	Database   Database   `envPrefix:"DATABASE_"`
	FileSystem FileSystem `env:"FILE_SYSTEM_"`
	Server     Server     `envPrefix:"SERVER_"`
	Upload     Upload     `envPrefix:"UPLOAD_"`
}

func NewFromEnv

func NewFromEnv() (*Config, error)

type Database

type Database struct {
	Driver string `env:"DRIVER" envDefault:"sqlite3"`
	DSN    string `env:"DSN" envDefault:"test.db"`
}

type FileSystem

type FileSystem struct {
	BasePath string `env:"BASE_PATH" envDefault:"./tmp"`
}

type Server

type Server struct {
	Port                    string `env:"PORT" envDefault:":8000"`
	TimeoutGracefulShutdown int    `env:"GRACEFUL_SHUTDOWN_TIMEOUT" envDefault:"15"`
}

type Upload

type Upload struct {
	ChunkSize      int `env:"CHUNK_SIZE" envDefault:"500"` //in bytes
	MinutesTimeout int `env:"MINUTES_TIMEOUT" envDefault:"5"`
}

Jump to

Keyboard shortcuts

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