Documentation ¶
Index ¶
- Variables
- type First
- func (v *First) Decode(sr stream.Reader) error
- func (v *First) Encode(sw stream.Writer) error
- func (v *First) Equals(rhs *First) bool
- func (v *First) FromWire(w wire.Value) error
- func (v *First) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
- func (v *First) String() string
- func (v *First) ToWire() (wire.Value, error)
- type Second
- func (v *Second) Decode(sr stream.Reader) error
- func (v *Second) Encode(sw stream.Writer) error
- func (v *Second) Equals(rhs *Second) bool
- func (v *Second) FromWire(w wire.Value) error
- func (v *Second) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
- func (v *Second) String() string
- func (v *Second) ToWire() (wire.Value, error)
Constants ¶
This section is empty.
Variables ¶
var ThriftModule = &thriftreflect.ThriftModule{
Name: "non_hyphenated",
Package: "go.uber.org/thriftrw/gen/internal/tests/non_hyphenated",
FilePath: "non_hyphenated.thrift",
SHA1: "5cbe76400805b1c5a248631c4ad87e3dfe6f183e",
Raw: rawIDL,
}
ThriftModule represents the IDL file used to generate this package.
Functions ¶
This section is empty.
Types ¶
type First ¶
type First struct { }
func (*First) Decode ¶ added in v1.29.0
Decode deserializes a First struct directly from its Thrift-level representation, without going through an intemediary type.
An error is returned if a First struct could not be generated from the wire representation.
func (*First) Encode ¶ added in v1.29.0
Encode serializes a First struct directly into bytes, without going through an intermediary type.
An error is returned if a First struct could not be encoded.
func (*First) Equals ¶
Equals returns true if all the fields of this First match the provided First.
This function performs a deep comparison.
func (*First) FromWire ¶
FromWire deserializes a First 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 First struct from the provided intermediate representation.
x, err := binaryProtocol.Decode(reader, wire.TStruct) if err != nil { return nil, err } var v First if err := v.FromWire(x); err != nil { return nil, err } return &v, nil
func (*First) MarshalLogObject ¶
func (v *First) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
MarshalLogObject implements zapcore.ObjectMarshaler, enabling fast logging of First.
func (*First) ToWire ¶
ToWire translates a First 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 Second ¶
type Second struct { }
func (*Second) Decode ¶ added in v1.29.0
Decode deserializes a Second struct directly from its Thrift-level representation, without going through an intemediary type.
An error is returned if a Second struct could not be generated from the wire representation.
func (*Second) Encode ¶ added in v1.29.0
Encode serializes a Second struct directly into bytes, without going through an intermediary type.
An error is returned if a Second struct could not be encoded.
func (*Second) Equals ¶
Equals returns true if all the fields of this Second match the provided Second.
This function performs a deep comparison.
func (*Second) FromWire ¶
FromWire deserializes a Second 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 Second struct from the provided intermediate representation.
x, err := binaryProtocol.Decode(reader, wire.TStruct) if err != nil { return nil, err } var v Second if err := v.FromWire(x); err != nil { return nil, err } return &v, nil
func (*Second) MarshalLogObject ¶
func (v *Second) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
MarshalLogObject implements zapcore.ObjectMarshaler, enabling fast logging of Second.
func (*Second) ToWire ¶
ToWire translates a Second 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 }