Versions in this module Expand all Collapse all v1 v1.0.3 Apr 4, 2026 v1.0.2 Apr 2, 2026 v1.0.1 Apr 1, 2026 v1.0.0 Apr 1, 2026 Changes in this version + type CORSConfig struct + AllowCredentials bool + AllowHeaders []string + AllowMethods []string + AllowOrigins []string + ExposeHeaders []string + MaxAge int + type Conn struct + func (c *Conn) Close() error + func (c *Conn) LocalAddr() string + func (c *Conn) Raw() net.Conn + func (c *Conn) Read(p []byte) (int, error) + func (c *Conn) ReadFull(p []byte) error + func (c *Conn) ReadMessage() ([]byte, error) + func (c *Conn) RemoteAddr() string + func (c *Conn) Write(p []byte) (int, error) + type ConnHandler func(ctx context.Context, conn *Conn) + type HTTPBlock struct + func NewHTTP(name string, opts ...Option) *HTTPBlock + func (b *HTTPBlock) Init(_ context.Context) error + func (b *HTTPBlock) Name() string + func (b *HTTPBlock) Port() int + func (b *HTTPBlock) Shutdown(ctx context.Context) error + func (b *HTTPBlock) Wait() error + type Handler func(ctx context.Context, req *Request) (*Response, error) + type LambdaBlock struct + func NewLambda(name string, opts ...Option) *LambdaBlock + func (b *LambdaBlock) Init(_ context.Context) error + func (b *LambdaBlock) Name() string + func (b *LambdaBlock) Shutdown(_ context.Context) error + func (b *LambdaBlock) Start() + type Middleware func(next Handler) Handler + func CORS(cfg CORSConfig) Middleware + func Logging() Middleware + func Recovery() Middleware + func RequestID() Middleware + type Option func(*blockConfig) + func WithHandler(h Handler) Option + func WithIdleTimeout(d time.Duration) Option + func WithMiddleware(middleware ...Middleware) Option + func WithPort(port int) Option + func WithReadTimeout(d time.Duration) Option + func WithRouter(r *Router) Option + func WithShutdownTimeout(d time.Duration) Option + func WithSource(s Source) Option + func WithTLS(certFile, keyFile string) Option + func WithTLSConfig(cfg *tls.Config) Option + func WithWriteTimeout(d time.Duration) Option + type Request struct + Body []byte + Headers map[string]string + Method string + Path string + PathParams map[string]string + Query map[string][]string + Raw any + RequestID string + Source Source + SourceIP string + Stage string + func (r *Request) BindJSON(v any) error + func (r *Request) Header(name string) string + func (r *Request) PathParam(name string) string + func (r *Request) QueryParam(name string) string + type Response struct + Body any + Headers map[string]string + IsBase64 bool + StatusCode int + func Error(statusCode int, message string) *Response + func JSON(statusCode int, body any) *Response + func NoContent() *Response + func Redirect(statusCode int, url string) *Response + func Text(statusCode int, body string) *Response + type Router struct + func NewRouter() *Router + func (r *Router) DELETE(pattern string, h Handler, middleware ...Middleware) + func (r *Router) GET(pattern string, h Handler, middleware ...Middleware) + func (r *Router) HEAD(pattern string, h Handler, middleware ...Middleware) + func (r *Router) Handle(method, pattern string, h Handler, middleware ...Middleware) + func (r *Router) NotFound(h Handler) + func (r *Router) OPTIONS(pattern string, h Handler, middleware ...Middleware) + func (r *Router) PATCH(pattern string, h Handler, middleware ...Middleware) + func (r *Router) POST(pattern string, h Handler, middleware ...Middleware) + func (r *Router) PUT(pattern string, h Handler, middleware ...Middleware) + func (r *Router) ServeHTTP(w http.ResponseWriter, httpReq *http.Request) + func (r *Router) Use(middleware ...Middleware) + type Source string + const SourceALB + const SourceAPIGatewayV1 + const SourceAPIGatewayV2 + const SourceHTTP + type TCPBlock struct + func NewTCP(name string, opts ...TCPOption) *TCPBlock + func (b *TCPBlock) Init(_ context.Context) error + func (b *TCPBlock) Name() string + func (b *TCPBlock) Port() int + func (b *TCPBlock) Shutdown(_ context.Context) error + func (b *TCPBlock) Wait() error + type TCPOption func(*tcpConfig) + func WithBufSize(n int) TCPOption + func WithConnHandler(h ConnHandler) TCPOption + func WithConnReadTimeout(d time.Duration) TCPOption + func WithConnWriteTimeout(d time.Duration) TCPOption + func WithTCPPort(port int) TCPOption + func WithTCPShutdownTimeout(d time.Duration) TCPOption