Package HTTP Server :

- Add tag for new config options : Disabled, Mandatory, TimeoutCacheInfo, TimeoutCacheHealth, HandlerKeys, TLSMandatory
This commit is contained in:
Nicolas JUHEL
2021-03-05 16:15:38 +01:00
parent 456ddd0c93
commit db2db3e78a

View File

@@ -134,16 +134,16 @@ type ServerConfig struct {
getParentContext func() context.Context
// Enabled allow to disable a server without clean his configuration
Disabled bool
Disabled bool `mapstructure:"disabled" json:"disabled" yaml:"disabled" toml:"disabled" validate:"required"`
// Mandatory defined if the component for status is mandatory or not
Mandatory bool
Mandatory bool `mapstructure:"mandatory" json:"mandatory" yaml:"mandatory" toml:"mandatory" validate:"required"`
// TimeoutCacheInfo defined the validity time of cache for info (name, version, hash)
TimeoutCacheInfo time.Duration
TimeoutCacheInfo time.Duration `mapstructure:"timeout_cache_info" json:"timeout_cache_info" yaml:"timeout_cache_info" toml:"timeout_cache_info"`
// TimeoutCacheHealth defined the validity time of cache for healthcheck of this server
TimeoutCacheHealth time.Duration
TimeoutCacheHealth time.Duration `mapstructure:"timeout_cache_health" json:"timeout_cache_health" yaml:"timeout_cache_health" toml:"timeout_cache_health"`
/*** http options ***/
@@ -234,10 +234,10 @@ type ServerConfig struct {
// HandlerKeys is an options to associate current server with a specifc handler defined by the key
// This allow to defined multiple server in only one config for different handler to start multiple api
HandlerKeys string
HandlerKeys string `mapstructure:"handler_keys" json:"handler_keys" yaml:"handler_keys" toml:"handler_keys"`
// TLSMandatory is a flag to defined that TLS must be valid to start current server.
TLSMandatory bool
TLSMandatory bool `mapstructure:"tls_mandatory" json:"tls_mandatory" yaml:"tls_mandatory" toml:"tls_mandatory" validate:"required"`
// TLS is the tls configuration for this server.
// To allow tls on this server, at least the TLS Config option InheritDefault must be at true and the default TLS config must be set.