passthroughgateway

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildServerTLSConfig

func BuildServerTLSConfig(cfg *TLSConfig, clientCAFile string) (*tls.Config, error)

BuildServerTLSConfig creates a TLS config for the server with optional mTLS.

func BuildServerTLSConfigWithClientAuth

func BuildServerTLSConfigWithClientAuth(cfg *TLSConfig, clientCAFile string) (*tls.Config, error)

BuildServerTLSConfigWithClientAuth creates a TLS config for the server with optional client authentication.

func BuildUpstreamTLSConfig

func BuildUpstreamTLSConfig(cfg *TLSConfig, upstreamCAFile, upstreamCertFile, upstreamKeyFile string) (*tls.Config, error)

BuildUpstreamTLSConfig creates a TLS config for upstream connections with optional client certificate.

func NewLokiRouter

func NewLokiRouter(cfg *Config, logger logr.Logger) (*lokiRouter, error)

NewLokiRouter creates a new router that directs requests to the appropriate upstream.

Types

type Config

type Config struct {
	ListenAddr    string
	AdminAddr     string
	DefaultTenant string
	Loki          LokiConfig
	// Server TLS configuration
	TLSCertFile string
	TLSKeyFile  string
	// Client TLS configuration
	TLSClientCAFile string
	TLSClientAuth   string
	// Generic TLS configuration
	TLSMinVersion   string
	TLSMaxVersion   string
	TLSCipherSuites StringSlice
	TLSCurvePrefs   StringSlice
}

func (*Config) RegisterFlags

func (c *Config) RegisterFlags(f *flag.FlagSet)

RegisterFlags registers the configuration flags.

func (*Config) TLSEnabled

func (c *Config) TLSEnabled() bool

TLSEnabled returns true if TLS certificates are configured.

func (*Config) TLSOptions

func (c *Config) TLSOptions() *TLSConfig

TLSOptions returns the TLS configuration options.

func (*Config) Validate

func (c *Config) Validate() error

Validate checks that all required configuration is provided and valid.

type LokiConfig

type LokiConfig struct {
	DistributorEndpoint   string
	QueryFrontendEndpoint string
	Timeout               time.Duration
	CAFile                string
	CertFile              string
	KeyFile               string
}

type Server

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

func NewServer

func NewServer(cfg *Config, logger logr.Logger, reg prometheus.Registerer) (*Server, error)

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

func (*Server) Shutdown

func (s *Server) Shutdown() error

type StringSlice

type StringSlice []string

StringSlice is a custom flag type for comma-separated strings.

func (*StringSlice) Set

func (s *StringSlice) Set(value string) error

func (*StringSlice) String

func (s *StringSlice) String() string

type TLSConfig

type TLSConfig struct {
	MinVersion   string
	MaxVersion   string
	CipherSuites []string
	CurvePrefs   []string
	ClientAuth   string
}

Jump to

Keyboard shortcuts

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