http

package
v0.4.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ProxyKindName = "httpproxy"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AllowedEndpoint

type AllowedEndpoint struct {
	EndpointPattern common.Regexp `json:"endpointPattern" yaml:"endpointPattern"`
	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(any) error) error

type Config

type Config struct {
	// URL is the url required to contact the datasource
	URL *common.URL `json:"url" yaml:"url"`
	// Timeout is the maximum amount of time allowed to establish a connection to the datasource.
	// When not set or set to 0, Perses uses the connection timeout from its server configuration.
	Timeout common.DurationString `json:"timeout,omitempty" yaml:"timeout,omitempty"`
	// 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:"allowedEndpoints,omitempty" yaml:"allowedEndpoints,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"`
	// AllowHeaders lists the request headers that may be forwarded to the datasource.
	// All request headers not in the list are dropped.
	AllowHeaders []string `json:"allowHeaders,omitempty" yaml:"allowHeaders,omitempty"`
	// DropHeaders lists the request headers that must not be forwarded to the datasource.
	// If allowHeaders is specified, dropHeaders must be empty.
	DropHeaders []string `json:"dropHeaders,omitempty" yaml:"dropHeaders,omitempty"`
	// OauthPassthrough when set to true, current user's OIDC token will pass through to DataSource for auth.
	OauthPassthrough bool `json:"oauthPassthrough,omitempty" yaml:"oauthPassthrough,omitempty"`
}

func (*Config) UnmarshalJSON

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

func (*Config) UnmarshalYAML

func (h *Config) UnmarshalYAML(unmarshal func(any) error) error

type Proxy

type Proxy proxy.Proxy[Config]

Proxy is the HTTP proxy definition proposed in Perses. In case you are defining a datasource that will work with the Perses backend, then you will need to use this definition.

Jump to

Keyboard shortcuts

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