grpc

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const ChaosDaemonServerName = "chaos-daemon.chaos-mesh.org"
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 TimeoutClientInterceptor

func TimeoutClientInterceptor(timeout time.Duration) func(context.Context, string, interface{}, interface{},
	*grpc.ClientConn, grpc.UnaryInvoker, ...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

type CredentialProvider

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

type FileProvider

type FileProvider struct {
	// contains filtered or unexported fields
}

type GrpcBuilder

type GrpcBuilder struct {
	// contains filtered or unexported fields
}

func Builder

func Builder(address string, port int) *GrpcBuilder

func (*GrpcBuilder) Build

func (it *GrpcBuilder) Build() (*grpc.ClientConn, error)

func (*GrpcBuilder) Insecure

func (it *GrpcBuilder) Insecure() *GrpcBuilder

func (*GrpcBuilder) TLSFromFile

func (it *GrpcBuilder) TLSFromFile(caCertPath string, certPath string, keyPath string) *GrpcBuilder

func (*GrpcBuilder) TLSFromRaw

func (it *GrpcBuilder) TLSFromRaw(caCert []byte, cert []byte, key []byte) *GrpcBuilder

func (*GrpcBuilder) WithDefaultTimeout

func (it *GrpcBuilder) WithDefaultTimeout() *GrpcBuilder

func (*GrpcBuilder) WithNamespacedName

func (it *GrpcBuilder) WithNamespacedName(id types.NamespacedName) *GrpcBuilder

func (*GrpcBuilder) WithTimeout

func (it *GrpcBuilder) WithTimeout(timeout time.Duration) *GrpcBuilder

type InsecureProvider

type InsecureProvider struct {
}

type RawProvider

type RawProvider struct {
	// contains filtered or unexported fields
}

type TLSFile

type TLSFile struct {
	CaCert string
	Cert   string
	Key    string
}

type TLSRaw

type TLSRaw struct {
	CaCert []byte
	Cert   []byte
	Key    []byte
}

Jump to

Keyboard shortcuts

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