api

package
v0.0.0-...-46749fd Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package api contains the telemetry of the Cluster Agent API and implements the forwarding of queries from Cluster Agent followers to the leader.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGlobalLeaderForwarder

func NewGlobalLeaderForwarder(apiPort, maxConnections int)

NewGlobalLeaderForwarder initializes the global LeaderForwarder instance

func WithTelemetryWrapper

func WithTelemetryWrapper(handlerName string, handler func(w http.ResponseWriter, r *http.Request)) func(w http.ResponseWriter, r *http.Request)

WithTelemetryWrapper returns a http handler function that emits telemetry.

Types

type LeaderForwarder

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

LeaderForwarder allows to forward queries from follower to leader

func GetGlobalLeaderForwarder

func GetGlobalLeaderForwarder() *LeaderForwarder

GetGlobalLeaderForwarder returns the global LeaderForwarder instance

func NewLeaderForwarder

func NewLeaderForwarder(apiPort, maxConnections int) *LeaderForwarder

NewLeaderForwarder initializes a new LeaderForwarder instance and is used for test purposes

func (*LeaderForwarder) Forward

func (lf *LeaderForwarder) Forward(rw http.ResponseWriter, req *http.Request)

Forward forwards a query to leader if available

func (*LeaderForwarder) SetLeaderIP

func (lf *LeaderForwarder) SetLeaderIP(leaderIP string)

SetLeaderIP allows to change the target leader IP

type TelemetryHandler

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

TelemetryHandler provides a http handler and emits requests telemetry for it.

Directories

Path Synopsis
Package v1 contains the types of the Cluster Agent API (v1).
Package v1 contains the types of the Cluster Agent API (v1).

Jump to

Keyboard shortcuts

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