Documentation ¶
Index ¶
- Variables
- type RPC
- func (v *RPC) Decode(sr stream.Reader) error
- func (v *RPC) Encode(sw stream.Writer) error
- func (v *RPC) Equals(rhs *RPC) bool
- func (v *RPC) FromWire(w wire.Value) error
- func (v *RPC) GetBody() (o []byte)
- func (v *RPC) GetCallerName() (o string)
- func (v *RPC) GetEncoding() (o string)
- func (v *RPC) GetHeaders() (o map[string]string)
- func (v *RPC) GetProcedure() (o string)
- func (v *RPC) GetRoutingDelegate() (o string)
- func (v *RPC) GetRoutingKey() (o string)
- func (v *RPC) GetServiceName() (o string)
- func (v *RPC) GetShardKey() (o string)
- func (v *RPC) GetSpanContext() (o []byte)
- func (v *RPC) IsSetBody() bool
- func (v *RPC) IsSetHeaders() bool
- func (v *RPC) IsSetRoutingDelegate() bool
- func (v *RPC) IsSetRoutingKey() bool
- func (v *RPC) IsSetShardKey() bool
- func (v *RPC) IsSetSpanContext() bool
- func (v *RPC) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
- func (v *RPC) String() string
- func (v *RPC) ToWire() (wire.Value, error)
Constants ¶
This section is empty.
Variables ¶
var ThriftModule = &thriftreflect.ThriftModule{
Name: "internal",
Package: "go.uber.org/yarpc/serialize/internal",
FilePath: "internal.thrift",
SHA1: "c60c5759efeaa1545aebd396d371509bc561b153",
Raw: rawIDL,
}
ThriftModule represents the IDL file used to generate this package.
Functions ¶
This section is empty.
Types ¶
type RPC ¶
type RPC struct { SpanContext []byte `json:"spanContext,required"` CallerName string `json:"callerName,required"` ServiceName string `json:"serviceName,required"` Encoding string `json:"encoding,required"` Procedure string `json:"procedure,required"` Headers map[string]string `json:"headers,omitempty"` ShardKey *string `json:"shardKey,omitempty"` RoutingKey *string `json:"routingKey,omitempty"` RoutingDelegate *string `json:"routingDelegate,omitempty"` Body []byte `json:"body,omitempty"` }
func (*RPC) Decode ¶ added in v1.57.0
Decode deserializes a RPC struct directly from its Thrift-level representation, without going through an intemediary type.
An error is returned if a RPC struct could not be generated from the wire representation.
func (*RPC) Encode ¶ added in v1.57.0
Encode serializes a RPC struct directly into bytes, without going through an intermediary type.
An error is returned if a RPC struct could not be encoded.
func (*RPC) Equals ¶ added in v1.8.0
Equals returns true if all the fields of this RPC match the provided RPC.
This function performs a deep comparison.
func (*RPC) FromWire ¶
FromWire deserializes a RPC struct from its Thrift-level representation. The Thrift-level representation may be obtained from a ThriftRW protocol implementation.
An error is returned if we were unable to build a RPC struct from the provided intermediate representation.
x, err := binaryProtocol.Decode(reader, wire.TStruct) if err != nil { return nil, err } var v RPC if err := v.FromWire(x); err != nil { return nil, err } return &v, nil
func (*RPC) GetBody ¶ added in v1.31.0
GetBody returns the value of Body if it is set or its zero value if it is unset.
func (*RPC) GetCallerName ¶ added in v1.31.0
GetCallerName returns the value of CallerName if it is set or its zero value if it is unset.
func (*RPC) GetEncoding ¶ added in v1.31.0
GetEncoding returns the value of Encoding if it is set or its zero value if it is unset.
func (*RPC) GetHeaders ¶ added in v1.31.0
GetHeaders returns the value of Headers if it is set or its zero value if it is unset.
func (*RPC) GetProcedure ¶ added in v1.31.0
GetProcedure returns the value of Procedure if it is set or its zero value if it is unset.
func (*RPC) GetRoutingDelegate ¶ added in v1.14.0
GetRoutingDelegate returns the value of RoutingDelegate if it is set or its zero value if it is unset.
func (*RPC) GetRoutingKey ¶ added in v1.14.0
GetRoutingKey returns the value of RoutingKey if it is set or its zero value if it is unset.
func (*RPC) GetServiceName ¶ added in v1.31.0
GetServiceName returns the value of ServiceName if it is set or its zero value if it is unset.
func (*RPC) GetShardKey ¶ added in v1.14.0
GetShardKey returns the value of ShardKey if it is set or its zero value if it is unset.
func (*RPC) GetSpanContext ¶ added in v1.31.0
GetSpanContext returns the value of SpanContext if it is set or its zero value if it is unset.
func (*RPC) IsSetHeaders ¶ added in v1.35.2
IsSetHeaders returns true if Headers is not nil.
func (*RPC) IsSetRoutingDelegate ¶ added in v1.35.2
IsSetRoutingDelegate returns true if RoutingDelegate is not nil.
func (*RPC) IsSetRoutingKey ¶ added in v1.35.2
IsSetRoutingKey returns true if RoutingKey is not nil.
func (*RPC) IsSetShardKey ¶ added in v1.35.2
IsSetShardKey returns true if ShardKey is not nil.
func (*RPC) IsSetSpanContext ¶ added in v1.35.2
IsSetSpanContext returns true if SpanContext is not nil.
func (*RPC) MarshalLogObject ¶ added in v1.33.0
func (v *RPC) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
MarshalLogObject implements zapcore.ObjectMarshaler, enabling fast logging of RPC.
func (*RPC) ToWire ¶
ToWire translates a RPC struct into a Thrift-level intermediate representation. This intermediate representation may be serialized into bytes using a ThriftRW protocol implementation.
An error is returned if the struct or any of its fields failed to validate.
x, err := v.ToWire() if err != nil { return err } if err := binaryProtocol.Encode(x, writer); err != nil { return err }