grpc

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2021 License: Apache-2.0 Imports: 9 Imported by: 8

Documentation

Index

Constants

View Source
const DefaultRPCTimeout = 60 * time.Second

DefaultRPCTimeout specifies default timeout of RPC between controller and chaos-operator

Variables

View Source
var RPCTimeout = DefaultRPCTimeout

RPCTimeout specifies timeout of RPC between controller and chaos-operator

Functions

func CreateGrpcConnection

func CreateGrpcConnection(address string, port int, caCertPath string, certPath string, keyPath string) (*grpc.ClientConn, error)

CreateGrpcConnection create a grpc connection with given port and address

func CreateGrpcConnectionFromRaw added in v1.2.0

func CreateGrpcConnectionFromRaw(address string, port int, caCert []byte, cert []byte, key []byte) (*grpc.ClientConn, error)

CreateGrpcConnectionFromRaw create a grpc connection with given port and address, and use raw data instead of file path

func TimeoutClientInterceptor

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

TimeoutClientInterceptor wraps the RPC with a timeout.

func TimeoutServerInterceptor

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

TimeoutServerInterceptor ensures the context is intact before handling over the request to application.

Types

This section is empty.

Jump to

Keyboard shortcuts

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