mirror of
https://github.com/safing/portbase
synced 2025-09-01 18:19:57 +00:00
Make api config key a const
This commit is contained in:
parent
61e689a513
commit
74736fafa8
1 changed files with 6 additions and 1 deletions
|
@ -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,
|
||||||
|
|
Loading…
Add table
Reference in a new issue