Register bottin.api.host
This commit is contained in:
parent
ee478c8f2a
commit
d2df4cd469
1 changed files with 15 additions and 2 deletions
|
@ -10,14 +10,21 @@ import (
|
|||
)
|
||||
|
||||
type Config struct {
|
||||
API APIConfig
|
||||
Web WebConfig
|
||||
API APIConfig
|
||||
Bottin BottinConfig
|
||||
Web WebConfig
|
||||
}
|
||||
|
||||
type APIConfig struct {
|
||||
Port int
|
||||
}
|
||||
|
||||
type BottinConfig struct {
|
||||
API struct {
|
||||
Host string
|
||||
}
|
||||
}
|
||||
|
||||
type WebConfig struct {
|
||||
Port int
|
||||
}
|
||||
|
@ -56,6 +63,12 @@ func RegisterFlags(cmd *cobra.Command) error {
|
|||
return err
|
||||
}
|
||||
|
||||
// bottin.api.host
|
||||
if err := RegisterString(cmd, true,
|
||||
"bottin.api.host", "bottin-api-host", "Bottin API server host", "localhost"); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// web.port ; --web-port
|
||||
cmd.PersistentFlags().Int("web-port", 3183, "Webserver port")
|
||||
if err := viper.BindPFlag("web.port", cmd.PersistentFlags().Lookup("web-port")); err != nil {
|
||||
|
|
Loading…
Reference in a new issue