mw

package
v0.0.50-alpha.35 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CorsHandler

func CorsHandler() gin.HandlerFunc

CorsHandler gin cross-domain configuration.

func CreateToken

func CreateToken(userID string, accessSecret string, accessExpire int64, platformID int) (string, error)

func FormatError

func FormatError(err error) error

func GinPanicErr

func GinPanicErr(c *gin.Context, err any)

func GinParseOperationID

func GinParseOperationID() gin.HandlerFunc

func GinParseToken

func GinParseToken(secretKey jwt.Keyfunc, whitelist []string) gin.HandlerFunc

func GrpcClient

func GrpcClient() grpc.DialOption

func GrpcServer

func GrpcServer() grpc.ServerOption

func InterceptChain

func InterceptChain(intercepts ...grpc.UnaryServerInterceptor) grpc.UnaryServerInterceptor

func PanicStackToLog

func PanicStackToLog(ctx context.Context, err any)

func ReplaceNil

func ReplaceNil(data any)

ReplaceNil initialization nil values. e.g. Slice will be initialized as [],Map/interface will be initialized as {}

func RpcClientInterceptor

func RpcClientInterceptor(ctx context.Context, method string, req, resp any, cc *grpc.ClientConn,
	invoker grpc.UnaryInvoker, opts ...grpc.CallOption) (err error)

func RpcServerInterceptor

func RpcServerInterceptor(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (any, error)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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