config

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Address string `env:"ADDRESS,default=0.0.0.0:5001"`
}

type Config

type Config struct {
	DB      DB      `env:",prefix=DB_"`
	Logging Logging `env:",prefix=LOGGING_"`
	API     API     `env:",prefix=API_"`
	UI      UI      `env:",prefix=UI_"`
	PDF     PDF     `env:",prefix=PDF_"`
}

func NewConfig

func NewConfig(ctx context.Context) (Config, error)

type DB

type DB struct {
	Path string `env:"PATH,default=./db"`
}

type Logging

type Logging struct {
	Debug bool `env:"DEBUG"`
}

type PDF

type PDF struct {
	Landscape  bool    `env:"LANDSCAPE,default=false"`
	Grayscale  bool    `env:"GRAYSCALE,default=false"`
	MediaPrint bool    `env:"MEDIA_PRINT,default=true"`
	Zoom       float64 `env:"ZOOM,default=1"`
	Viewport   string  `env:"VIEWPORT,default=1280x720"`
	DPI        uint    `env:"DPI,default=150"`
	Filename   string  `env:"FILENAME,default=page.pdf"`
}

type UI added in v0.1.3

type UI struct {
	Enabled bool   `env:"ENABLED,default=true"`
	Prefix  string `env:"PREFIX,default=/"`
	Theme   string `env:"THEME,default=basic"`
}

Jump to

Keyboard shortcuts

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