datasource

package
v0.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2022 License: Apache-2.0 Imports: 6 Imported by: 1

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 (b *BasicAuth) GetPassword() (string, error)

func (*BasicAuth) UnmarshalJSON

func (b *BasicAuth) UnmarshalJSON(data []byte) error

func (*BasicAuth) UnmarshalYAML

func (b *BasicAuth) UnmarshalYAML(unmarshal func(interface{}) error) error

type BasicDatasource

type BasicDatasource struct {
	Kind    Kind `json:"kind" yaml:"kind"`
	Default bool `json:"default" yaml:"default"`
}

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 (b *HTTPAuth) UnmarshalJSON(data []byte) error

func (*HTTPAuth) UnmarshalYAML

func (b *HTTPAuth) UnmarshalYAML(unmarshal func(interface{}) error) error

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 (k *Kind) UnmarshalJSON(data []byte) error

func (*Kind) UnmarshalYAML

func (k *Kind) UnmarshalYAML(unmarshal func(interface{}) error) error

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL