controllers

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultFrequency = 1 * time.Minute

DefaultFrequency of the rate limiter

Variables

This section is empty.

Functions

func ConfigureRouter

func ConfigureRouter(e *echo.Echo, cfg *Config)

ConfigureRouter configures echo router

func NewBanner

func NewBanner(size int, banlist []string) *banner

NewBanner creates banner

func NewRateLimiter

func NewRateLimiter(shared, all map[string]string) *rateLimiter

func NewValidator

func NewValidator(dv domainValidator, psdc *psd.Client) *validator

func SentryTransaction added in v1.4.1

func SentryTransaction() echo.MiddlewareFunc

SentryTransaction is a middleware that creates a new transaction for each request.

Types

type Config

type Config struct {
	FormHandler   FormHandler
	BanlistStatic []string
	BanlistSize   int
	FormRLsShared map[string]string
	FormRLs       map[string]string
	MetricsAuth   echobasicauth.Auth
	Validator     domainValidator
	PSD           *psd.Client
}

type FormHandler

type FormHandler interface {
	GET(context.Context, string, *http.Request) (string, error)
	POST(context.Context, string, *http.Request) (string, error)
}

FormHandler for web server

Jump to

Keyboard shortcuts

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