simpwebserv

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2021 License: MIT Imports: 7 Imported by: 1

README

simpwebserv

一个给go的http服务端框架

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SimpwebservApp

type SimpwebservApp struct {
	Listener net.Listener
	UrlMap   SimpwebservUrlNode
}

func App

func App() SimpwebservApp

func (*SimpwebservApp) Register

func (app *SimpwebservApp) Register(function func(*SimpwebservRequest) *SimpwebservResponse, path string)

func (*SimpwebservApp) Run

func (app *SimpwebservApp) Run(host string, port uint16)

type SimpwebservRequest

type SimpwebservRequest struct {
	Method   string
	Path     string
	Protocol string
	Header   map[string]string
	Conn     net.Conn
}

type SimpwebservResponse

type SimpwebservResponse struct {
	Protocol    string
	Code        string
	CodeName    string
	Header      map[string]string
	Body        *bytes.Buffer
	ToDoCommand string
}

func BuildBasicResponse

func BuildBasicResponse() *SimpwebservResponse

func BuildNotFoundResponse

func BuildNotFoundResponse() *SimpwebservResponse

type SimpwebservUrlNode

type SimpwebservUrlNode struct {
	Name        string
	NextLayer   *list.List
	IncludeBack bool
	Function    func(*SimpwebservRequest) *SimpwebservResponse
}

Jump to

Keyboard shortcuts

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