http

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 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
	Body(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, entity any, isProtected bool)
	Use(middleware MiddlewareFunc)
	Start() error
	Routes() []Route
}

type HandlerFunc

type HandlerFunc func(ctx Context)

type MiddlewareFunc

type MiddlewareFunc func(next HandlerFunc) HandlerFunc

type Route added in v1.2.0

type Route struct {
	Method    string
	Path      string
	Entity    any
	Protected bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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