rrl

package
v0.0.0-...-11760fe Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RequestsExceeded = promauto.NewCounterVec(prometheus.CounterOpts{
		Namespace: plugin.Namespace,
		Subsystem: "rrl",
		Name:      "requests_exceeded_total",
		Help:      "Counter of requests exceeding QPS limit.",
	}, []string{"client_ip"})

	ResponsesExceeded = promauto.NewCounterVec(prometheus.CounterOpts{
		Namespace: plugin.Namespace,
		Subsystem: "rrl",
		Name:      "responses_exceeded_total",
		Help:      "Counter of responses exceeding QPS limit.",
	}, []string{"client_ip"})
)

Variables declared for monitoring.

Functions

This section is empty.

Types

type KubernetesClient

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

KubernetesClient is a wrapper over the kubernetes client used to communicate with the kubernetes API.

func NewKubernetesClient

func NewKubernetesClient(namespace, app string) (*KubernetesClient, error)

NewKubernetesClient creates a new kubernetes client using in-cluster authn/authz.

func (*KubernetesClient) PodCount

func (c *KubernetesClient) PodCount(ctx context.Context) (int64, error)

PodCount returns the number of healthy pods.

type PodCounter

type PodCounter interface {
	PodCount(ctx context.Context) (int64, error)
}

PodCounter counts the number of healthy pods running.

type RRL

type RRL struct {
	Next  plugin.Handler
	Zones []string
	// contains filtered or unexported fields
}

RRL performs response rate limiting

func (*RRL) Name

func (rrl *RRL) Name() string

Name implements the Handler interface.

func (*RRL) ServeDNS

func (rrl *RRL) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error)

ServeDNS implements the Handler interface.

type ResponseAccount

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

ResponseAccount holds accounting for a category of response

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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