Documentation ¶
Index ¶
- Constants
- func IsGRPCOutbound(config transport.ClientConfig) bool
- func ListenIP() (net.IP, error)
- func NewDNSPeerChooserFactory(interval time.Duration, logger log.Logger) *dnsPeerChooserFactory
- type Factory
- type HeaderForwardingMiddleware
- type InboundMetricsMiddleware
- type OutboundsBuilder
- type Params
- type PeerChooserFactory
- type ResponseInfo
- type ResponseInfoMiddleware
Constants ¶
const (
// OutboundPublicClient is the name of configured public client outbound
OutboundPublicClient = "public-client"
)
Variables ¶
This section is empty.
Functions ¶
func IsGRPCOutbound ¶ added in v0.24.0
func IsGRPCOutbound(config transport.ClientConfig) bool
Types ¶
type Factory ¶ added in v0.24.0
type Factory struct {
// contains filtered or unexported fields
}
Factory is an implementation of common.RPCFactory interface
func NewFactory ¶ added in v0.24.0
NewFactory builds a new rpc.Factory
func (*Factory) GetChannel ¶ added in v0.24.0
GetChannel returns Tchannel Channel used by Ringpop
func (*Factory) GetDispatcher ¶ added in v0.24.0
func (d *Factory) GetDispatcher() *yarpc.Dispatcher
GetDispatcher return a cached dispatcher
func (*Factory) GetMaxMessageSize ¶ added in v0.24.0
type HeaderForwardingMiddleware ¶ added in v0.24.0
type HeaderForwardingMiddleware struct{}
HeaderForwardingMiddleware forwards headers from current inbound RPC call that is being handled to new outbound calls being made. If new value for the same header key is provided in the outbound request, keep it instead.
type InboundMetricsMiddleware ¶ added in v0.24.0
type InboundMetricsMiddleware struct{}
InboundMetricsMiddleware tags context with additional metric tags from incoming request.
func (*InboundMetricsMiddleware) Handle ¶ added in v0.24.0
func (m *InboundMetricsMiddleware) Handle(ctx context.Context, req *transport.Request, resw transport.ResponseWriter, h transport.UnaryHandler) error
type OutboundsBuilder ¶ added in v0.24.0
type OutboundsBuilder interface {
Build(*grpc.Transport, *tchannel.Transport) (yarpc.Outbounds, error)
}
OutboundsBuilder allows defining outbounds for the dispatcher
func CombineOutbounds ¶ added in v0.24.0
func CombineOutbounds(builders ...OutboundsBuilder) OutboundsBuilder
CombineOutbounds takes multiple outbound builders and combines them
func NewCrossDCOutbounds ¶ added in v0.24.0
func NewCrossDCOutbounds(clusterGroup map[string]config.ClusterInformation, pcf PeerChooserFactory) OutboundsBuilder
func NewDirectOutbound ¶ added in v0.24.0
func NewDirectOutbound(serviceName string, grpcEnabled bool, tlsConfig *tls.Config) OutboundsBuilder
type Params ¶ added in v0.24.0
type Params struct { ServiceName string TChannelAddress string GRPCAddress string GRPCMaxMsgSize int InboundTLS *tls.Config OutboundTLS map[string]*tls.Config InboundMiddleware yarpc.InboundMiddleware OutboundMiddleware yarpc.OutboundMiddleware OutboundsBuilder OutboundsBuilder }
Params allows to configure rpc.Factory
func NewParams ¶ added in v0.24.0
func NewParams(serviceName string, config *config.Config, dc *dynamicconfig.Collection) (Params, error)
NewParams creates parameters for rpc.Factory from the given config
type PeerChooserFactory ¶ added in v0.24.0
type ResponseInfo ¶
type ResponseInfo struct {
Size int
}
ResponseInfo structure is filled with data after the RPC call. It can be obtained with rpc.ContextWithResponseInfo function.
func ContextWithResponseInfo ¶
func ContextWithResponseInfo(parent context.Context) (context.Context, *ResponseInfo)
ContextWithResponseInfo will create a child context that has ResponseInfo set as value. This value will get filled after the call is made and can be used later to retrieve some info of interest.
type ResponseInfoMiddleware ¶
type ResponseInfoMiddleware struct{}
ResponseInfoMiddleware populates context with ResponseInfo structure which contains info about response that was received. In particular, it counts the size of the response in bytes. Such information can be useful down the line, where payload are deserialized and no longer have their size.