Documentation
¶
Overview ¶
Package handlers provides reverse proxy handlers for each datasource type.
Index ¶
Constants ¶
const DatasourceHeader = "X-Datasource"
DatasourceHeader is the HTTP header used to specify which datasource to route to.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClickHouseConfig ¶
type ClickHouseConfig struct {
Name string
Description string
Host string
Port int
Database string
Username string
Password string
Secure bool
SkipVerify bool
Timeout int
}
ClickHouseConfig holds ClickHouse proxy configuration for a single cluster.
type ClickHouseHandler ¶
type ClickHouseHandler struct {
// contains filtered or unexported fields
}
ClickHouseHandler handles requests to ClickHouse clusters.
func NewClickHouseHandler ¶
func NewClickHouseHandler(log logrus.FieldLogger, configs []ClickHouseConfig) *ClickHouseHandler
NewClickHouseHandler creates a new ClickHouse handler.
func (*ClickHouseHandler) Clusters ¶
func (h *ClickHouseHandler) Clusters() []string
Clusters returns the list of configured cluster names.
func (*ClickHouseHandler) ServeHTTP ¶
func (h *ClickHouseHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP handles ClickHouse requests. The cluster is specified via X-Datasource header.
type EthNodeConfig ¶
EthNodeConfig holds credentials for Ethereum node API access. A single credential pair is used for all bn-*.srv.*.ethpandaops.io and rpc-*.srv.*.ethpandaops.io endpoints.
type EthNodeHandler ¶
type EthNodeHandler struct {
// contains filtered or unexported fields
}
EthNodeHandler proxies requests to Ethereum beacon and execution nodes. Unlike other handlers that use static reverse proxies per instance, this handler constructs upstream URLs dynamically from path segments.
func NewEthNodeHandler ¶
func NewEthNodeHandler(log logrus.FieldLogger, cfg EthNodeConfig) *EthNodeHandler
NewEthNodeHandler creates a new Ethereum node handler.
func (*EthNodeHandler) ServeHTTP ¶
func (h *EthNodeHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP handles beacon and execution node requests. Path format: /{beacon|execution}/{network}/{instance}/... The first segment (beacon/execution) determines the upstream host pattern.
type LokiConfig ¶
type LokiConfig struct {
Name string
Description string
URL string
Username string
Password string
SkipVerify bool
Timeout int
}
LokiConfig holds Loki proxy configuration for a single instance.
type LokiHandler ¶
type LokiHandler struct {
// contains filtered or unexported fields
}
LokiHandler handles requests to Loki instances.
func NewLokiHandler ¶
func NewLokiHandler(log logrus.FieldLogger, configs []LokiConfig) *LokiHandler
NewLokiHandler creates a new Loki handler.
func (*LokiHandler) Instances ¶
func (h *LokiHandler) Instances() []string
Instances returns the list of configured instance names.
func (*LokiHandler) ServeHTTP ¶
func (h *LokiHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP handles Loki requests. The instance is specified via X-Datasource header.
type PrometheusConfig ¶
type PrometheusConfig struct {
Name string
Description string
URL string
Username string
Password string
SkipVerify bool
Timeout int
}
PrometheusConfig holds Prometheus proxy configuration for a single instance.
type PrometheusHandler ¶
type PrometheusHandler struct {
// contains filtered or unexported fields
}
PrometheusHandler handles requests to Prometheus instances.
func NewPrometheusHandler ¶
func NewPrometheusHandler(log logrus.FieldLogger, configs []PrometheusConfig) *PrometheusHandler
NewPrometheusHandler creates a new Prometheus handler.
func (*PrometheusHandler) Instances ¶
func (h *PrometheusHandler) Instances() []string
Instances returns the list of configured instance names.
func (*PrometheusHandler) ServeHTTP ¶
func (h *PrometheusHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP handles Prometheus requests. The instance is specified via X-Datasource header.