http

package
v0.38.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: Apache-2.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllowedEndpoint

type AllowedEndpoint struct {
	EndpointPattern common.Regexp `json:"endpoint_pattern" yaml:"endpoint_pattern"`
	Method          string        `json:"method" yaml:"method"`
}

func (*AllowedEndpoint) UnmarshalJSON

func (h *AllowedEndpoint) UnmarshalJSON(data []byte) error

func (*AllowedEndpoint) UnmarshalYAML

func (h *AllowedEndpoint) UnmarshalYAML(unmarshal func(interface{}) error) error

type Auth

type Auth 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 (*Auth) UnmarshalJSON

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

func (*Auth) UnmarshalYAML

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

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 Config

type Config struct {
	// URL is the url required to contact the datasource
	URL *url.URL `json:"url" yaml:"url"`
	// AllowedEndpoints is a list of tuple of http method and http endpoint that will be accessible.
	// If not set, then everything is accessible.
	AllowedEndpoints []AllowedEndpoint `json:"allowed_endpoints,omitempty" yaml:"allowed_endpoints,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"`
	// Secret is the name of the secret that should be used for the proxy or discovery configuration
	// It will contain any sensitive information such as password, token, certificate.
	Secret string `json:"secret,omitempty" yaml:"secret,omitempty"`
}

func ValidateAndExtract added in v0.12.0

func ValidateAndExtract(pluginSpec interface{}) (*Config, error)

func (Config) MarshalJSON

func (h Config) MarshalJSON() ([]byte, error)

func (Config) MarshalYAML

func (h Config) MarshalYAML() (interface{}, error)

func (*Config) UnmarshalJSON

func (h *Config) UnmarshalJSON(data []byte) error

func (*Config) UnmarshalYAML

func (h *Config) UnmarshalYAML(unmarshal func(interface{}) error) error

type Proxy

type Proxy struct {
	Kind string `json:"kind" yaml:"kind"`
	Spec Config `json:"spec" yaml:"spec"`
}

Jump to

Keyboard shortcuts

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