base

package
v2.0.0-RC7 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: MIT Imports: 10 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) Decode

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

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

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

func (*Message) Encode

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

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

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

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

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

func (v Message) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Message) MarshalJSON

func (v Message) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Message) MarshalLogObject

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
}

func (*Message) UnmarshalEasyJSON

func (v *Message) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Message) UnmarshalJSON

func (v *Message) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

Jump to

Keyboard shortcuts

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