echo

package
v0.0.0-...-23c069f Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 8 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) Decode

func (v *Echo_Echo_Args) Decode(sr stream.Reader) error

Decode deserializes a Echo_Echo_Args struct directly from its Thrift-level representation, without going through an intemediary type.

An error is returned if a Echo_Echo_Args struct could not be generated from the wire representation.

func (*Echo_Echo_Args) Encode

func (v *Echo_Echo_Args) Encode(sw stream.Writer) error

Encode serializes a Echo_Echo_Args struct directly into bytes, without going through an intermediary type.

An error is returned if a Echo_Echo_Args struct could not be encoded.

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

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

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

func (v *Echo_Echo_Args) IsSetPing() bool

IsSetPing returns true if Ping is not nil.

func (*Echo_Echo_Args) MarshalLogObject

func (v *Echo_Echo_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)

MarshalLogObject implements zapcore.ObjectMarshaler, enabling fast logging of Echo_Echo_Args.

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

func (v *Echo_Echo_Result) Decode(sr stream.Reader) error

Decode deserializes a Echo_Echo_Result struct directly from its Thrift-level representation, without going through an intemediary type.

An error is returned if a Echo_Echo_Result struct could not be generated from the wire representation.

func (*Echo_Echo_Result) Encode

func (v *Echo_Echo_Result) Encode(sw stream.Writer) error

Encode serializes a Echo_Echo_Result struct directly into bytes, without going through an intermediary type.

An error is returned if a Echo_Echo_Result struct could not be encoded.

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

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

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

func (v *Echo_Echo_Result) IsSetSuccess() bool

IsSetSuccess returns true if Success is not nil.

func (*Echo_Echo_Result) MarshalLogObject

func (v *Echo_Echo_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)

MarshalLogObject implements zapcore.ObjectMarshaler, enabling fast logging of Echo_Echo_Result.

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

func (v *Ping) Decode(sr stream.Reader) error

Decode deserializes a Ping struct directly from its Thrift-level representation, without going through an intemediary type.

An error is returned if a Ping struct could not be generated from the wire representation.

func (*Ping) Encode

func (v *Ping) Encode(sw stream.Writer) error

Encode serializes a Ping struct directly into bytes, without going through an intermediary type.

An error is returned if a Ping struct could not be encoded.

func (*Ping) Equals

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

func (v *Ping) GetBeep() (o string)

GetBeep returns the value of Beep if it is set or its zero value if it is unset.

func (*Ping) MarshalLogObject

func (v *Ping) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)

MarshalLogObject implements zapcore.ObjectMarshaler, enabling fast logging of Ping.

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

func (v *Pong) Decode(sr stream.Reader) error

Decode deserializes a Pong struct directly from its Thrift-level representation, without going through an intemediary type.

An error is returned if a Pong struct could not be generated from the wire representation.

func (*Pong) Encode

func (v *Pong) Encode(sw stream.Writer) error

Encode serializes a Pong struct directly into bytes, without going through an intermediary type.

An error is returned if a Pong struct could not be encoded.

func (*Pong) Equals

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

func (v *Pong) GetBoop() (o string)

GetBoop returns the value of Boop if it is set or its zero value if it is unset.

func (*Pong) MarshalLogObject

func (v *Pong) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)

MarshalLogObject implements zapcore.ObjectMarshaler, enabling fast logging of Pong.

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