grpc

package module
v2.0.0-...-341fd6f Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2022 License: MIT Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrGrpcInternal = status.New(codes.Internal, "internal server error").Err()

Functions

func StreamClientInterceptor

func StreamClientInterceptor(opts ...Option) grpc.StreamClientInterceptor

func StreamServerInterceptor

func StreamServerInterceptor(opts ...Option) grpc.StreamServerInterceptor

func UnaryClientInterceptor

func UnaryClientInterceptor(o ...Option) grpc.UnaryClientInterceptor

UnaryClientInterceptor input ctx assume that it contain telemetry instance as well as invoker already under our telemetry UnaryClientInterceptor implement:

  • recovery
  • detail log during errors (+ in recovery also)
  • measure execution time

func UnaryClientInterceptorAll

func UnaryClientInterceptorAll(o ...Option) grpc.UnaryClientInterceptor

UnaryClientInterceptorAll setup recovery, metrics, tracing and debug option according goal of our framework Execution order:

  • opentracing injection via otgrpc.OpenTracingClientInterceptor
  • recovery, measure execution time + debug log via own UnaryClientInterceptor
  • metrics via metrics.UnaryClientInterceptor

func UnaryServerInterceptor

func UnaryServerInterceptor(o ...Option) grpc.UnaryServerInterceptor

UnaryServerInterceptor the most important create new telepresence instance + fill trace ids

implements:
* new telepresence instance
* fill trace ids
* recovery
* detail log during errors (+ in recovery also)
* measure execution time

func UnaryServerInterceptorAll

func UnaryServerInterceptorAll(o ...Option) grpc.UnaryServerInterceptor

UnaryServerInterceptorAll setup recovery, metrics, tracing and debug option according goal of our framework Execution order:otracer

  • opentracing injection via otgrpc.OpenTracingServerInterceptor
  • ctx new instance, recovery, measure execution time + debug log via own UnaryServerInterceptor
  • metrics via metrics.UnaryServerInterceptor

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option interface used for setting optional config properties.

func WithIgnoreList

func WithIgnoreList(ignore []string) Option

func WithMetricOption

func WithMetricOption(option ...otelgrpc.Option) Option

WithMetricOption overwrite already existed options

func WithTel

func WithTel(t *tel.Telemetry) Option

func WithTracerOption

func WithTracerOption(opts ...otracer.Option) Option

WithTracerOption overwrite already existed options

Jump to

Keyboard shortcuts

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