enet

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 License: Apache-2.0 Imports: 10 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrHttpGroupNil = errors.New("http group nil")
	ErrHttpLogNil   = errors.New("log is nil")
)

Functions

func InitHttpServerSingle

func InitHttpServerSingle(ec *EnetConfig) error

Types

type CommonJsonResp

type CommonJsonResp struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
}

func CreateJsonResp

func CreateJsonResp(code int, msg string) CommonJsonResp

func CreateSuccessJsonResp

func CreateSuccessJsonResp() CommonJsonResp

type Context

type Context struct {
	*gin.Context
}

type EnetConfig

type EnetConfig struct {
	L    NetLog
	Host string
}

type HandlerFunc

type HandlerFunc func(c *Context)

type HttpServer

type HttpServer struct {
	// contains filtered or unexported fields
}
var (
	HttpWeb *HttpServer
)

func InitHttpServer

func InitHttpServer(ec *EnetConfig) (*HttpServer, error)

func (*HttpServer) Any

func (h *HttpServer) Any(path string, handlers ...HandlerFunc)

func (*HttpServer) Close

func (h *HttpServer) Close()

func (*HttpServer) Get

func (h *HttpServer) Get(path string, handlers ...HandlerFunc)

func (*HttpServer) NewGroup

func (h *HttpServer) NewGroup(path string) *RouterGroup

func (*HttpServer) Post

func (h *HttpServer) Post(path string, handlers ...HandlerFunc)

func (*HttpServer) Run

func (h *HttpServer) Run()

type NetLog

type NetLog interface {
	Debugf(f string, args ...interface{})
	Infof(f string, args ...interface{})
	Warnf(f string, args ...interface{})
	Errorf(f string, args ...interface{})
}

type RouterGroup

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

func (*RouterGroup) Any

func (r *RouterGroup) Any(relativePath string, handlers ...HandlerFunc)

func (*RouterGroup) Get

func (r *RouterGroup) Get(relativePath string, handlers ...HandlerFunc)

func (*RouterGroup) Post

func (r *RouterGroup) Post(relativePath string, handlers ...HandlerFunc)

Jump to

Keyboard shortcuts

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