mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-10 06:42:45 +02:00
config: add runtime flags (#5050)
This commit is contained in:
parent
be9bfd9c3f
commit
e7b3d3b6e9
11 changed files with 372 additions and 214 deletions
24
config/runtime_flags.go
Normal file
24
config/runtime_flags.go
Normal file
|
@ -0,0 +1,24 @@
|
|||
package config
|
||||
|
||||
import "golang.org/x/exp/maps"
|
||||
|
||||
// RuntimeFlagGRPCDatabrokerKeepalive enables gRPC keepalive to the databroker service
|
||||
var RuntimeFlagGRPCDatabrokerKeepalive = runtimeFlag("grpc_databroker_keepalive", false)
|
||||
|
||||
// RuntimeFlag is a runtime flag that can flip on/off certain features
|
||||
type RuntimeFlag string
|
||||
|
||||
// RuntimeFlags is a map of runtime flags
|
||||
type RuntimeFlags map[RuntimeFlag]bool
|
||||
|
||||
func runtimeFlag(txt string, def bool) RuntimeFlag {
|
||||
key := RuntimeFlag(txt)
|
||||
defaultRuntimeFlags[key] = def
|
||||
return key
|
||||
}
|
||||
|
||||
var defaultRuntimeFlags = map[RuntimeFlag]bool{}
|
||||
|
||||
func DefaultRuntimeFlags() RuntimeFlags {
|
||||
return maps.Clone(defaultRuntimeFlags)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue