Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewValidator ¶
NewValidator returns a new validator with our custom validations already registered.
Types ¶
type ProxyConfig ¶
type ProxyConfig struct {
AcmHub string `validate:"required,alphanumhyphen,lowercase"`
AuthBaseUrl string `validate:"required,url"`
AuthClientId string `validate:"required,alphanumhyphen"`
AuthClientSecret string `validate:"required,ascii"`
AuthRealm string `validate:"required,alphanumhyphen"`
AuthTlsVerify bool `validate:"boolean"`
ClusterKey string `validate:"required,alphanum"`
CorsAllowedOrigins []string `validate:"dive,url|eq=*"`
HubKey string `validate:"required,alphanum"`
ProjectKey string `validate:"required,alphanum"`
PrometheusBaseUrl string `validate:"required,url,startswith=http:|startswith=https:"`
PrometheusCaCert string `validate:"omitempty,file"`
PrometheusTlsCert string `validate:"omitempty,file"`
PrometheusTlsKey string `validate:"omitempty,file"`
PrometheusToken string `validate:"omitempty,ascii"`
OpenshiftLocal bool `validate:"boolean"`
}
ProxyConfig holds our configuration values and defines our validations for those values.
func BuildFromViper ¶
func BuildFromViper(v ViperInterface) *ProxyConfig
BuildFromViper creates a new ProxyConfig instance from viper configuration values (which may come from the command line or the environment).
func (*ProxyConfig) Validate ¶
func (c *ProxyConfig) Validate() error
Runs a validator against the values contained in a ProxyConfig variable.
Click to show internal directories.
Click to hide internal directories.