grpchelper

package
Version: v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2019 License: AGPL-3.0 Imports: 11 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LogAsDebug = false

LogAsDebug allows to log gRPC messages as debug level instead of info level

Functions

func CtxlogStreamClientInterceptor added in v0.8.0

func CtxlogStreamClientInterceptor(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error)

CtxlogStreamClientInterceptor is a streaming client interceptor that adds the ctxlog log.Fields to the grpc metadata, with the method pb.AddLogFields

func CtxlogStreamServerInterceptor added in v0.8.0

func CtxlogStreamServerInterceptor(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error

CtxlogStreamServerInterceptor is a streaming server interceptor that adds to the context a ctxlog configured with the log Fields found in the request metadata.

func CtxlogUnaryClientInterceptor added in v0.8.0

func CtxlogUnaryClientInterceptor(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error

CtxlogUnaryClientInterceptor is a unary client interceptor that adds the ctxlog log.Fields to the grpc metadata, with the method pb.AddLogFields

func CtxlogUnaryServerInterceptor added in v0.8.0

func CtxlogUnaryServerInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

CtxlogUnaryServerInterceptor is a unary server interceptor that adds to the context a ctxlog configured with the log Fields found in the request metadata.

func DialContext

func DialContext(ctx context.Context, target string, opts ...grpc.DialOption) (*grpc.ClientConn, error)

DialContext creates a client connection to the given target with custom options and log interceptors

func LogConnStatusChanges added in v0.0.3

func LogConnStatusChanges(ctx context.Context, l log.Logger, conn *grpc.ClientConn)

LogConnStatusChanges logs gRPC connection status changes

func NewBblfshProxyServer added in v0.5.0

func NewBblfshProxyServer(addr string) (*grpc.Server, error)

NewBblfshProxyServer creates gRPC server that proxies call to bblfsh

func NewServer

func NewServer(opts ...grpc.ServerOption) *grpc.Server

NewServer creates new grpc.Server with custom options and log interceptors

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL