Documentation
¶
Index ¶
- Constants
- Variables
- func CreateGrpcConnection(address string, port int, caCertPath string, certPath string, keyPath string) (*grpc.ClientConn, error)
- func CreateGrpcConnectionFromRaw(address string, port int, caCert []byte, cert []byte, key []byte) (*grpc.ClientConn, error)
- func TimeoutClientInterceptor(ctx context.Context, method string, req, reply interface{}, ...) error
- func TimeoutServerInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error)
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.
Click to show internal directories.
Click to hide internal directories.