Documentation ¶
Index ¶
- Constants
- func Dial(hostName string, tlsConfig *tls.Config) (*grpc.ClientConn, error)
- func NewContextFromParentWithTimeoutAndHeaders(parentCtx context.Context, timeout time.Duration) (context.Context, context.CancelFunc)
- func NewContextWithCLIHeaders() (context.Context, context.CancelFunc)
- func NewContextWithTimeout(timeout time.Duration) (context.Context, context.CancelFunc)
- func NewContextWithTimeoutAndCLIHeaders(timeout time.Duration) (context.Context, context.CancelFunc)
- func NewContextWithTimeoutAndHeaders(timeout time.Duration) (context.Context, context.CancelFunc)
- type RPCFactory
- func (d *RPCFactory) CreateFrontendGRPCConnection(hostName string) *grpc.ClientConn
- func (d *RPCFactory) CreateInternodeGRPCConnection(hostName string) *grpc.ClientConn
- func (d *RPCFactory) GetFrontendClientTlsConfig() (*tls.Config, error)
- func (d *RPCFactory) GetFrontendGRPCServerOptions() ([]grpc.ServerOption, error)
- func (d *RPCFactory) GetGRPCListener() net.Listener
- func (d *RPCFactory) GetInternodeClientTlsConfig() (*tls.Config, error)
- func (d *RPCFactory) GetInternodeGRPCServerOptions() ([]grpc.ServerOption, error)
- func (d *RPCFactory) GetRingpopChannel() *tchannel.Channel
Constants ¶
const ( // DefaultServiceConfig is a default gRPC connection service config which enables DNS round robin between IPs. // To use DNS resolver, a "dns:///" prefix should be applied to the hostPort // https://github.com/grpc/grpc/blob/master/doc/naming.md DefaultServiceConfig = `{"loadBalancingConfig": [{"round_robin":{}}]}` )
Variables ¶
This section is empty.
Functions ¶
func Dial ¶
Dial creates a client connection to the given target with default options. The hostName syntax is defined in https://github.com/grpc/grpc/blob/master/doc/naming.md. e.g. to use dns resolver, a "dns:///" prefix should be applied to the target.
func NewContextFromParentWithTimeoutAndHeaders ¶
func NewContextFromParentWithTimeoutAndHeaders(parentCtx context.Context, timeout time.Duration) (context.Context, context.CancelFunc)
NewContextFromParentWithTimeoutAndHeaders creates context from parent context with timeout and version headers.
func NewContextWithCLIHeaders ¶
func NewContextWithCLIHeaders() (context.Context, context.CancelFunc)
NewContextWithCLIHeaders creates context with version headers for CLI.
func NewContextWithTimeout ¶
NewContextWithTimeout creates context with timeout.
func NewContextWithTimeoutAndCLIHeaders ¶
func NewContextWithTimeoutAndCLIHeaders(timeout time.Duration) (context.Context, context.CancelFunc)
NewContextWithTimeoutAndCLIHeaders creates context with timeout and version headers for CLI.
func NewContextWithTimeoutAndHeaders ¶
NewContextWithTimeoutAndHeaders creates context with timeout and version headers.
Types ¶
type RPCFactory ¶
RPCFactory is an implementation of service.RPCFactory interface
func NewFactory ¶
func NewFactory(cfg *config.RPC, sName string, logger log.Logger, tlsProvider encryption.TLSConfigProvider) *RPCFactory
NewFactory builds a new RPCFactory conforming to the underlying configuration
func (*RPCFactory) CreateFrontendGRPCConnection ¶
func (d *RPCFactory) CreateFrontendGRPCConnection(hostName string) *grpc.ClientConn
CreateGRPCConnection creates connection for gRPC calls
func (*RPCFactory) CreateInternodeGRPCConnection ¶
func (d *RPCFactory) CreateInternodeGRPCConnection(hostName string) *grpc.ClientConn
CreateGRPCConnection creates connection for gRPC calls
func (*RPCFactory) GetFrontendClientTlsConfig ¶
func (d *RPCFactory) GetFrontendClientTlsConfig() (*tls.Config, error)
func (*RPCFactory) GetFrontendGRPCServerOptions ¶
func (d *RPCFactory) GetFrontendGRPCServerOptions() ([]grpc.ServerOption, error)
func (*RPCFactory) GetGRPCListener ¶
func (d *RPCFactory) GetGRPCListener() net.Listener
GetGRPCListener returns cached dispatcher for gRPC inbound or creates one
func (*RPCFactory) GetInternodeClientTlsConfig ¶
func (d *RPCFactory) GetInternodeClientTlsConfig() (*tls.Config, error)
func (*RPCFactory) GetInternodeGRPCServerOptions ¶
func (d *RPCFactory) GetInternodeGRPCServerOptions() ([]grpc.ServerOption, error)
func (*RPCFactory) GetRingpopChannel ¶
func (d *RPCFactory) GetRingpopChannel() *tchannel.Channel
GetRingpopChannel return a cached ringpop dispatcher