Versions in this module Expand all Collapse all v0 v0.2.0 Jul 30, 2026 Changes in this version + func LoadEnvFile(path string) error + func LoadEnvFileIfExists(path string) error v0.1.0 Jul 30, 2026 Changes in this version + func Instance[T any](app *App, value T) error + func JSON(w http.ResponseWriter, status int, value any) error + func LoadConfigFromEnv[T any](lookup EnvLookup) (T, error) + func LoadConfig[T any]() (T, error) + func LoggerFromContext(ctx context.Context) *slog.Logger + func ProvideAs[T any](app *App, constructor any, options ...ServiceOption) error + func RequestIDFromContext(ctx context.Context) string + func Resolve[T any](app *App) (T, error) + type App struct + func New(options ...Option) *App + func (a *App) Delete(pattern string, handler HandlerFunc) *Route + func (a *App) Get(pattern string, handler HandlerFunc) *Route + func (a *App) Group(prefix string, configure func(*Router)) + func (a *App) Handle(method, pattern string, handler HandlerFunc) *Route + func (a *App) HandleHTTP(method, pattern string, handler http.Handler) *Route + func (a *App) HandleHTTPFunc(method, pattern string, handler http.HandlerFunc) *Route + func (a *App) Handler() http.Handler + func (a *App) Logger() *slog.Logger + func (a *App) NamedRoute(name string) (Route, bool) + func (a *App) OnStart(hooks ...LifecycleHook) + func (a *App) OnStop(hooks ...LifecycleHook) + func (a *App) Patch(pattern string, handler HandlerFunc) *Route + func (a *App) Post(pattern string, handler HandlerFunc) *Route + func (a *App) Provide(constructor any, options ...ServiceOption) error + func (a *App) Put(pattern string, handler HandlerFunc) *Route + func (a *App) Routes() []Route + func (a *App) Run(address string) error + func (a *App) RunContext(ctx context.Context, address string) error + func (a *App) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (a *App) Services() *Container + func (a *App) SetErrorHandler(handler ErrorHandler) + func (a *App) SortedRoutes() []Route + func (a *App) Start(ctx context.Context) error + func (a *App) Stop(ctx context.Context) error + func (a *App) URL(name string, params map[string]string) (string, error) + func (a *App) Use(middleware ...Middleware) + type Container struct + func NewContainer() *Container + func (c *Container) Provide(constructor any, options ...ServiceOption) error + func (c *Container) Validate() error + type Context struct + Request *http.Request + Response http.ResponseWriter + func NewContext(w http.ResponseWriter, r *http.Request) *Context + func (c *Context) BindJSON(target any) error + func (c *Context) Context() context.Context + func (c *Context) JSON(status int, value any) error + func (c *Context) Logger() *slog.Logger + func (c *Context) NoContent(status int) error + func (c *Context) Param(name string) string + func (c *Context) RequestID() string + type EnvLookup func(string) (string, bool) + type ErrorHandler func(*Context, error) + type HTTPError struct + Cause error + Code string + Message string + Status int + func BadRequest(code, message string) *HTTPError + func Conflict(code, message string) *HTTPError + func Forbidden(code, message string) *HTTPError + func NewHTTPError(status int, code, message string) *HTTPError + func NotFound(code, message string) *HTTPError + func Unauthorized(code, message string) *HTTPError + func (e *HTTPError) Error() string + func (e *HTTPError) Unwrap() error + func (e *HTTPError) WithCause(err error) *HTTPError + type HandlerFunc func(*Context) error + type LifecycleHook func(context.Context) error + type Lifetime uint8 + const SingletonLifetime + const TransientLifetime + type Middleware func(http.Handler) http.Handler + type Option func(*App) + func WithLogger(logger *slog.Logger) Option + func WithRequestIDGenerator(generator func() string) Option + func WithRequestIDHeader(header string) Option + func WithShutdownTimeout(timeout time.Duration) Option + type Route struct + Method string + Name string + Pattern string + func (r *Route) Named(name string) *Route + type Router struct + func (r *Router) Delete(pattern string, handler HandlerFunc) *Route + func (r *Router) Get(pattern string, handler HandlerFunc) *Route + func (r *Router) Group(prefix string, configure func(*Router)) + func (r *Router) Handle(method, pattern string, handler HandlerFunc) *Route + func (r *Router) HandleHTTP(method, pattern string, handler http.Handler) *Route + func (r *Router) HandleHTTPFunc(method, pattern string, handler http.HandlerFunc) *Route + func (r *Router) Patch(pattern string, handler HandlerFunc) *Route + func (r *Router) Post(pattern string, handler HandlerFunc) *Route + func (r *Router) Put(pattern string, handler HandlerFunc) *Route + func (r *Router) Use(middleware ...Middleware) + type ServiceOption func(*serviceOptions) + func Singleton() ServiceOption + func Transient() ServiceOption + type Validatable interface + Validate func() error + type ValidationError struct + Fields map[string][]string + func NewValidationError() *ValidationError + func (e *ValidationError) Add(field, message string) *ValidationError + func (e *ValidationError) Error() string + func (e *ValidationError) OrNil() error