handlers

package
v0.0.0-...-a4a2785 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const AccessBeforeDelayTime = time.Minute * 30

AccessBeforeDelayTime is the amount of time until another delay should occur on a host.

View Source
const DelayTime = time.Minute * 3

DelayTime is the amount of time a delay should occur for.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockDelayHandler

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

BlockDelayHandler manages the delay logic for specific hosts.

func (*BlockDelayHandler) Handle

func (dh *BlockDelayHandler) Handle(req *http.Request, conn net.Conn) (*http.Response, error)

Handle processes an HTTP request and applies delay if necessary.

func (*BlockDelayHandler) Start

func (dh *BlockDelayHandler) Start() error

Start initializes delay handling with predefined delayed hosts.

type Delay

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

Delay holds the hostname and a cached response after delay completion.

type DelayedAccess

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

DelayedAccess records the time and hostname for a delayed access per client IP.

Jump to

Keyboard shortcuts

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