Documentation ¶
Index ¶
- Variables
- func DialContext(ctx context.Context, target string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
- func Listen(address string) (net.Listener, error)
- func LogConnStatusChanges(ctx context.Context, l log.Logger, conn *grpc.ClientConn)
- func NewServer(opts ...grpc.ServerOption) *grpc.Server
- func SetMaxMessageSize(size int)
- func StreamClientInterceptor(l log.Logger, asDebug bool) grpc.StreamClientInterceptor
- func StreamServerInterceptor(l log.Logger, asDebug bool) grpc.StreamServerInterceptor
- func ToGoGrpcAddress(address string) (string, error)
- func ToNetListenerAddress(target string) (network, address string, err error)
- func UnaryClientInterceptor(l log.Logger, asDebug bool) grpc.UnaryClientInterceptor
- func UnaryServerInterceptor(l log.Logger, asDebug bool) grpc.UnaryServerInterceptor
Constants ¶
This section is empty.
Variables ¶
var LogAsDebug = false
LogAsDebug allows to log gRPC messages as debug level instead of info level
Functions ¶
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 message size
func LogConnStatusChanges ¶
LogConnStatusChanges logs gRPC connection status changes
func NewServer ¶
func NewServer(opts ...grpc.ServerOption) *grpc.Server
NewServer creates new grpc.Server with custom message size
func SetMaxMessageSize ¶
func SetMaxMessageSize(size int)
SetMaxMessageSize overrides default grpc max. message size to send/receive to/from clients
func StreamClientInterceptor ¶
func StreamClientInterceptor(l log.Logger, asDebug bool) grpc.StreamClientInterceptor
StreamClientInterceptor returns a new striming client interceptor that logs the execution of external gRPC calls.
func StreamServerInterceptor ¶
func StreamServerInterceptor(l log.Logger, asDebug bool) grpc.StreamServerInterceptor
StreamServerInterceptor returns a new streaming server interceptor that logs request/response.
func ToGoGrpcAddress ¶
ToGoGrpcAddress converts a standard gRPC target name to a one that is supported by grpc-go.
func ToNetListenerAddress ¶
ToNetListenerAddress converts a gRPC URL to a network+address consumable by net.Listen. For example:
ipv4://127.0.0.1:8080 -> (tcp4, 127.0.0.1:8080)
func UnaryClientInterceptor ¶
func UnaryClientInterceptor(l log.Logger, asDebug bool) grpc.UnaryClientInterceptor
UnaryClientInterceptor returns a new unary client interceptor that logs the execution of external gRPC calls.
func UnaryServerInterceptor ¶
func UnaryServerInterceptor(l log.Logger, asDebug bool) grpc.UnaryServerInterceptor
UnaryServerInterceptor returns a new unary server interceptors that logs request/response.
Types ¶
This section is empty.