Documentation ¶
Index ¶
- type Message
- func (v *Message) Decode(sr stream.Reader) error
- func (v *Message) Encode(sw stream.Writer) error
- func (v *Message) Equals(rhs *Message) bool
- func (v *Message) FromWire(w wire.Value) error
- func (v *Message) GetBody() (o string)
- func (v Message) MarshalEasyJSON(w *jwriter.Writer)
- func (v Message) MarshalJSON() ([]byte, error)
- func (v *Message) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
- func (v *Message) String() string
- func (v *Message) ToWire() (wire.Value, error)
- func (v *Message) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *Message) UnmarshalJSON(data []byte) error
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 ¶
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 ¶
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 ¶
Equals returns true if all the fields of this Message match the provided Message.
This function performs a deep comparison.
func (*Message) FromWire ¶
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 ¶
GetBody returns the value of Body if it is set or its zero value if it is unset.
func (Message) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Message) MarshalJSON ¶
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) ToWire ¶
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 ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Message) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface