echo

package
v1.28.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
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) 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) 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

func (v *Ping) Equals(rhs *Ping) bool

Equals returns true if all the fields of this Ping match the provided Ping.

This function performs a deep comparison.

func (*Ping) FromWire

func (v *Ping) FromWire(w wire.Value) error

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) String

func (v *Ping) String() string

String returns a readable string representation of a Ping struct.

func (*Ping) ToWire

func (v *Ping) ToWire() (wire.Value, error)

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

func (v *Pong) Equals(rhs *Pong) bool

Equals returns true if all the fields of this Pong match the provided Pong.

This function performs a deep comparison.

func (*Pong) FromWire

func (v *Pong) FromWire(w wire.Value) error

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) String

func (v *Pong) String() string

String returns a readable string representation of a Pong struct.

func (*Pong) ToWire

func (v *Pong) ToWire() (wire.Value, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL