easyserver

package module
v0.0.0-...-1d80d11 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2023 License: MIT Imports: 8 Imported by: 0

README

easy_server

超轻量http server

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context interface {
	GetReq() *http.Request
	GetResp() http.ResponseWriter
	GetParamParam() []router.UrlParam
	GetMatchPath() string
	Next() bool
}

type Engine

type Engine interface {
	Register(node Node)
	RegisterGroup(group Group)
	RunHttp(port int) error
	RunHttps(port int, certFile, keyFile string) error
}

func New

func New() Engine

type Group

type Group struct {
	RootPath    string
	Middlewares []func(c Context)
	Children    []Node
}

type Node

type Node struct {
	Method      string
	Path        string
	Middlewares []func(c Context)
	Handler     func(c Context)
}

Jump to

Keyboard shortcuts

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