http_server

package
v0.0.0-...-bf85ca1 Latest Latest
Warning

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

Go to latest
Published: May 8, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const SDID = "HttpServer-Impl"

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPServerConfig

type HTTPServerConfig struct {
	Port int `yaml:"port"`
}

type HttpServer

type HttpServer interface {
	RegisterRouter(path string, handler func(*ghttp.GRegisterController) error, req interface{},
		rsp interface{}, method string, filters []ghttp.Filter)
	RegisterWSRouter(path string, handler func(*ghttp.GRegisterWSController))
	RegisterRouterWithRawHttpHandler(path string, handler func(w http.ResponseWriter, r *http.Request), method string)

	Run(ctx context.Context)
}

type Impl

type Impl struct {
	// contains filtered or unexported fields
}

func GetHTTPServer

func GetHTTPServer() *Impl

GetHTTPServer developr APi

func (*Impl) RegisterRouter

func (hs *Impl) RegisterRouter(path string, handler func(*ghttp.GRegisterController) error, req interface{},
	rsp interface{}, method string, filters []ghttp.Filter)

RegisterRouter user API

func (*Impl) RegisterRouterWithRawHttpHandler

func (hs *Impl) RegisterRouterWithRawHttpHandler(path string, handler func(w http.ResponseWriter, r *http.Request), method string)

RegisterRouterWithRawHttpHandler user API

func (*Impl) RegisterWSRouter

func (hs *Impl) RegisterWSRouter(path string, handler func(*ghttp.GRegisterWSController))

RegisterWSRouter user API

func (*Impl) Run

func (hs *Impl) Run(ctx context.Context)

func (*Impl) UseGloryMW

func (hs *Impl) UseGloryMW(filters ...ghttp.Filter)

func (*Impl) UseMW

func (hs *Impl) UseMW(filters ...negroni.Handler)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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