dashboardhttp

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2025 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CORSMiddleware

func CORSMiddleware() func(http.Handler) http.Handler

CORSMiddleware adds CORS headers.

func ChainMiddleware

func ChainMiddleware(middlewares ...func(http.Handler) http.Handler) func(http.Handler) http.Handler

ChainMiddleware chains multiple middleware functions.

func HealthCheckMiddleware

func HealthCheckMiddleware() func(http.Handler) http.Handler

HealthCheckMiddleware provides basic health check endpoint.

func LoggingMiddleware

func LoggingMiddleware() func(http.Handler) http.Handler

LoggingMiddleware logs HTTP requests.

func RateLimitMiddleware

func RateLimitMiddleware(requestsPerSecond int, burst int) func(http.Handler) http.Handler

RateLimitMiddleware implements rate limiting.

func RecoverMiddleware

func RecoverMiddleware() func(http.Handler) http.Handler

RecoverMiddleware recovers from panics and logs them.

func SecurityHeadersMiddleware

func SecurityHeadersMiddleware() func(http.Handler) http.Handler

SecurityHeadersMiddleware adds security headers.

func TimeoutMiddleware

func TimeoutMiddleware(timeout time.Duration) func(http.Handler) http.Handler

TimeoutMiddleware adds request timeout.

Types

type LocalZonesHandler

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

LocalZonesHandler handles local zones API endpoints.

func NewLocalZonesHandler

func NewLocalZonesHandler(
	zoneDetector *localzone.ZoneDetector,
	leaseManager *lanresolver.LeaseManager,
	lanResolver *lanresolver.LANResolver,
	manager *lanresolver.Manager,
) *LocalZonesHandler

NewLocalZonesHandler creates a new local zones handler.

func (*LocalZonesHandler) BroadcastUpdate

func (h *LocalZonesHandler) BroadcastUpdate()

BroadcastUpdate sends updates to all connected WebSocket clients.

func (*LocalZonesHandler) RegisterRoutes

func (h *LocalZonesHandler) RegisterRoutes(api *mux.Router)

RegisterRoutes registers local zones API routes.

type Server

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

func NewServer

func NewServer(addr string, proxy *dnsproxy.Proxy) *Server

func NewServerWithConfig

func NewServerWithConfig(httpConfig *config.HTTPConfig, proxy *dnsproxy.Proxy) *Server

func (*Server) SetVersion

func (s *Server) SetVersion(ver, build string)

SetVersion allows cmd layer to propagate version/build time.

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Jump to

Keyboard shortcuts

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