From d2df4cd4691d5594c1ba92dd7ef55fc308927d77 Mon Sep 17 00:00:00 2001 From: Victor Lacasse-Beaudoin Date: Sat, 16 Sep 2023 18:12:02 -0400 Subject: [PATCH] Register bottin.api.host --- config/config.go | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/config/config.go b/config/config.go index 61b0c6a..21ba7c0 100644 --- a/config/config.go +++ b/config/config.go @@ -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 {