Make api config key a const

This commit is contained in:
Daniel 2020-04-24 09:52:11 +02:00
parent 61e689a513
commit 74736fafa8

View file

@ -7,6 +7,11 @@ import (
"github.com/safing/portbase/log" "github.com/safing/portbase/log"
) )
// Config Keys
const (
CfgDefaultListenAddressKey = "api/listenAddress"
)
var ( var (
listenAddressFlag string listenAddressFlag string
listenAddressConfig config.StringOption listenAddressConfig config.StringOption
@ -35,7 +40,7 @@ func getDefaultListenAddress() string {
func registerConfig() error { func registerConfig() error {
err := config.Register(&config.Option{ err := config.Register(&config.Option{
Name: "API Address", Name: "API Address",
Key: "api/listenAddress", Key: CfgDefaultListenAddressKey,
Description: "Define on which IP and port the API should listen on.", Description: "Define on which IP and port the API should listen on.",
Order: 128, Order: 128,
OptType: config.OptTypeString, OptType: config.OptTypeString,