detector

package
v0.0.0-...-9823ec8 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package detector provides a bot detector middleware for the Sonic API Gateway

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DenyList  []string `json:"deny"`
	AllowList []string `json:"allow"`
	Patterns  []string `json:"patterns"`
	CacheSize int      `json:"cache_size"`
}

type Detector

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

func NewDetector

func NewDetector(cfg Config) (*Detector, error)

func (*Detector) IsBot

func (d *Detector) IsBot(r *http.Request) bool

type DetectorFunc

type DetectorFunc func(r *http.Request) bool

func New

func New(cfg Config) (DetectorFunc, error)

type LRUDetector

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

func NewLRU

func NewLRU(cfg Config) (*LRUDetector, error)

func (*LRUDetector) IsBot

func (d *LRUDetector) IsBot(r *http.Request) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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