Documentation ¶
Overview ¶
Package grpc implements the grpc transport.
This package is experimental and should not be used in production.
Index ¶
Constants ¶
const UserAgent = "yarpc-go/" + yarpc.Version
UserAgent is the User-Agent that will be set for requests. http://www.grpc.io/docs/guides/wire.html#user-agents
Variables ¶
This section is empty.
Functions ¶
func TransportSpec ¶ added in v1.9.0
func TransportSpec(opts ...Option) config.TransportSpec
TransportSpec returns a TransportSpec for the gRPC transport.
See TransportConfig, InboundConfig, and OutboundConfig for details on the different configuration parameters supported by this Transport.
Any TransportOption, InboundOption, or OutboundOption may be passed to this function. These options will be applied BEFORE configuration parameters are interpreted. This allows configuration parameters to override Options provided to TransportSpec.
Types ¶
type Inbound ¶
type Inbound struct {
// contains filtered or unexported fields
}
Inbound is a grpc transport.Inbound.
func (*Inbound) Transports ¶
Transports implements transport.Inbound#Transports.
type InboundConfig ¶ added in v1.9.0
type InboundConfig struct { // Address to listen on. This field is required. Address string `config:"address,interpolate"` }
InboundConfig configures a gRPC Inbound.
inbounds:
grpc: address: ":80"
type InboundOption ¶
type InboundOption func(*inboundOptions)
InboundOption is an option for an inbound.
func WithInboundTracer ¶
func WithInboundTracer(tracer opentracing.Tracer) InboundOption
WithInboundTracer specifies the tracer to use for an inbound.
type Option ¶ added in v1.9.0
type Option interface {
// contains filtered or unexported methods
}
Option is an interface shared by TransportOption, InboundOption, and OutboundOption allowing either to be recognized by TransportSpec().
type Outbound ¶
type Outbound struct {
// contains filtered or unexported fields
}
Outbound is a transport.UnaryOutbound.
func (*Outbound) Call ¶
func (o *Outbound) Call(ctx context.Context, request *transport.Request) (*transport.Response, error)
Call implements transport.UnaryOutbound#Call.
func (*Outbound) Transports ¶
Transports implements transport.Inbound#Transports.
type OutboundConfig ¶ added in v1.9.0
type OutboundConfig struct { // Address to connect to. This field is required. Address string `config:"address,interpolate"` }
OutboundConfig configures a gRPC Outbound.
outbounds:
myservice: grpc: address: ":80"
type OutboundOption ¶
type OutboundOption func(*outboundOptions)
OutboundOption is an option for an outbound.
func WithOutboundTracer ¶
func WithOutboundTracer(tracer opentracing.Tracer) OutboundOption
WithOutboundTracer specifies the tracer to use for an outbound.
type Transport ¶ added in v1.9.0
type Transport struct {
// contains filtered or unexported fields
}
Transport is a grpc transport.Transport.
This currently does not have any additional functionality over creating an Inbound or Outbound separately, but may in the future.
func NewTransport ¶ added in v1.9.0
func NewTransport(options ...TransportOption) *Transport
NewTransport returns a new Transport.
func (*Transport) NewInbound ¶ added in v1.9.0
func (t *Transport) NewInbound(listener net.Listener, options ...InboundOption) *Inbound
NewInbound returns a new Inbound for the given listener.
func (*Transport) NewSingleOutbound ¶ added in v1.9.0
func (t *Transport) NewSingleOutbound(address string, options ...OutboundOption) *Outbound
NewSingleOutbound returns a new Outbound for the given adrress.
type TransportConfig ¶ added in v1.9.0
type TransportConfig struct{}
TransportConfig configures a gRPC Transport.
This is currently just a placeholder.
type TransportOption ¶ added in v1.9.0
type TransportOption func(*transportOptions)
TransportOption is an option for a transport.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package grpcheader provides the headers functionality for gRPC.
|
Package grpcheader provides the headers functionality for gRPC. |