Versions in this module Expand all Collapse all v0 v0.4.0 Jul 6, 2026 Changes in this version type Config + ReadHeaderTimeout time.Duration type DocsConfig + AssetsBaseURL string type StreamCtx + func (s *StreamCtx) Status(code int) v0.3.0 Jun 23, 2026 v0.2.2 Jun 11, 2026 v0.2.1 Jun 11, 2026 v0.2.0 Jun 11, 2026 Changes in this version + func SetStreamTestParam(s *StreamCtx, key, value string) + func SetStreamTestStore(s *StreamCtx, key string, val any) type StreamCtx + func NewTestStreamCtx() *StreamCtx + func (s *StreamCtx) Get(key string) (any, bool) + func (s *StreamCtx) MustGet(key string) any + func (s *StreamCtx) Param(key string) string + func (s *StreamCtx) Set(key string, val any) v0.1.1 Jun 8, 2026 v0.1.0 Jun 8, 2026 Changes in this version + const CodeBadRequest + const CodeConflict + const CodeForbidden + const CodeGatewayTimeout + const CodeInternal + const CodeInvalidBody + const CodeMethodNotAllowed + const CodeNotFound + const CodeNotImplemented + const CodePayloadTooLarge + const CodeServiceUnavailable + const CodeTimeout + const CodeTooManyRequests + const CodeUnauthorized + const CodeUnprocessable + const CodeValidation + func BenchReleaseCtx(c *Ctx) + func ErrBadRequest(code, message string) error + func ErrConflict(code, message string) error + func ErrForbidden(code, message string) error + func ErrGatewayTimeout(message string) error + func ErrInternal(code, message string) error + func ErrInvalidBody(message string) error + func ErrMethodNotAllowed(message string) error + func ErrNotFound(code, message string) error + func ErrNotImplemented(message string) error + func ErrPayloadTooLarge(message string) error + func ErrServiceUnavailable(message string) error + func ErrTimeout(message string) error + func ErrTooManyRequests(message string) error + func ErrUnauthorized(code, message string) error + func ErrUnprocessable(code, message string) error + func Get[T any](ctx *Ctx, key string) (T, bool) + func InitTestCtx(c *Ctx, w http.ResponseWriter, r *http.Request) + func LoadConfig[T any]() (T, error) + func MustGet[T any](ctx *Ctx, key string) T + func SetTestBody(c *Ctx, b []byte) + func SetTestParam(c *Ctx, key, value string) + type App struct + func New(cfg Config) *App + func (a *App) Guard(guards ...Guard) *App + func (a *App) Listen() error + func (a *App) LivenessHandler() HandlerFunc + func (a *App) OpenAPISpec() map[string]any + func (a *App) ReadinessHandler() HandlerFunc + func (a *App) Register(modules ...Module) *App + func (a *App) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (a *App) Shutdown(ctx context.Context) error + func (a *App) Use(mw ...MiddlewareFunc) *App + type BastError struct + Code string + Message string + Status int + func (e *BastError) Error() string + func (e *BastError) JSON() []byte + type BodySchema struct + Example any + func Body[T any]() *BodySchema + type Config struct + Docs *DocsConfig + ErrorHandler ErrorHandler + HandlerTimeout time.Duration + Health *HealthConfig + HookTimeout time.Duration + IdleTimeout time.Duration + Logger Logger + MaxBodySize int64 + Port int + ReadTimeout time.Duration + ShutdownTimeout time.Duration + TrustedProxies []string + Validator Validator + WriteTimeout time.Duration + type Controller interface + Routes func() []Route + type Ctx struct + Request *http.Request + func BenchAcquireCtx(w http.ResponseWriter, r *http.Request) *Ctx + func NewTestCtx() *Ctx + func NewTestCtxWithPath(path string) *Ctx + func (c *Ctx) Bind(v any) error + func (c *Ctx) BindForm(v any) error + func (c *Ctx) BindJSON(v any) error + func (c *Ctx) Context() context.Context + func (c *Ctx) Cookie(name string) (*http.Cookie, error) + func (c *Ctx) Cookies() []*http.Cookie + func (c *Ctx) Created(data any) Response + func (c *Ctx) Error(err error) Response + func (c *Ctx) File(field string) (*multipart.FileHeader, error) + func (c *Ctx) Files(field string) ([]*multipart.FileHeader, error) + func (c *Ctx) FormValue(key string) string + func (c *Ctx) Get(key string) (any, bool) + func (c *Ctx) Header(key string) string + func (c *Ctx) IP() string + func (c *Ctx) Method() string + func (c *Ctx) MustGet(key string) any + func (c *Ctx) NoContent() Response + func (c *Ctx) OK(data any) Response + func (c *Ctx) Paginated(data any, meta PaginationMeta) Response + func (c *Ctx) Param(key string) string + func (c *Ctx) Path() string + func (c *Ctx) Query(key string) string + func (c *Ctx) QueryDefault(key, fallback string) string + func (c *Ctx) Raw(status int, contentType string, body []byte) Response + func (c *Ctx) RawBody() ([]byte, error) + func (c *Ctx) Redirect(url string, code int) Response + func (c *Ctx) Set(key string, val any) + func (c *Ctx) WithCookie(cookie *http.Cookie) Response + func (c *Ctx) WithValue(key, val any) *Ctx + type Doc struct + Body *BodySchema + Deprecated bool + DeprecatedMsg string + Description string + Params []Param + Returns Returns + Summary string + Tags []string + type DocsConfig struct + Description string + Enabled bool + JSONPath string + Path string + Title string + Version string + type ErrorHandler func(ctx *Ctx, err error) Response + type Guard interface + Check func(ctx *Ctx) error + type GuardFunc func(ctx *Ctx) error + func (f GuardFunc) Check(ctx *Ctx) error + type HandlerFunc func(ctx *Ctx) Response + type HealthCheck struct + Name string + func CustomCheck(name string, fn func(ctx context.Context) error) HealthCheck + type HealthConfig struct + Checks []HealthCheck + LivePath string + ReadyPath string + type Hooks interface + OnInit func(ctx context.Context) error + OnReady func() + OnShutdown func(ctx context.Context) error + type Logger interface + Debug func(msg string, args ...any) + Error func(msg string, args ...any) + Info func(msg string, args ...any) + OnBoot func(version string) + OnError func(ctx *Ctx, err error) + OnListening func(port int) + OnModuleRegistered func(name, prefix string) + OnRequest func(method, path string, status int, dur time.Duration, ip string) + OnRouteRegistered func(method, path string, guards []string) + OnServiceExported func(serviceType string, fromModule string) + OnServiceResolved func(serviceType string, toModule string) + OnShutdown func() + Warn func(msg string, args ...any) + func NewDefaultLogger() Logger + type MiddlewareFunc func(next HandlerFunc) HandlerFunc + type Module struct + Controller Controller + Doc ModuleDoc + Guards []Guard + Middleware []MiddlewareFunc + Modules []Module + Prefix string + type ModuleDoc struct + Description string + Name string + type PaginationMeta struct + Page int + Pages int + PerPage int + Total int + type Param struct + Description string + In string + Name string + Required bool + func PathParam(name, description string) Param + func QueryParam(name, description string) Param + type Response struct + func DefaultErrorHandler(ctx *Ctx, err error) Response + func NewErrorResponse(err error) Response + func NewRawResponse(status int, contentType string, body []byte) Response + func (r Response) Body() []byte + func (r Response) ContentType() string + func (r Response) Cookies() []*http.Cookie + func (r Response) Err() error + func (r Response) Headers() map[string]string + func (r Response) IsError() bool + func (r Response) Redirect() string + func (r Response) Status() int + func (r Response) WithCookie(cookie *http.Cookie) Response + func (r Response) WithHeader(key, value string) Response + func (r Response) WithStatus(code int) Response + type Returns map[int]*BodySchema + type Route struct + Doc Doc + Guards []Guard + Handler HandlerFunc + MaxBodySize int64 + Method string + Middleware []MiddlewareFunc + Pattern string + Stream StreamHandlerFunc + Timeout time.Duration + func DELETE(pattern string, handler HandlerFunc, opts ...RouteOption) Route + func GET(pattern string, handler HandlerFunc, opts ...RouteOption) Route + func PATCH(pattern string, handler HandlerFunc, opts ...RouteOption) Route + func POST(pattern string, handler HandlerFunc, opts ...RouteOption) Route + func PUT(pattern string, handler HandlerFunc, opts ...RouteOption) Route + func STREAM(pattern string, handler StreamHandlerFunc, opts ...RouteOption) Route + type RouteOption func(*Route) + func WithDoc(doc Doc) RouteOption + func WithGuards(guards ...Guard) RouteOption + func WithMaxBody(n int64) RouteOption + func WithMiddleware(mw ...MiddlewareFunc) RouteOption + func WithTimeout(d time.Duration) RouteOption + type SecuredGuard interface + SecurityScheme func() SecurityScheme + type SecurityScheme struct + BearerFormat string + Description string + Scheme string + Type string + type StreamCtx struct + Request *http.Request + func (s *StreamCtx) Closed() <-chan struct{} + func (s *StreamCtx) Flush() + func (s *StreamCtx) Send(event, data string) error + func (s *StreamCtx) SetHeader(key, value string) + func (s *StreamCtx) Write(p []byte) (int, error) + type StreamHandlerFunc func(ctx *StreamCtx) + type ValidationError struct + Fields map[string]string + func (e *ValidationError) BastStatus() int + func (e *ValidationError) Error() string + func (e *ValidationError) JSON() []byte + type Validator interface + Validate func(v any) error