MCPcopy Create free account

hub / github.com/3n21c0/simple-go-server / functions

Functions31 in github.com/3n21c0/simple-go-server

↓ 7 callersMethodWriteHeader
(status int)
main.go:136
↓ 7 callersFunctionsanitize
sanitize removes newlines and control characters from strings to prevent log injection
main.go:151
↓ 5 callersMethodallow
()
main.go:273
↓ 4 callersFunctionnextRequestID
nextRequestID generates a cryptographically random request ID
main.go:196
↓ 3 callersMethodWrite
(b []byte)
main.go:141
↓ 3 callersFunctionhealthz
()
main.go:119
↓ 3 callersFunctionindex
()
main.go:105
↓ 3 callersFunctionlogging
(logger *log.Logger)
main.go:165
↓ 3 callersFunctionmin
(a, b int)
main.go:294
↓ 3 callersFunctionnewRateLimiter
(capacity int, refill time.Duration)
main.go:264
↓ 3 callersFunctionrateLimit
rateLimit applies a simple per-server rate limit
main.go:302
↓ 3 callersFunctionrecovery
recovery recovers from panics and logs them, preventing server crashes
main.go:239
↓ 3 callersFunctionsecurityHeaders
securityHeaders adds security-related HTTP headers to all responses
main.go:227
↓ 3 callersFunctiontracing
(nextRequestID func() string)
main.go:205
FunctionBenchmarkNextRequestID
BenchmarkNextRequestID benchmarks the request ID generation
main_test.go:448
FunctionBenchmarkRateLimiter
BenchmarkRateLimiter benchmarks the rate limiter
main_test.go:463
FunctionBenchmarkSanitize
BenchmarkSanitize benchmarks the sanitize function
main_test.go:455
FunctionTestHealthz
TestHealthz tests the health check handler
main_test.go:63
FunctionTestIndex
TestIndex tests the index handler
main_test.go:16
FunctionTestIntegrationFullStack
TestIntegrationFullStack tests the full middleware stack
main_test.go:472
FunctionTestLoggingMiddleware
TestLoggingMiddleware tests the logging middleware
main_test.go:181
FunctionTestMinFunction
TestMinFunction tests the min helper function
main_test.go:410
FunctionTestNextRequestID
TestNextRequestID tests the request ID generation
main_test.go:203
FunctionTestRateLimitMiddleware
TestRateLimitMiddleware tests the rate limit middleware
main_test.go:369
FunctionTestRateLimiter
TestRateLimiter tests the rate limiter
main_test.go:344
FunctionTestRecoveryMiddleware
TestRecoveryMiddleware tests the panic recovery middleware
main_test.go:321
FunctionTestResponseWriter
TestResponseWriter tests the response writer wrapper
main_test.go:99
FunctionTestSanitize
TestSanitize tests the sanitize function
main_test.go:132
FunctionTestSecurityHeaders
TestSecurityHeaders tests the security headers middleware
main_test.go:294
FunctionTestTracingMiddleware
TestTracingMiddleware tests the tracing middleware
main_test.go:227
Functionmain
()
main.go:47