Documentation
¶
Index ¶
Constants ¶
View Source
const ( BrowserHTTPAccess = "browser" ServerHTTPAccess = "server" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicAuth ¶
type BasicAuth struct {
Username string `json:"username" yaml:"username"`
Password string `json:"password" yaml:"password,omitempty"`
// PasswordFile is a path to a file that contains a password
PasswordFile string `json:"password_file" yaml:"password_file,omitempty"`
}
func (*BasicAuth) GetPassword ¶
func (*BasicAuth) UnmarshalJSON ¶
func (*BasicAuth) UnmarshalYAML ¶
type BasicDatasource ¶
type HTTPAccess ¶
type HTTPAccess string
func (*HTTPAccess) UnmarshalJSON ¶
func (h *HTTPAccess) UnmarshalJSON(data []byte) error
func (*HTTPAccess) UnmarshalYAML ¶
func (h *HTTPAccess) UnmarshalYAML(unmarshal func(interface{}) error) error
type HTTPAllowedEndpoint ¶
type HTTPAllowedEndpoint struct {
EndpointPattern common.Regexp `json:"endpoint_pattern" yaml:"endpoint_pattern"`
Method string `json:"method" yaml:"method"`
}
func (*HTTPAllowedEndpoint) UnmarshalJSON ¶
func (h *HTTPAllowedEndpoint) UnmarshalJSON(data []byte) error
func (*HTTPAllowedEndpoint) UnmarshalYAML ¶
func (h *HTTPAllowedEndpoint) UnmarshalYAML(unmarshal func(interface{}) error) error
type HTTPAuth ¶
type HTTPAuth struct {
InsecureTLS bool `json:"insecure_tls,omitempty" yaml:"insecure_tls,omitempty"`
BearerToken string `json:"bearer_token,omitempty" yaml:"bearer_token,omitempty"`
BasicAuth *BasicAuth `json:"basic_auth,omitempty" yaml:"basic_auth,omitempty"`
CaCert string `json:"ca_cert,omitempty" yaml:"ca_cert,omitempty"`
}
func (*HTTPAuth) UnmarshalJSON ¶
func (*HTTPAuth) UnmarshalYAML ¶
type HTTPConfig ¶
type HTTPConfig struct {
// URL is the url required to contact the datasource
URL *url.URL `json:"url" yaml:"url"`
// The way the UI will contact the datasource. Or through the Backend or directly.
// By default, Access is set with the value 'server'
Access HTTPAccess `json:"access,omitempty" yaml:"access,omitempty"`
// AllowedEndpoints is a list of tuple of http method and http endpoint that will be accessible.
// These parameters are only used when access is set to 'server'
AllowedEndpoints []HTTPAllowedEndpoint `json:"allowed_endpoints,omitempty" yaml:"allowed_endpoints,omitempty"`
// Auth is holding any security configuration for the http configuration.
// When defined, it's impossible to set the value of Access with 'browser'
Auth *HTTPAuth `json:"auth,omitempty" yaml:"auth,omitempty"`
// Headers can be used to provide additional header that needs to be forwarded when requesting the datasource
// When defined, it's impossible to set the value of Access with 'browser'
Headers map[string]string `json:"headers,omitempty" yaml:"headers,omitempty"`
}
func (*HTTPConfig) MarshalJSON ¶
func (h *HTTPConfig) MarshalJSON() ([]byte, error)
func (*HTTPConfig) MarshalYAML ¶
func (h *HTTPConfig) MarshalYAML() (interface{}, error)
func (*HTTPConfig) UnmarshalJSON ¶
func (h *HTTPConfig) UnmarshalJSON(data []byte) error
func (*HTTPConfig) UnmarshalYAML ¶
func (h *HTTPConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
type Kind ¶
type Kind string
const PrometheusKind Kind = "Prometheus"
func (*Kind) UnmarshalJSON ¶
func (*Kind) UnmarshalYAML ¶
type Prometheus ¶
type Prometheus struct {
BasicDatasource `json:",inline" yaml:",inline"`
HTTP HTTPConfig `json:"http" yaml:"http"`
}
func (*Prometheus) GetKind ¶
func (p *Prometheus) GetKind() Kind
func (*Prometheus) UnmarshalJSON ¶
func (p *Prometheus) UnmarshalJSON(data []byte) error
func (*Prometheus) UnmarshalYAML ¶
func (p *Prometheus) UnmarshalYAML(unmarshal func(interface{}) error) error
Click to show internal directories.
Click to hide internal directories.