rrl

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2020 License: Apache-2.0 Imports: 16 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 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 Next response is allowed if current time >= allowTime

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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