Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/3n21c0/simple-go-server
/ functions
Functions
31 in github.com/3n21c0/simple-go-server
⨍
Functions
31
◇
Types & classes
3
↓ 7 callers
Method
WriteHeader
(status int)
main.go:136
↓ 7 callers
Function
sanitize
sanitize removes newlines and control characters from strings to prevent log injection
main.go:151
↓ 5 callers
Method
allow
()
main.go:273
↓ 4 callers
Function
nextRequestID
nextRequestID generates a cryptographically random request ID
main.go:196
↓ 3 callers
Method
Write
(b []byte)
main.go:141
↓ 3 callers
Function
healthz
()
main.go:119
↓ 3 callers
Function
index
()
main.go:105
↓ 3 callers
Function
logging
(logger *log.Logger)
main.go:165
↓ 3 callers
Function
min
(a, b int)
main.go:294
↓ 3 callers
Function
newRateLimiter
(capacity int, refill time.Duration)
main.go:264
↓ 3 callers
Function
rateLimit
rateLimit applies a simple per-server rate limit
main.go:302
↓ 3 callers
Function
recovery
recovery recovers from panics and logs them, preventing server crashes
main.go:239
↓ 3 callers
Function
securityHeaders
securityHeaders adds security-related HTTP headers to all responses
main.go:227
↓ 3 callers
Function
tracing
(nextRequestID func() string)
main.go:205
Function
BenchmarkNextRequestID
BenchmarkNextRequestID benchmarks the request ID generation
main_test.go:448
Function
BenchmarkRateLimiter
BenchmarkRateLimiter benchmarks the rate limiter
main_test.go:463
Function
BenchmarkSanitize
BenchmarkSanitize benchmarks the sanitize function
main_test.go:455
Function
TestHealthz
TestHealthz tests the health check handler
main_test.go:63
Function
TestIndex
TestIndex tests the index handler
main_test.go:16
Function
TestIntegrationFullStack
TestIntegrationFullStack tests the full middleware stack
main_test.go:472
Function
TestLoggingMiddleware
TestLoggingMiddleware tests the logging middleware
main_test.go:181
Function
TestMinFunction
TestMinFunction tests the min helper function
main_test.go:410
Function
TestNextRequestID
TestNextRequestID tests the request ID generation
main_test.go:203
Function
TestRateLimitMiddleware
TestRateLimitMiddleware tests the rate limit middleware
main_test.go:369
Function
TestRateLimiter
TestRateLimiter tests the rate limiter
main_test.go:344
Function
TestRecoveryMiddleware
TestRecoveryMiddleware tests the panic recovery middleware
main_test.go:321
Function
TestResponseWriter
TestResponseWriter tests the response writer wrapper
main_test.go:99
Function
TestSanitize
TestSanitize tests the sanitize function
main_test.go:132
Function
TestSecurityHeaders
TestSecurityHeaders tests the security headers middleware
main_test.go:294
Function
TestTracingMiddleware
TestTracingMiddleware tests the tracing middleware
main_test.go:227
Function
main
()
main.go:47