config

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(key, def string) string

Get returns the value of the environment variable `key` if set. If not set, and `key + "_FILE"` is set, the file at that path is read and its trimmed contents are returned. If neither are set, def is returned.

func GetBool

func GetBool(key string, def bool) bool

GetBool returns the boolean value of the environment variable `key`. Recognised true values are: 1, t, true, y, yes (case-insensitive). Recognised false values are: 0, f, false, n, no.

func GetConversionOutputFormat added in v1.7.0

func GetConversionOutputFormat() string

GetConversionOutputFormat returns the preferred output format (pdf or epub). It checks for CONVERSION_OUTPUT_FORMAT environment variable and validates the value. Valid values are "pdf" and "epub" (case-insensitive). Defaults to "epub" if unset or invalid.

func GetDuration added in v1.4.1

func GetDuration(key string, def time.Duration) time.Duration

GetDuration returns the duration value of the environment variable `key`. It uses ParseDuration and falls back to def if parsing fails or the variable is unset.

func GetInt

func GetInt(key string, def int) int

GetInt returns the integer value of the environment variable `key`. It parses the result of Get(key, ""). If parsing fails or the variable is unset, def is returned.

func ParseDuration added in v1.4.1

func ParseDuration(s string) (time.Duration, error)

ParseDuration parses a duration string. It behaves like time.ParseDuration but also supports values like "30d" to represent days.

Types

This section is empty.

Jump to

Keyboard shortcuts

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