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
This commit is contained in:
Travis 2021-07-08 13:18:43 -05:00
parent c9cb87130d
commit 3c7ee11ff3
No known key found for this signature in database
GPG key ID: 37080CC2042BA34E
2 changed files with 14 additions and 0 deletions

View file

@ -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")
}

View file

@ -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
}