httpserver

package
v3.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnablePProfOnDebugMode

func EnablePProfOnDebugMode(conf config.HttpServerConf, r *gin.Engine)

EnablePProfOnDebugMode 启动pprof检测

func InitGinEngine

func InitGinEngine(conf config.HttpServerConf) *gin.Engine

InitGinEngine 初始化gin引擎

Note:

该方法会默认使用 middleware.LogTrace 中间件

func RunHttpServer

func RunHttpServer(conf config.HttpServerConf, ginEngine *gin.Engine, apiOption *api.Option, wg *sync.WaitGroup)

RunHttpServer 启动http服务

func RunPrometheusServerWhenEnable added in v3.0.2

func RunPrometheusServerWhenEnable(conf config.PrometheusConf)

RunPrometheusServerWhenEnable 启动prometheus指标收集服务

当配置文件指明启用时才会启动

func RunSwaggerServerWhenEnable added in v3.0.2

func RunSwaggerServerWhenEnable(conf config.SwaggerConf, ginEngine *gin.Engine)

RunSwaggerServerWhenEnable 启动swagger文档服务

当配置文件指明启用时才会启动

func WrapWebsocketHandler added in v3.0.3

func WrapWebsocketHandler(ws *websocket.Conn, handler func(ws *websocket.Conn)) func(ginContext *gin.Context)

WrapWebsocketHandler 包装websocket处理函数

@param ws websocket连接实例

@param handler websocket消息处理函数

Types

This section is empty.

Jump to

Keyboard shortcuts

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