http

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context interface {
	JSON(code int, obj any)
	Bind(obj any) error
	Param(key string) string
	Query(key string) string
	QueryParams() map[string][]string
	BindJSON(obj any) error
	SetHeader(key, value string)
	Method() string
	Path() string
	SetStatus(code int)
	Status() int
	RemoteIP() string
	Header(header string) string

	Abort()
	Next()

	Set(key string, value any)
	Get(key string) any
}

type HTTPEngine

type HTTPEngine interface {
	Init(port int) error
	RegisterRoute(method string, path string, handler HandlerFunc)
	Use(middleware MiddlewareFunc)
	Start() error
}

type HandlerFunc

type HandlerFunc func(ctx Context)

type MiddlewareFunc

type MiddlewareFunc func(next HandlerFunc) HandlerFunc

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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