config_manager

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ValidationErrorsConfigFile = ValidationErrors{
	"required":      "Field '%s' is required",
	"url":           "Field '%s' is not a valid URL",
	"fqdn":          "Field '%s' is not a valid FQDN",
	"existing_tld":  "Field '%s' contains an existing TLD domain.",
	"unique_routes": "Field '%s' contains duplicate route definitions.",

	"startswith": "Field '%s' must start with http://",
}

This is used for validating the config file

View Source
var ValidationErrorsGlobalAppInput = ValidationErrors{
	"required":      "Upstream cannot be empty",
	"url":           "Upstream is not a valid URL",
	"fqdn":          "Domain is not a valid FQDN",
	"existing_tld":  "Domain contains an existing TLD domain.",
	"unique_routes": "Domain is already defined in the global scope",
	"startswith":    "Upstream must start with http://",
}

Functions

func ConfigFileExists

func ConfigFileExists() bool

func CreateNewConfiguration

func CreateNewConfiguration(appName string, novusState novus.NovusState) error

func LoadConfigurationFromFile added in v0.0.5

func LoadConfigurationFromFile(novusState novus.NovusState) (config.NovusConfig, bool)

func LoadConfigurationFromState

func LoadConfigurationFromState(appName string, novusState novus.NovusState) config.NovusConfig

func ValidateConfig

func ValidateConfig(conf config.NovusConfig, validationErrors ValidationErrors) []string

func ValidateConfigDomainsUniqueness added in v0.0.5

func ValidateConfigDomainsUniqueness(conf config.NovusConfig, novusState novus.NovusState)

Types

type ValidationErrors added in v0.0.5

type ValidationErrors map[string]string

Jump to

Keyboard shortcuts

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