controllers

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: AGPL-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

func SentryTransaction() echo.MiddlewareFunc

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

func SetFormHandlerSender

func SetFormHandlerSender(sender sub.Sender)

SetFormHandlerSender sets sender for form handler it's a hack to avoid circular dependencies and allow setting matrix bot once it configured, while having HTTP server up & running, even if matrix part is down

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)
	SetSender(sender sub.Sender)
}

FormHandler for web server

Jump to

Keyboard shortcuts

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