application

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application interface {
	AddAfterShutdownFunc(f func())
	AddBeforeShutdownFunc(f func())
	AddSection(Section) error
	ListenAndServe()
	SetServerListenPort(int)
}

func NewApplication

func NewApplication() Application

type HandlerFuncWithError

type HandlerFuncWithError func(http.ResponseWriter, *http.Request, error)

type Section

type Section interface {
	AddPathPatternHandler(pattern string, handler http.Handler, contextKey any)
	AddRateLimitingSessionConfig(maxRequests int64, sessionDuration, banDuration time.Duration)
	AfterShutdown()
	BeforeStart(*sync.WaitGroup)
	NewHandler() http.Handler
	Root() string
	SetBasicAuthPassword(string)
	SetBasicAuthRealm(string)
	SetBasicAuthUsername(string)
	SetRateLimitingHostCacheEntryIdleDuration(time.Duration)
	SetSimpleHandler(handler http.Handler)
	SetStatusBadRequestHandlerFunc(HandlerFuncWithError)
	SetStatusNotFoundHandlerFunc(http.HandlerFunc)
	SetStatusTooManyRequestsHandlerFunc(http.HandlerFunc)
}

func NewSection

func NewSection(deps SectionDependencies, root string) Section

type SectionDependencies

type SectionDependencies interface {
	Now() time.Time
}

Jump to

Keyboard shortcuts

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