server

package
v0.0.0-...-cca05c4 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fire

func Fire(config map[string]interface{})

func Handle404

func Handle404(w http.ResponseWriter, r *http.Request)

func RegistRoutes

func RegistRoutes(c *Server)

Types

type Middleware

type Middleware func(http.Handler) http.Handler

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
}

type Routes

type Routes []Route

type Server

type Server struct {
	////其它信息
	////addr
	Router *httprouter.Router
	// contains filtered or unexported fields
}

func New

func New() *Server

func (*Server) AddRoute

func (c *Server) AddRoute(method string, path string, handler http.HandlerFunc)

func (*Server) Handle

func (c *Server) Handle(method, path string, handler http.Handler, middlewares ...func(http.Handler) http.Handler)

给指定的http方法和路径注册handler

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, req *http.Request)

type ServerConf

type ServerConf struct {
}

Jump to

Keyboard shortcuts

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