yusvr

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GrpcPrometheus

func GrpcPrometheus() grpc.ServerOption

GrpcPrometheus prometheus grpc中间件

func GrpcRecovery

func GrpcRecovery() grpc.ServerOption

GrpcRecovery grpc接口panic恢复中间件

Types

type IEchoServer

type IEchoServer interface {
	yu.IServer
	Echo() *echo.Echo
	Health()
	Group(path string, m ...echo.MiddlewareFunc) *echo.Group
	JSON(c echo.Context, data any) error
	JsonOK(c echo.Context, data any) error
	JsonErr(c echo.Context, err error) error
	JsonMsg(c echo.Context, msg string) error
	PbOK(c echo.Context, m proto.Message) error
	GzipPbOK(c echo.Context, m proto.Message) error
	PbErr(c echo.Context, err error) error
	Promethous(name, pass string)
	PromeMetrics() echo.MiddlewareFunc
	BasicAuth(name, pass string) echo.MiddlewareFunc
	NoCache() echo.MiddlewareFunc
}

IEchoServer echo服务实现接口

func NewEchoServer

func NewEchoServer(name, addr string) IEchoServer

NewEchoServer 创建EchoServer

type IGinServer

type IGinServer interface {
	yu.IServer
	Gin() *gin.Engine
	Health()
	Group(path string, handlers ...gin.HandlerFunc) *gin.RouterGroup
	JSON(c *gin.Context, data any)
	GzipJSON(c *gin.Context, data any)
	JsonOK(c *gin.Context, data any)
	JsonErr(c *gin.Context, err error)
	JsonMsg(c *gin.Context, msg string)
	PbOK(c *gin.Context, m proto.Message) error
	GzipPbOK(c *gin.Context, m proto.Message) error
	PbErr(c *gin.Context, err error) error
	Promethous(name, pass string)
	NoCache() gin.HandlerFunc
	BasicAuth(username, password string) gin.HandlerFunc
	LogControl(trace bool, skip []string) gin.HandlerFunc
	CORS(origin, methods, headers, age string) gin.HandlerFunc
	DefaultCORS() gin.HandlerFunc
	PromeMetrics() gin.HandlerFunc
}

IEchoServer gin服务实现接口

func NewGinServer

func NewGinServer(name, addr, mod string) IGinServer

NewGinServer 创建GinServer

type IGrpcServer

type IGrpcServer interface {
	yu.IServer
	grpc.ServiceRegistrar
}

IGrpcServer grpc server接口

func NewGrpcServer

func NewGrpcServer(name, addr string, reg func(IGrpcServer), opt ...grpc.ServerOption) IGrpcServer

NewGrpcServer 创建GrpcServer

Jump to

Keyboard shortcuts

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