middleware

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleCORS

HandleCORS returns headers if the request is an OPTIONS request.

func HandleHTTPRequest

func HandleHTTPRequest(ctx *fasthttp.RequestCtx)

HandleHTTPRequest routes HTTP requests to their respective handlers based on the path.

func LimitPath

LimitPath generally handles all paths. IPs will be stored like 0_192.168.1.1 for path 0, 1_192.168.1.1 for path 1, and so on. Bandwidth checking for uploading is set as BW_UP_192.168.1.1, for another example.

Types

type PathType

type PathType int

PathType is an integer representation of what path is currently being handled. Used mainly by LimitPath.

const (
	// LimitUploadPath represents /upload.
	LimitUploadPath PathType = iota

	// LimitGeneralPath represents /general.
	LimitGeneralPath
)

Jump to

Keyboard shortcuts

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