Documentation ¶
Index ¶
- Variables
- type Echo_Echo_Args
- func (v *Echo_Echo_Args) EnvelopeType() wire.EnvelopeType
- func (v *Echo_Echo_Args) Equals(rhs *Echo_Echo_Args) bool
- func (v *Echo_Echo_Args) FromWire(w wire.Value) error
- func (v *Echo_Echo_Args) GetPing() (o *Ping)
- func (v *Echo_Echo_Args) MethodName() string
- func (v *Echo_Echo_Args) String() string
- func (v *Echo_Echo_Args) ToWire() (wire.Value, error)
- type Echo_Echo_Result
- func (v *Echo_Echo_Result) EnvelopeType() wire.EnvelopeType
- func (v *Echo_Echo_Result) Equals(rhs *Echo_Echo_Result) bool
- func (v *Echo_Echo_Result) FromWire(w wire.Value) error
- func (v *Echo_Echo_Result) GetSuccess() (o *Pong)
- func (v *Echo_Echo_Result) MethodName() string
- func (v *Echo_Echo_Result) String() string
- func (v *Echo_Echo_Result) ToWire() (wire.Value, error)
- type Ping
- type Pong
Constants ¶
This section is empty.
Variables ¶
var Echo_Echo_Helper = struct { // Args accepts the parameters of echo in-order and returns // the arguments struct for the function. Args func( ping *Ping, ) *Echo_Echo_Args // IsException returns true if the given error can be thrown // by echo. // // An error can be thrown by echo only if the // corresponding exception type was mentioned in the 'throws' // section for it in the Thrift file. IsException func(error) bool // WrapResponse returns the result struct for echo // given its return value and error. // // This allows mapping values and errors returned by // echo into a serializable result struct. // WrapResponse returns a non-nil error if the provided // error cannot be thrown by echo // // value, err := echo(args) // result, err := Echo_Echo_Helper.WrapResponse(value, err) // if err != nil { // return fmt.Errorf("unexpected error from echo: %v", err) // } // serialize(result) WrapResponse func(*Pong, error) (*Echo_Echo_Result, error) // UnwrapResponse takes the result struct for echo // and returns the value or error returned by it. // // The error is non-nil only if echo threw an // exception. // // result := deserialize(bytes) // value, err := Echo_Echo_Helper.UnwrapResponse(result) UnwrapResponse func(*Echo_Echo_Result) (*Pong, error) }{}
Echo_Echo_Helper provides functions that aid in handling the parameters and return values of the Echo.echo function.
var ThriftModule = &thriftreflect.ThriftModule{
Name: "echo",
Package: "go.uber.org/yarpc/internal/crossdock/thrift/echo",
FilePath: "echo.thrift",
SHA1: "c3e4e93d3bee132394d26e5ec61011e3f76b7f33",
Raw: rawIDL,
}
ThriftModule represents the IDL file used to generate this package.
Functions ¶
This section is empty.
Types ¶
type Echo_Echo_Args ¶
type Echo_Echo_Args struct {
Ping *Ping `json:"ping,omitempty"`
}
Echo_Echo_Args represents the arguments for the Echo.echo function.
The arguments for echo are sent and received over the wire as this struct.
func (*Echo_Echo_Args) EnvelopeType ¶
func (v *Echo_Echo_Args) EnvelopeType() wire.EnvelopeType
EnvelopeType returns the kind of value inside this struct.
This will always be Call for this struct.
func (*Echo_Echo_Args) Equals ¶ added in v1.8.0
func (v *Echo_Echo_Args) Equals(rhs *Echo_Echo_Args) bool
Equals returns true if all the fields of this Echo_Echo_Args match the provided Echo_Echo_Args.
This function performs a deep comparison.
func (*Echo_Echo_Args) FromWire ¶
func (v *Echo_Echo_Args) FromWire(w wire.Value) error
FromWire deserializes a Echo_Echo_Args 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 Echo_Echo_Args struct from the provided intermediate representation.
x, err := binaryProtocol.Decode(reader, wire.TStruct) if err != nil { return nil, err } var v Echo_Echo_Args if err := v.FromWire(x); err != nil { return nil, err } return &v, nil
func (*Echo_Echo_Args) GetPing ¶ added in v1.31.0
func (v *Echo_Echo_Args) GetPing() (o *Ping)
GetPing returns the value of Ping if it is set or its zero value if it is unset.
func (*Echo_Echo_Args) MethodName ¶
func (v *Echo_Echo_Args) MethodName() string
MethodName returns the name of the Thrift function as specified in the IDL, for which this struct represent the arguments.
This will always be "echo" for this struct.
func (*Echo_Echo_Args) String ¶
func (v *Echo_Echo_Args) String() string
String returns a readable string representation of a Echo_Echo_Args struct.
func (*Echo_Echo_Args) ToWire ¶
func (v *Echo_Echo_Args) ToWire() (wire.Value, error)
ToWire translates a Echo_Echo_Args 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 }
type Echo_Echo_Result ¶
type Echo_Echo_Result struct { // Value returned by echo after a successful execution. Success *Pong `json:"success,omitempty"` }
Echo_Echo_Result represents the result of a Echo.echo function call.
The result of a echo execution is sent and received over the wire as this struct.
Success is set only if the function did not throw an exception.
func (*Echo_Echo_Result) EnvelopeType ¶
func (v *Echo_Echo_Result) EnvelopeType() wire.EnvelopeType
EnvelopeType returns the kind of value inside this struct.
This will always be Reply for this struct.
func (*Echo_Echo_Result) Equals ¶ added in v1.8.0
func (v *Echo_Echo_Result) Equals(rhs *Echo_Echo_Result) bool
Equals returns true if all the fields of this Echo_Echo_Result match the provided Echo_Echo_Result.
This function performs a deep comparison.
func (*Echo_Echo_Result) FromWire ¶
func (v *Echo_Echo_Result) FromWire(w wire.Value) error
FromWire deserializes a Echo_Echo_Result 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 Echo_Echo_Result struct from the provided intermediate representation.
x, err := binaryProtocol.Decode(reader, wire.TStruct) if err != nil { return nil, err } var v Echo_Echo_Result if err := v.FromWire(x); err != nil { return nil, err } return &v, nil
func (*Echo_Echo_Result) GetSuccess ¶ added in v1.31.0
func (v *Echo_Echo_Result) GetSuccess() (o *Pong)
GetSuccess returns the value of Success if it is set or its zero value if it is unset.
func (*Echo_Echo_Result) MethodName ¶
func (v *Echo_Echo_Result) MethodName() string
MethodName returns the name of the Thrift function as specified in the IDL, for which this struct represent the result.
This will always be "echo" for this struct.
func (*Echo_Echo_Result) String ¶
func (v *Echo_Echo_Result) String() string
String returns a readable string representation of a Echo_Echo_Result struct.
func (*Echo_Echo_Result) ToWire ¶
func (v *Echo_Echo_Result) ToWire() (wire.Value, error)
ToWire translates a Echo_Echo_Result 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 }
type Ping ¶
type Ping struct {
Beep string `json:"beep,required"`
}
func (*Ping) Equals ¶ added in v1.8.0
Equals returns true if all the fields of this Ping match the provided Ping.
This function performs a deep comparison.
func (*Ping) FromWire ¶
FromWire deserializes a Ping 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 Ping struct from the provided intermediate representation.
x, err := binaryProtocol.Decode(reader, wire.TStruct) if err != nil { return nil, err } var v Ping if err := v.FromWire(x); err != nil { return nil, err } return &v, nil
func (*Ping) GetBeep ¶ added in v1.31.0
GetBeep returns the value of Beep if it is set or its zero value if it is unset.
func (*Ping) ToWire ¶
ToWire translates a Ping 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 }
type Pong ¶
type Pong struct {
Boop string `json:"boop,required"`
}
func (*Pong) Equals ¶ added in v1.8.0
Equals returns true if all the fields of this Pong match the provided Pong.
This function performs a deep comparison.
func (*Pong) FromWire ¶
FromWire deserializes a Pong 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 Pong struct from the provided intermediate representation.
x, err := binaryProtocol.Decode(reader, wire.TStruct) if err != nil { return nil, err } var v Pong if err := v.FromWire(x); err != nil { return nil, err } return &v, nil
func (*Pong) GetBoop ¶ added in v1.31.0
GetBoop returns the value of Boop if it is set or its zero value if it is unset.
func (*Pong) ToWire ¶
ToWire translates a Pong 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 }
Directories ¶
Path | Synopsis |
---|---|
Package echofx provides better integration for Fx for services implementing or calling Echo.
|
Package echofx provides better integration for Fx for services implementing or calling Echo. |