gbhttp

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HOOK_BEFORE_SERVE   = "HOOK_BEFORE_SERVE"  // Deprecated, use HookBeforeServe instead.
	HOOK_AFTER_SERVE    = "HOOK_AFTER_SERVE"   // Deprecated, use HookAfterServe instead.
	HOOK_BEFORE_OUTPUT  = "HOOK_BEFORE_OUTPUT" // Deprecated, use HookBeforeOutput instead.
	HOOK_AFTER_OUTPUT   = "HOOK_AFTER_OUTPUT"  // Deprecated, use HookAfterOutput instead.
	HookBeforeServe     = "HOOK_BEFORE_SERVE"
	HookAfterServe      = "HOOK_AFTER_SERVE"
	HookBeforeOutput    = "HOOK_BEFORE_OUTPUT"
	HookAfterOutput     = "HOOK_AFTER_OUTPUT"
	ServerStatusStopped = 0
	ServerStatusRunning = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HandlerFunc

type HandlerFunc = ghttp.HandlerFunc

type Request

type Request = ghttp.Request

type Router

type Router = ghttp.Router

type Server

type Server struct {
	*ghttp.Server
}

func (*Server) BindObjectClass

func (s *Server) BindObjectClass(pattern string, object interface{}, method ...string)

BindObject registers object to server routes with given pattern.

The optional parameter <method> is used to specify the method to be registered, which supports multiple method names, multiple methods are separated by char ',', case sensitive.

Note that the route method should be defined as ghttp.HandlerFunc.

func (*Server) BindObjectClassMethod

func (s *Server) BindObjectClassMethod(pattern string, object interface{}, method string)

BindObjectMethod registers specified method of object to server routes with given pattern.

The optional parameter <method> is used to specify the method to be registered, which does not supports multiple method names but only one, case sensitive.

Note that the route method should be defined as ghttp.HandlerFunc.

func (*Server) BindObjectClassRest

func (s *Server) BindObjectClassRest(pattern string, object interface{})

BindObjectRest registers object in REST API style to server with specified pattern. Note that the route method should be defined as ghttp.HandlerFunc.

Jump to

Keyboard shortcuts

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