From 3c7ee11ff3b80549033a9f290aabbaa6ddc9549f Mon Sep 17 00:00:00 2001 From: Travis Date: Thu, 8 Jul 2021 13:18:43 -0500 Subject: [PATCH] Add feature flag --future.rename to support rename to FeatureBase This commit adds a `Future` scope to the configuration options, and for the time being includes a single flag within that scope: `rename`. Usage: --future.rename The value is a boolean available internally at: m.Config.Future.Rename --- ctl/server.go | 3 +++ server/config.go | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/ctl/server.go b/ctl/server.go index 98472ea95..35db14f72 100644 --- a/ctl/server.go +++ b/ctl/server.go @@ -113,4 +113,7 @@ func BuildServerFlags(cmd *cobra.Command, srv *server.Command) { // Disk and Memory usage cache for ui/usage endpoint flags.Float64Var(&srv.Config.UsageDutyCycle, "usage-duty-cycle", srv.Config.UsageDutyCycle, "Sets the percentage of time that is spent recalculating the disk and memory usage cache. 100.0 for always-running, must be > 0.") + + // Future flags. + flags.BoolVar(&srv.Config.Future.Rename, "future.rename", false, "present application name as FeatureBase") } diff --git a/server/config.go b/server/config.go index e744b86e2..f278d790e 100644 --- a/server/config.go +++ b/server/config.go @@ -227,6 +227,14 @@ type Config struct { // The percentage of time spent recalculating the disk and memory usage cache. UsageDutyCycle float64 `toml:"usage-duty-cycle"` + + // Future flags are used to represent features or functionality which is not + // yet the default behavior, but will be in a future release. + Future struct { + // Rename, if true, will outwardly present the name of the application + // as FeatureBase instead of Pilosa. + Rename bool `toml:"rename"` + } `toml:"future"` } // MustValidate checks that all ports in a Config are unique and not zero. @@ -365,6 +373,9 @@ func NewConfig() *Config { // Disk and Memory Usage c.UsageDutyCycle = 20.0 + // Future flags. + c.Future.Rename = false + return c }