web

package
v0.1.164 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 1 Imported by: 3 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context interface {
	// Request returns `*http.Request`.
	Request() *http.Request

	// Get retrieves data from the context.
	Get(key any) any

	// Set saves data in the context.
	Set(key any, val any)

	// Response returns `http.ResponseWriter`.
	Response() http.ResponseWriter

	// NoContent sends a response with no body and a status code.
	NoContent(code int) error

	// String sends a string response with status code.
	String(code int, s string) error

	// JSON sends a JSON response with status code.
	JSON(code int, data any) error

	// Bind binds path params, query params and the request body into provided type `i`. The default binder
	// binds body based on Content-Type header.
	Bind(i any) error

	// Error sends an error back to the client.
	Error(code int, err error)

	// Done returns a channel that's closed when work done on behalf of this
	// context should be canceled.
	Done() <-chan any
}

type HandlerFunc

type HandlerFunc func(c Context) error

type MiddlewareFunc

type MiddlewareFunc func(next HandlerFunc) HandlerFunc

Jump to

Keyboard shortcuts

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