echo

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 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(
		msg string,
	) *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(string, 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) (string, error)
}{}

Echo_Echo_Helper provides functions that aid in handling the parameters and return values of the Echo.echo function.

Functions

This section is empty.

Types

type Echo_Echo_Args

type Echo_Echo_Args struct {
	Msg string `json:"msg,required"`
}

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

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

func (v *Echo_Echo_Args) GetMsg() (o string)

GetMsg returns the value of Msg if it is set or its zero value if it is unset.

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 *string `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

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

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
}

Jump to

Keyboard shortcuts

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