sudsy

package module
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: 3 Imported by: 0

README

sudsy

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewApplicationSection

func NewApplicationSection(
	root string,
	opts ...applicationSectionOpt,
) application.Section

func WithAfterShutdownFunc added in v1.3.0

func WithAfterShutdownFunc(f func()) applicationOpt

WithAfterShutdownFunc adds a function that will be called after the HTTP server shuts down.

func WithBasicAuth

func WithBasicAuth(username, password, realm string) applicationSectionOpt

func WithBeforeShutdownFunc added in v1.3.0

func WithBeforeShutdownFunc(f func()) applicationOpt

WithBeforeShutdownFunc adds a function that will be called before the HTTP server shuts down.

func WithPathPatternHandler

func WithPathPatternHandler(
	pattern string,
	handler http.Handler,
	contextKey any,
) applicationSectionOpt

func WithRateLimitingHostCacheEntryIdleDuration

func WithRateLimitingHostCacheEntryIdleDuration(d time.Duration) applicationSectionOpt

func WithRateLimitingSessionConfig

func WithRateLimitingSessionConfig(
	maxRequests int64,
	sessionDuration time.Duration,
	banDuration time.Duration,
) applicationSectionOpt

func WithServerListenPort added in v1.1.0

func WithServerListenPort(port int) applicationOpt

func WithSimpleHandler added in v1.2.0

func WithSimpleHandler(handler http.Handler) applicationSectionOpt

func WithStatusBadRequestHandlerFunc

func WithStatusBadRequestHandlerFunc(h application.HandlerFuncWithError) applicationSectionOpt

func WithStatusNotFoundHandlerFunc

func WithStatusNotFoundHandlerFunc(h http.HandlerFunc) applicationSectionOpt

func WithStatusTooManyRequestsHandlerFunc

func WithStatusTooManyRequestsHandlerFunc(h http.HandlerFunc) applicationSectionOpt

Types

type Application

type Application interface {
	AddApplicationSection(section application.Section) error
	ListenAndServe()
}

func NewApplication

func NewApplication(opts ...applicationOpt) Application

Directories

Path Synopsis
internal
basicauth
Package basicauth provides an HTTP middleware handler enforcing Basic Authentication.
Package basicauth provides an HTTP middleware handler enforcing Basic Authentication.

Jump to

Keyboard shortcuts

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