rpcutil

package
v3.40.2 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: Apache-2.0 Imports: 26 Imported by: 20

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GrpcChannelOptions

func GrpcChannelOptions() grpc.DialOption

GrpcChannelOptions returns the defaultCallOptions with the max_receive_message_length increased to 400mb We want to increase the default message size as per pulumi/pulumi#2319

func Healthcheck added in v3.34.0

func Healthcheck(context context.Context, addr string, duration time.Duration, cancel context.CancelFunc) error

Healthcheck will poll the address at duration intervals and then call cancel once it reports unhealthy

func IsBenignCloseErr

func IsBenignCloseErr(err error) bool

IsBenignCloseErr returns true if the error is "expected" upon shutdown of the server.

func MakeStreams added in v3.29.0

Returns a pair of streams for use with the language runtimes InstallDependencies method

func OpenTracingClientInterceptor

func OpenTracingClientInterceptor(options ...otgrpc.Option) grpc.UnaryClientInterceptor

OpenTracingClientInterceptor provides a default gRPC client interceptor for emitting tracing to the global OpenTracing tracer.

func OpenTracingServerInterceptor

func OpenTracingServerInterceptor(parentSpan opentracing.Span, options ...otgrpc.Option) grpc.UnaryServerInterceptor

OpenTracingServerInterceptor provides a default gRPC server interceptor for emitting tracing to the global OpenTracing tracer.

func OpenTracingStreamClientInterceptor added in v3.39.4

func OpenTracingStreamClientInterceptor(options ...otgrpc.Option) grpc.StreamClientInterceptor

Like OpenTracingClientInterceptor but for streaming gRPC calls.

func OpenTracingStreamServerInterceptor added in v3.39.4

func OpenTracingStreamServerInterceptor(parentSpan opentracing.Span,
	options ...otgrpc.Option) grpc.StreamServerInterceptor

Like OpenTracingServerInterceptor but for instrumenting streaming gRPC calls.

func Serve

func Serve(port int, cancel chan bool, registers []func(*grpc.Server) error,
	parentSpan opentracing.Span, options ...otgrpc.Option) (int, chan error, error)

Serve creates a new gRPC server, calls out to the supplied registration functions to bind interfaces, and then listens on the supplied TCP port. If the caller wishes for the kernel to choose a free port automatically, pass 0 as the port number. The return values are: the chosen port (the same as supplied if non-0), a channel that may eventually return an error, and an error, in case something went wrong. The channel is non-nil and waits until the server is finished, in the case of a successful launch of the RPC server.

Types

This section is empty.

Directories

Path Synopsis
Package rpcerror provides helper types and functions for dealing with errors that cross gRPC boundaries.
Package rpcerror provides helper types and functions for dealing with errors that cross gRPC boundaries.

Jump to

Keyboard shortcuts

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