base

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Body string `json:"body,required"`
}

func (*Message) Equals

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

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

This function performs a deep comparison.

func (*Message) FromWire

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

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

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

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

func (*Message) GetBody added in v0.1.1

func (v *Message) GetBody() (o string)

GetBody returns the value of Body if it is set or its zero value if it is unset.

func (*Message) MarshalLogObject added in v0.2.0

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

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

func (*Message) String

func (v *Message) String() string

String returns a readable string representation of a Message struct.

func (*Message) ToWire

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

ToWire translates a Message 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