config

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitEnv

func InitEnv()

func InitTokens

func InitTokens()

func Load

func Load()

func LoadConfig

func LoadConfig()

func LoadDefaults

func LoadDefaults()

func LoadDir

func LoadDir(path string, dir string, config *koanf.Koanf, parser koanf.Parser) error

func LoadEnv

func LoadEnv(config *koanf.Koanf) (koanf.Provider, error)

func LoadFile

func LoadFile(path string, config *koanf.Koanf, parser koanf.Parser) (koanf.Provider, error)

func LoadTokens

func LoadTokens()

func WatchFile

func WatchFile(path string, f *file.File)

Types

type ENV_

type ENV_ struct {
	CONFIG_PATH   string
	DEFAULTS_PATH string
	FAVICON_PATH  string
	TOKENS_DIR    string
	LOG_LEVEL     string
	PORT          string
	API_URL       string
	API_TOKENS    []string
	SETTINGS      map[string]*SETTING_
	INSECURE      bool
}
var ENV *ENV_ = &ENV_{
	CONFIG_PATH:   os.Getenv("CONFIG_PATH"),
	DEFAULTS_PATH: os.Getenv("DEFAULTS_PATH"),
	TOKENS_DIR:    os.Getenv("TOKENS_DIR"),
	FAVICON_PATH:  os.Getenv("FAVICON_PATH"),
	API_TOKENS:    []string{},
	SETTINGS:      map[string]*SETTING_{},
	INSECURE:      false,
}

type SETTING_

type SETTING_ struct {
	BLOCKED_ENDPOINTS []string                               `koanf:"blockedendpoints"`
	ALLOWED_ENDPOINTS []string                               `koanf:"allowedendpoints"`
	VARIABLES         map[string]any                         `koanf:"variables"`
	DATA_ALIASES      map[string][]middlewareTypes.DataAlias `koanf:"dataaliases"`
	MESSAGE_TEMPLATE  string                                 `koanf:"messagetemplate"`
}

type TOKEN_CONFIG_

type TOKEN_CONFIG_ struct {
	TOKENS    []string `koanf:"tokens"`
	OVERRIDES SETTING_ `koanf:"overrides"`
}

Jump to

Keyboard shortcuts

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