web

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: GPL-3.0 Imports: 16 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 NewBanHanlder added in v1.1.0

func NewBanHanlder(size int, banlist []string, loglevel string) *banhandler

NewBanHanlder creates banhandler

func NewRateLimiter

func NewRateLimiter(pattern string, log *logger.Logger) *ratelimiter

NewRateLimiter with defined pattern

Types

type DomainValidator added in v1.1.0

type DomainValidator interface {
	A(string) bool
	DomainString(string) bool
	GetBase(string) string
}

DomainValidator for the web server

type FormHandler

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

FormHandler for web server

type Server

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

Server to handle forms

func New

func New(port string, srl, rls map[string]string, loglevel string, fh FormHandler, dv DomainValidator, bs int, bl []string) *Server

New web server

func (*Server) Start

func (s *Server) Start() error

Start web server

func (*Server) Stop

func (s *Server) Stop()

Stop web server

Jump to

Keyboard shortcuts

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