resolvers

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildTarget

func BuildTarget(client *ServerFinderConfig) (string, error)

func RegisterAllGrpcResolvers

func RegisterAllGrpcResolvers()

Types

type BasicAuth

type BasicAuth struct {
	Username     string `mapstructure:"username" yaml:"username"`
	Password     Secret `mapstructure:"password" yaml:"password,omitempty"`
	PasswordFile string `mapstructure:"password_file" yaml:"password_file,omitempty"`
}

BasicAuth contains basic HTTP authentication credentials.

type EndpointsAnalyzer

type EndpointsAnalyzer struct {
}

func (*EndpointsAnalyzer) GetAddresses

func (p *EndpointsAnalyzer) GetAddresses(cache map[string]*targetgroup.Group, config *KubernetesConfig) []string

func (*EndpointsAnalyzer) KindType

func (p *EndpointsAnalyzer) KindType() string

type ExtraPort

type ExtraPort struct {
	Port int `mapstructure:"port"`
}

type GrpcResolver

type GrpcResolver interface {
	resolver.Builder

	// Type of resolver
	Type() string
	// BuildTarget address by client config
	BuildTarget(c *ServerFinderConfig) (string, error)
}

type HTTPClientConfig

type HTTPClientConfig struct {
	// The HTTP basic authentication credentials for the targets.
	BasicAuth *BasicAuth `mapstructure:"basic_auth" yaml:"basic_auth,omitempty"`
	// The bearer token for the targets.
	BearerToken Secret `mapstructure:"bearer_token" yaml:"bearer_token,omitempty"`
	// The bearer token file for the targets.
	BearerTokenFile string `mapstructure:"bearer_token_file" yaml:"bearer_token_file,omitempty"`
	// HTTP proxy server to use to connect to the targets.
	ProxyURL string `mapstructure:"proxy_url" yaml:"proxy_url,omitempty"`
	// TLSConfig to use to connect to the targets.
	TLSConfig TLSConfig `mapstructure:"tls_config" yaml:"tls_config,omitempty"`
}

HTTPClientConfig configures an HTTP client.

type KindAddressAnalyzer

type KindAddressAnalyzer interface {
	KindType() string
	GetAddresses(cache map[string]*targetgroup.Group, config *KubernetesConfig) []string
}

type KindCache

type KindCache struct {
	// contains filtered or unexported fields
}

func (*KindCache) UpdateAddresses

func (w *KindCache) UpdateAddresses() error

type KubernetesConfig

type KubernetesConfig struct {
	// The kubernetes API server address, If not define means using in kubernetes mode to connect
	APIServer string `mapstructure:"api_server"`
	// Connect to API Server Config
	HTTPClientConfig HTTPClientConfig `mapstructure:",squash" yaml:",inline"`
	// Support to lookup namespaces
	Namespaces []string `mapstructure:"namespaces"`
	// The kind of api
	Kind string `mapstructure:"kind"`
	// The kind selector
	Selector Selector `mapstructure:"selector"`
	// How to get the address exported port
	ExtraPort ExtraPort `mapstructure:"extra_port"`
}

type PodAnalyzer

type PodAnalyzer struct {
}

func (*PodAnalyzer) GetAddresses

func (p *PodAnalyzer) GetAddresses(cache map[string]*targetgroup.Group, config *KubernetesConfig) []string

func (*PodAnalyzer) KindType

func (p *PodAnalyzer) KindType() string

type Secret

type Secret string

Secret special type for storing secrets.

type Selector

type Selector struct {
	Label string `mapstructure:"label" yaml:"label,omitempty"`
	Field string `mapstructure:"field" yaml:"field,omitempty"`
}

type ServerFinderConfig

type ServerFinderConfig struct {
	FinderType string `mapstructure:"finder_type"` // The gRPC server address finder type, support "static" and "kubernetes"
	// The gRPC server address, only works for "static" address finder
	ServerAddr string `mapstructure:"server_addr"`
	// The kubernetes config to lookup addresses, only works for "kubernetes" address finder
	KubernetesConfig *KubernetesConfig `mapstructure:"kubernetes_config"`
}

type ServiceAnalyzer

type ServiceAnalyzer struct {
}

func (*ServiceAnalyzer) GetAddresses

func (p *ServiceAnalyzer) GetAddresses(cache map[string]*targetgroup.Group, config *KubernetesConfig) []string

func (*ServiceAnalyzer) KindType

func (p *ServiceAnalyzer) KindType() string

type TLSConfig

type TLSConfig struct {
	// The CA cert to use for the targets.
	CAFile string `mapstructure:"ca_file" yaml:"ca_file,omitempty"`
	// The client cert file for the targets.
	CertFile string `mapstructure:"cert_file" yaml:"cert_file,omitempty"`
	// The client key file for the targets.
	KeyFile string `mapstructure:"key_file" yaml:"key_file,omitempty"`
	// Used to verify the hostname for the targets.
	ServerName string `mapstructure:"server_name" yaml:"server_name,omitempty"`
	// Disable target certificate validation.
	InsecureSkipVerify bool `mapstructure:"insecure_skip_verify" yaml:"insecure_skip_verify"`
}

TLSConfig configures the options for TLS connections.

Jump to

Keyboard shortcuts

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