...

Package grpc

import "github.com/chaos-mesh/chaos-mesh/pkg/grpc"
Overview
Index

Overview ▾

Constants

const ChaosDaemonServerName = "chaos-daemon.chaos-mesh.org"

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

const DefaultRPCTimeout = 60 * time.Second

Variables

RPCTimeout specifies timeout of RPC between controller and chaos-operator

var RPCTimeout = DefaultRPCTimeout

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.

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
}