config

package
v0.0.30 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

config contains the loggic around config files for Armaria. The config file is a simple toml file.

Index

Constants

This section is empty.

Variables

View Source
var ErrConfigMissing = errors.New("config missing")

ErrConfigMissing is returned when the config file is missing.

Functions

func UpdateConfig

func UpdateConfig(folderPath string, configPath string, update UpdateConfigCallback) error

UpdateConfig updates the current config. It will be created if it hasn't already been created.

Types

type Config

type Config struct {
	DB string `koanf:"db"`
}

Config is the configuration for Armaria.

func GetConfig

func GetConfig(configPath string) (Config, error)

GetConfig gets the current config. If the sentinel error ErrConfigMissing then it doesn't exist.

type UpdateConfigCallback

type UpdateConfigCallback func(config *Config)

UpdateConfigCallback is a callback to update the current config

Jump to

Keyboard shortcuts

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