utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2022 License: Apache-2.0 Imports: 18 Imported by: 6

Documentation

Index

Constants

View Source
const ContextReqUUid = "req_uuid"
View Source
const JWT_CONTEXT_KEY = "jwt_context_key"

Variables

View Source
var (
	TracingComponentTag = opentracing.Tag{Key: string(ext.Component), Value: "grpc"}
)

Functions

func CreateJwtToken

func CreateJwtToken(name string, dcId int) (string, error)

func GetLogger

func GetLogger() *zap.Logger

func JaegerClientMiddleware

func JaegerClientMiddleware(tracer opentracing.Tracer) grpc.UnaryClientInterceptor

func JaegerServerMiddleware

func JaegerServerMiddleware(tracer opentracing.Tracer) grpc.UnaryServerInterceptor

func NewJaegerTracer

func NewJaegerTracer(serviceName string) (tracer opentracing.Tracer, closer io.Closer, err error)

func NewLoggerServer

func NewLoggerServer()

func ParseToken

func ParseToken(token string) (jwt.MapClaims, error)

Types

type Hystrix

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

func NewHystrix

func NewHystrix(msg string) *Hystrix

func (*Hystrix) Run

func (s *Hystrix) Run(name string, run runFunc) error

type LogErrorHandler

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

func NewZapLogErrorHandler

func NewZapLogErrorHandler(logger *zap.Logger) *LogErrorHandler

func (*LogErrorHandler) Handle

func (h *LogErrorHandler) Handle(ctx context.Context, err error)

type MDReaderWriter

type MDReaderWriter struct {
	metadata.MD
}

func (MDReaderWriter) ForeachKey

func (c MDReaderWriter) ForeachKey(handler func(key, val string) error) error

func (MDReaderWriter) Set

func (c MDReaderWriter) Set(key, val string)

type Token

type Token struct {
	Name string
	DcId int
	jwt.StandardClaims
}

Jump to

Keyboard shortcuts

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