routing

package module
v0.0.0-...-811d3bb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HandlerFunc

type HandlerFunc func(w http.ResponseWriter, r *http.Request)

HandlerFunc is the signature for route handlers

type MiddlewareFunc

type MiddlewareFunc func(HandlerFunc) HandlerFunc

MiddlewareFunc wraps a handler with additional functionality

type NetHTTPApp

type NetHTTPApp struct {
	// contains filtered or unexported fields
}

App represents the Bold application

func NewApp

func NewApp() *NetHTTPApp

func (*NetHTTPApp) Handler

func (app *NetHTTPApp) Handler() http.Handler

Handler returns an http.Handler for the application

func (*NetHTTPApp) Listen

func (app *NetHTTPApp) Listen(addr string) error

Listen starts the HTTP server

func (*NetHTTPApp) Routes

func (app *NetHTTPApp) Routes(items ...any)

Routes configures the application routes

type Route

type Route struct {
	// contains filtered or unexported fields
}

Route represents a single route configuration

type RouteBuilder

type RouteBuilder struct{}

RouteBuilder provides route construction methods

func NewRoute

func NewRoute() *RouteBuilder

func (*RouteBuilder) DELETE

func (rb *RouteBuilder) DELETE(pattern string, handler HandlerFunc) *Route

DELETE creates a DELETE route

func (*RouteBuilder) GET

func (rb *RouteBuilder) GET(pattern string, handler HandlerFunc) *Route

GET creates a GET route

func (*RouteBuilder) Group

func (rb *RouteBuilder) Group(prefix string, items ...any) *RouteGroup

Group creates a route group

func (*RouteBuilder) PATCH

func (rb *RouteBuilder) PATCH(pattern string, handler HandlerFunc) *Route

PATCH creates a PATCH route

func (*RouteBuilder) POST

func (rb *RouteBuilder) POST(pattern string, handler HandlerFunc) *Route

POST creates a POST route

func (*RouteBuilder) PUT

func (rb *RouteBuilder) PUT(pattern string, handler HandlerFunc) *Route

PUT creates a PUT route

type RouteGroup

type RouteGroup struct {
	// contains filtered or unexported fields
}

RouteGroup represents a group of routes with common prefix/middleware

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL