package config // The valid auth strategies and values for cookie handling const ( // These constants are used for external services auth (Prometheus ...) ; AuthTypeBasic = "basic" AuthTypeBearer = "bearer" AuthTypeNone = "none" ) // Auth provides authentication data for external services type Auth struct { CAFile string `yaml:"ca_file" mapstructure:"ca_file"` InsecureSkipVerify bool `yaml:"insecure_skip_verify" mapstructure:"insecure_skip_verify"` Password string `yaml:"password" mapstructure:"password"` Token string `yaml:"token" mapstructure:"token"` Type string `yaml:"type" mapstructure:"type"` Username string `yaml:"username" mapstructure:"username"` } func (a *Auth) Obfuscate() { a.Token = "xxx" a.Password = "xxx" a.Username = "xxx" a.CAFile = "xxx" } type ScheduleServer struct { Port int `yaml:"port,omitempty" mapstructure:"port"` Protocol string `yaml:"protocol,omitempty" mapstructure:"protocol"` // http https socket websocket Auth Auth `yaml:"auth,omitempty" mapstructure:"auth"` HeartBeat int64 `ini:"heart_beat" yaml:"heart_beat" mapstructure:"heart_beat"` } var Schedule = ScheduleServer{ Port: 1234, Protocol: "http", Auth: Auth{ Type: AuthTypeNone, }, HeartBeat: 30, }