echo

package
v0.0.0-...-7376487 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 6 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(
		req *EchoReq,
	) *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(*EchoRes, 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) (*EchoRes, 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 EchoReq

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

func (*EchoReq) Equals

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

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

This function performs a deep comparison.

func (*EchoReq) FromWire

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

FromWire deserializes a EchoReq 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 EchoReq struct from the provided intermediate representation.

x, err := binaryProtocol.Decode(reader, wire.TStruct)
if err != nil {
  return nil, err
}

var v EchoReq
if err := v.FromWire(x); err != nil {
  return nil, err
}
return &v, nil

func (*EchoReq) GetMsg

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

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

func (*EchoReq) MarshalLogObject

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

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

func (*EchoReq) String

func (v *EchoReq) String() string

String returns a readable string representation of a EchoReq struct.

func (*EchoReq) ToWire

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

ToWire translates a EchoReq 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 EchoRes

type EchoRes struct {
	Msg *string `json:"msg,omitempty"`
}

func (*EchoRes) Equals

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

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

This function performs a deep comparison.

func (*EchoRes) FromWire

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

FromWire deserializes a EchoRes 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 EchoRes struct from the provided intermediate representation.

x, err := binaryProtocol.Decode(reader, wire.TStruct)
if err != nil {
  return nil, err
}

var v EchoRes
if err := v.FromWire(x); err != nil {
  return nil, err
}
return &v, nil

func (*EchoRes) GetMsg

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

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

func (*EchoRes) IsSetMsg

func (v *EchoRes) IsSetMsg() bool

IsSetMsg returns true if Msg is not nil.

func (*EchoRes) MarshalLogObject

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

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

func (*EchoRes) String

func (v *EchoRes) String() string

String returns a readable string representation of a EchoRes struct.

func (*EchoRes) ToWire

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

ToWire translates a EchoRes 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_Args

type Echo_Echo_Args struct {
	Req *EchoReq `json:"req,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

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

func (v *Echo_Echo_Args) GetReq() (o *EchoReq)

GetReq returns the value of Req if it is set or its zero value if it is unset.

func (*Echo_Echo_Args) IsSetReq

func (v *Echo_Echo_Args) IsSetReq() bool

IsSetReq returns true if Req 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 *EchoRes `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 *EchoRes)

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