Documentation ¶
Index ¶
- Variables
- func AddPemToCertPool(pemCerts []byte, pool *x509.CertPool) error
- func ClientKeepaliveOptions(ka KeepaliveOptions) []grpc.DialOption
- func ExtractCertificateFromContext(ctx context.Context) *x509.Certificate
- func ExtractCertificateHashFromContext(ctx context.Context) []byte
- func ExtractRawCertificateFromContext(ctx context.Context) []byte
- func GetLocalIP() (string, error)
- func NewServerTransportCredentials(serverConfig *tls.Config, logger *flogging.FabricLogger) credentials.TransportCredentials
- func ServerKeepaliveOptions(ka KeepaliveOptions) []grpc.ServerOption
- type BindingInspector
- type CertHashExtractor
- type ClientConfig
- type ConnectionFactory
- type ConnectionProducer
- type CredentialSupport
- func (cs *CredentialSupport) AppRootCAsByChain() map[string][][]byte
- func (cs *CredentialSupport) BuildTrustedRootsForChain(cm channelconfig.Resources)
- func (cs *CredentialSupport) GetClientCertificate() tls.Certificate
- func (cs *CredentialSupport) GetDeliverServiceCredentials(channelID string) (credentials.TransportCredentials, error)
- func (cs *CredentialSupport) GetPeerCredentials() credentials.TransportCredentials
- func (cs *CredentialSupport) SetClientCertificate(cert tls.Certificate)
- type EndpointCriteria
- type GRPCClient
- func (client *GRPCClient) Certificate() tls.Certificate
- func (client *GRPCClient) MutualTLSRequired() bool
- func (client *GRPCClient) NewConnection(address string, tlsOptions ...TLSOption) (*grpc.ClientConn, error)
- func (client *GRPCClient) SetMaxRecvMsgSize(size int)
- func (client *GRPCClient) SetMaxSendMsgSize(size int)
- func (client *GRPCClient) SetServerRootCAs(serverRoots [][]byte) error
- func (client *GRPCClient) TLSEnabled() bool
- type GRPCServer
- func (gServer *GRPCServer) Address() string
- func (gServer *GRPCServer) AppendClientRootCAs(clientRoots [][]byte) error
- func (gServer *GRPCServer) Listener() net.Listener
- func (gServer *GRPCServer) MutualTLSRequired() bool
- func (gServer *GRPCServer) Server() *grpc.Server
- func (gServer *GRPCServer) ServerCertificate() tls.Certificate
- func (gServer *GRPCServer) SetClientRootCAs(clientRoots [][]byte) error
- func (gServer *GRPCServer) SetServerCertificate(cert tls.Certificate)
- func (gServer *GRPCServer) Start() error
- func (gServer *GRPCServer) Stop()
- func (gServer *GRPCServer) TLSEnabled() bool
- type HealthCheckClient
- type KeepaliveOptions
- type Metrics
- type NewSemaphoreFunc
- type SecureOptions
- type Semaphore
- type ServerConfig
- type ServerStatsHandler
- func (h *ServerStatsHandler) HandleConn(ctx context.Context, s stats.ConnStats)
- func (h *ServerStatsHandler) HandleRPC(ctx context.Context, s stats.RPCStats)
- func (h *ServerStatsHandler) TagConn(ctx context.Context, info *stats.ConnTagInfo) context.Context
- func (h *ServerStatsHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context
- type TLSOption
- type Throttle
- type ThrottleOption
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MaxRecvMsgSize = 100 * 1024 * 1024 MaxSendMsgSize = 100 * 1024 * 1024 DefaultKeepaliveOptions = KeepaliveOptions{ ClientInterval: time.Duration(1) * time.Minute, ClientTimeout: time.Duration(20) * time.Second, ServerInterval: time.Duration(2) * time.Hour, ServerTimeout: time.Duration(20) * time.Second, ServerMinInterval: time.Duration(1) * time.Minute, } DefaultTLSCipherSuites = []uint16{ tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, tls.TLS_RSA_WITH_AES_128_GCM_SHA256, tls.TLS_RSA_WITH_AES_256_GCM_SHA384, } DefaultConnectionTimeout = 5 * time.Second )
View Source
var ( ErrClientHandshakeNotImplemented = errors.New("core/comm: client handshakes are not implemented with serverCreds") ErrOverrideHostnameNotSupported = errors.New("core/comm: OverrideServerName is not supported") )
Functions ¶
func ClientKeepaliveOptions ¶
func ClientKeepaliveOptions(ka KeepaliveOptions) []grpc.DialOption
func ExtractCertificateFromContext ¶
func ExtractCertificateFromContext(ctx context.Context) *x509.Certificate
func GetLocalIP ¶
func NewServerTransportCredentials ¶
func NewServerTransportCredentials( serverConfig *tls.Config, logger *flogging.FabricLogger) credentials.TransportCredentials
func ServerKeepaliveOptions ¶
func ServerKeepaliveOptions(ka KeepaliveOptions) []grpc.ServerOption
Types ¶
type BindingInspector ¶
func NewBindingInspector ¶
func NewBindingInspector(mutualTLS bool, extractTLSCertHash CertHashExtractor) BindingInspector
type CertHashExtractor ¶
type ClientConfig ¶
type ClientConfig struct { SecOpts SecureOptions KaOpts KeepaliveOptions Timeout time.Duration AsyncConnect bool }
func (ClientConfig) Clone ¶
func (cc ClientConfig) Clone() ClientConfig
type ConnectionFactory ¶
type ConnectionProducer ¶
type ConnectionProducer interface { NewConnection() (*grpc.ClientConn, string, error) UpdateEndpoints(endpoints []string) GetEndpoints() []string }
func NewConnectionProducer ¶
func NewConnectionProducer( factory ConnectionFactory, endpoints []string, deliverClientDialOpts []grpc.DialOption, peerTLSEnabled bool, connectionTimeout time.Duration, ) ConnectionProducer
type CredentialSupport ¶
type CredentialSupport struct {
// contains filtered or unexported fields
}
func NewCredentialSupport ¶
func NewCredentialSupport(rootCAs ...[]byte) *CredentialSupport
func (*CredentialSupport) AppRootCAsByChain ¶
func (cs *CredentialSupport) AppRootCAsByChain() map[string][][]byte
func (*CredentialSupport) BuildTrustedRootsForChain ¶
func (cs *CredentialSupport) BuildTrustedRootsForChain(cm channelconfig.Resources)
func (*CredentialSupport) GetClientCertificate ¶
func (cs *CredentialSupport) GetClientCertificate() tls.Certificate
func (*CredentialSupport) GetDeliverServiceCredentials ¶
func (cs *CredentialSupport) GetDeliverServiceCredentials(channelID string) (credentials.TransportCredentials, error)
func (*CredentialSupport) GetPeerCredentials ¶
func (cs *CredentialSupport) GetPeerCredentials() credentials.TransportCredentials
func (*CredentialSupport) SetClientCertificate ¶
func (cs *CredentialSupport) SetClientCertificate(cert tls.Certificate)
type EndpointCriteria ¶
func (EndpointCriteria) Equals ¶
func (ec EndpointCriteria) Equals(other EndpointCriteria) bool
type GRPCClient ¶
type GRPCClient struct {
// contains filtered or unexported fields
}
func NewGRPCClient ¶
func NewGRPCClient(config ClientConfig) (*GRPCClient, error)
func (*GRPCClient) Certificate ¶
func (client *GRPCClient) Certificate() tls.Certificate
func (*GRPCClient) MutualTLSRequired ¶
func (client *GRPCClient) MutualTLSRequired() bool
func (*GRPCClient) NewConnection ¶
func (client *GRPCClient) NewConnection(address string, tlsOptions ...TLSOption) (*grpc.ClientConn, error)
func (*GRPCClient) SetMaxRecvMsgSize ¶
func (client *GRPCClient) SetMaxRecvMsgSize(size int)
func (*GRPCClient) SetMaxSendMsgSize ¶
func (client *GRPCClient) SetMaxSendMsgSize(size int)
func (*GRPCClient) SetServerRootCAs ¶
func (client *GRPCClient) SetServerRootCAs(serverRoots [][]byte) error
func (*GRPCClient) TLSEnabled ¶
func (client *GRPCClient) TLSEnabled() bool
type GRPCServer ¶
type GRPCServer struct {
// contains filtered or unexported fields
}
func NewGRPCServer ¶
func NewGRPCServer(address string, serverConfig ServerConfig) (*GRPCServer, error)
func NewGRPCServerFromListener ¶
func NewGRPCServerFromListener(listener net.Listener, serverConfig ServerConfig) (*GRPCServer, error)
func (*GRPCServer) Address ¶
func (gServer *GRPCServer) Address() string
func (*GRPCServer) AppendClientRootCAs ¶
func (gServer *GRPCServer) AppendClientRootCAs(clientRoots [][]byte) error
func (*GRPCServer) Listener ¶
func (gServer *GRPCServer) Listener() net.Listener
func (*GRPCServer) MutualTLSRequired ¶
func (gServer *GRPCServer) MutualTLSRequired() bool
func (*GRPCServer) Server ¶
func (gServer *GRPCServer) Server() *grpc.Server
func (*GRPCServer) ServerCertificate ¶
func (gServer *GRPCServer) ServerCertificate() tls.Certificate
func (*GRPCServer) SetClientRootCAs ¶
func (gServer *GRPCServer) SetClientRootCAs(clientRoots [][]byte) error
func (*GRPCServer) SetServerCertificate ¶
func (gServer *GRPCServer) SetServerCertificate(cert tls.Certificate)
func (*GRPCServer) Start ¶
func (gServer *GRPCServer) Start() error
func (*GRPCServer) Stop ¶
func (gServer *GRPCServer) Stop()
func (*GRPCServer) TLSEnabled ¶
func (gServer *GRPCServer) TLSEnabled() bool
type HealthCheckClient ¶
type HealthCheckClient struct { Client *GRPCClient Address string Service string }
func NewHealthCheckClient ¶
func NewHealthCheckClient(config ClientConfig, address, service string) (HealthCheckClient, error)
func (HealthCheckClient) HealthCheck ¶
func (hcc HealthCheckClient) HealthCheck(ctx context.Context) error
type KeepaliveOptions ¶
type NewSemaphoreFunc ¶
type SecureOptions ¶
type ServerConfig ¶
type ServerConfig struct { ConnectionTimeout time.Duration SecOpts SecureOptions KaOpts KeepaliveOptions StreamInterceptors []grpc.StreamServerInterceptor UnaryInterceptors []grpc.UnaryServerInterceptor Logger *flogging.FabricLogger MetricsProvider metrics.Provider HealthCheckEnabled bool }
type ServerStatsHandler ¶
type ServerStatsHandler struct { OpenConnCounter metrics.Counter ClosedConnCounter metrics.Counter }
func NewServerStatsHandler ¶
func NewServerStatsHandler(p metrics.Provider) *ServerStatsHandler
func (*ServerStatsHandler) HandleConn ¶
func (h *ServerStatsHandler) HandleConn(ctx context.Context, s stats.ConnStats)
func (*ServerStatsHandler) HandleRPC ¶
func (h *ServerStatsHandler) HandleRPC(ctx context.Context, s stats.RPCStats)
func (*ServerStatsHandler) TagConn ¶
func (h *ServerStatsHandler) TagConn(ctx context.Context, info *stats.ConnTagInfo) context.Context
func (*ServerStatsHandler) TagRPC ¶
func (h *ServerStatsHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context
type TLSOption ¶
func ServerNameOverride ¶
type Throttle ¶
type Throttle struct {
// contains filtered or unexported fields
}
func NewThrottle ¶
func NewThrottle(maxConcurrency int, options ...ThrottleOption) *Throttle
func (*Throttle) StreamServerInterceptor ¶
func (t *Throttle) StreamServerInterceptor(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error
func (*Throttle) UnaryServerIntercptor ¶
func (t *Throttle) UnaryServerIntercptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
type ThrottleOption ¶
type ThrottleOption func(t *Throttle)
func WithNewSemaphore ¶
func WithNewSemaphore(newSemaphore NewSemaphoreFunc) ThrottleOption
Source Files ¶
Click to show internal directories.
Click to hide internal directories.