blacklist

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2020 License: Unlicense Imports: 6 Imported by: 0

README

iris-blacklist

Iris Middleware to check a request against a blacklist of IP addresses/ranges or User Agents and display a customised block message to the user

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(options Options) iris.Handler

New creates a new instance of the Blacklist middleware

Types

type Blacklist

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

Blacklist is the struct that we will use for all internal purposes

func (*Blacklist) Serve

func (b *Blacklist) Serve(ctx iris.Context)

Serve performs some checks whether the user is blocked or not

type Options

type Options struct {
	BlockedResponse       []byte
	BlockedIPs            []string
	BlockedIpRanges       []string
	BlockedUserAgents     []string
	ReplaceStrings        map[string]string
	BlacklistedStatusCode int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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