Documentation ¶
Index ¶
- Variables
- type EnumDefault
- func (v *EnumDefault) Decode(sr stream.Reader) error
- func (v EnumDefault) Encode(sw stream.Writer) error
- func (v EnumDefault) Equals(rhs EnumDefault) bool
- func (v *EnumDefault) FromWire(w wire.Value) error
- func (v EnumDefault) MarshalJSON() ([]byte, error)
- func (v EnumDefault) MarshalText() ([]byte, error)
- func (v EnumDefault) Ptr() *EnumDefault
- func (v EnumDefault) String() string
- func (v EnumDefault) ToWire() (wire.Value, error)
- func (v *EnumDefault) UnmarshalJSON(text []byte) error
- func (v *EnumDefault) UnmarshalText(value []byte) error
- type PrimitiveRequiredStruct
- func (v *PrimitiveRequiredStruct) Decode(sr stream.Reader) error
- func (v *PrimitiveRequiredStruct) Encode(sw stream.Writer) error
- func (v *PrimitiveRequiredStruct) Equals(rhs *PrimitiveRequiredStruct) bool
- func (v *PrimitiveRequiredStruct) FromWire(w wire.Value) error
- func (v *PrimitiveRequiredStruct) GetBinaryField() (o []byte)
- func (v *PrimitiveRequiredStruct) GetBoolField() (o bool)
- func (v *PrimitiveRequiredStruct) GetByteField() (o int8)
- func (v *PrimitiveRequiredStruct) GetDoubleField() (o float64)
- func (v *PrimitiveRequiredStruct) GetInt16Field() (o int16)
- func (v *PrimitiveRequiredStruct) GetInt32Field() (o int32)
- func (v *PrimitiveRequiredStruct) GetInt64Field() (o int64)
- func (v *PrimitiveRequiredStruct) GetListOfStrings() (o []string)
- func (v *PrimitiveRequiredStruct) GetMapOfIntsToDoubles() (o map[int64]float64)
- func (v *PrimitiveRequiredStruct) GetSetOfInts() (o map[int32]struct{})
- func (v *PrimitiveRequiredStruct) GetStringField() (o string)
- func (v *PrimitiveRequiredStruct) IsSetBinaryField() bool
- func (v *PrimitiveRequiredStruct) IsSetListOfStrings() bool
- func (v *PrimitiveRequiredStruct) IsSetMapOfIntsToDoubles() bool
- func (v *PrimitiveRequiredStruct) IsSetSetOfInts() bool
- func (v *PrimitiveRequiredStruct) String() string
- func (v *PrimitiveRequiredStruct) ToWire() (wire.Value, error)
- type Primitives
- type StringList
- type StringMap
Constants ¶
This section is empty.
Variables ¶
var ThriftModule = &thriftreflect.ThriftModule{
Name: "nozap",
Package: "go.uber.org/thriftrw/gen/internal/tests/nozap",
FilePath: "nozap.thrift",
SHA1: "05f7228060eeb97fbd181a7a2660a6483799ac78",
Raw: rawIDL,
}
ThriftModule represents the IDL file used to generate this package.
Functions ¶
This section is empty.
Types ¶
type EnumDefault ¶
type EnumDefault int32
const ( EnumDefaultFoo EnumDefault = 0 EnumDefaultBar EnumDefault = 1 EnumDefaultBaz EnumDefault = 2 )
func EnumDefault_Values ¶
func EnumDefault_Values() []EnumDefault
EnumDefault_Values returns all recognized values of EnumDefault.
func (*EnumDefault) Decode ¶ added in v1.29.0
func (v *EnumDefault) Decode(sr stream.Reader) error
Decode reads off the encoded EnumDefault directly off of the wire.
sReader := BinaryStreamer.Reader(reader) var v EnumDefault if err := v.Decode(sReader); err != nil { return EnumDefault(0), err } return v, nil
func (EnumDefault) Encode ¶ added in v1.29.0
func (v EnumDefault) Encode(sw stream.Writer) error
Encode encodes EnumDefault directly to bytes.
sWriter := BinaryStreamer.Writer(writer) var v EnumDefault return v.Encode(sWriter)
func (EnumDefault) Equals ¶
func (v EnumDefault) Equals(rhs EnumDefault) bool
Equals returns true if this EnumDefault value matches the provided value.
func (*EnumDefault) FromWire ¶
func (v *EnumDefault) FromWire(w wire.Value) error
FromWire deserializes EnumDefault from its Thrift-level representation.
x, err := binaryProtocol.Decode(reader, wire.TI32) if err != nil { return EnumDefault(0), err } var v EnumDefault if err := v.FromWire(x); err != nil { return EnumDefault(0), err } return v, nil
func (EnumDefault) MarshalJSON ¶
func (v EnumDefault) MarshalJSON() ([]byte, error)
MarshalJSON serializes EnumDefault into JSON.
If the enum value is recognized, its name is returned. Otherwise, its integer value is returned.
This implements json.Marshaler.
func (EnumDefault) MarshalText ¶
func (v EnumDefault) MarshalText() ([]byte, error)
MarshalText encodes EnumDefault to text.
If the enum value is recognized, its name is returned. Otherwise, its integer value is returned.
This implements the TextMarshaler interface.
func (EnumDefault) Ptr ¶
func (v EnumDefault) Ptr() *EnumDefault
Ptr returns a pointer to this enum value.
func (EnumDefault) String ¶
func (v EnumDefault) String() string
String returns a readable string representation of EnumDefault.
func (EnumDefault) ToWire ¶
func (v EnumDefault) ToWire() (wire.Value, error)
ToWire translates EnumDefault into a Thrift-level intermediate representation. This intermediate representation may be serialized into bytes using a ThriftRW protocol implementation.
Enums are represented as 32-bit integers over the wire.
func (*EnumDefault) UnmarshalJSON ¶
func (v *EnumDefault) UnmarshalJSON(text []byte) error
UnmarshalJSON attempts to decode EnumDefault from its JSON representation.
This implementation supports both, numeric and string inputs. If a string is provided, it must be a known enum name.
This implements json.Unmarshaler.
func (*EnumDefault) UnmarshalText ¶
func (v *EnumDefault) UnmarshalText(value []byte) error
UnmarshalText tries to decode EnumDefault from a byte slice containing its name.
var v EnumDefault err := v.UnmarshalText([]byte("Foo"))
type PrimitiveRequiredStruct ¶
type PrimitiveRequiredStruct struct { BoolField bool `json:"boolField,required"` ByteField int8 `json:"byteField,required"` Int16Field int16 `json:"int16Field,required"` Int32Field int32 `json:"int32Field,required"` Int64Field int64 `json:"int64Field,required"` DoubleField float64 `json:"doubleField,required"` StringField string `json:"stringField,required"` BinaryField []byte `json:"binaryField,required"` ListOfStrings []string `json:"listOfStrings,required"` SetOfInts map[int32]struct{} `json:"setOfInts,required"` MapOfIntsToDoubles map[int64]float64 `json:"mapOfIntsToDoubles,required"` }
func (*PrimitiveRequiredStruct) Decode ¶ added in v1.29.0
func (v *PrimitiveRequiredStruct) Decode(sr stream.Reader) error
Decode deserializes a PrimitiveRequiredStruct struct directly from its Thrift-level representation, without going through an intemediary type.
An error is returned if a PrimitiveRequiredStruct struct could not be generated from the wire representation.
func (*PrimitiveRequiredStruct) Encode ¶ added in v1.29.0
func (v *PrimitiveRequiredStruct) Encode(sw stream.Writer) error
Encode serializes a PrimitiveRequiredStruct struct directly into bytes, without going through an intermediary type.
An error is returned if a PrimitiveRequiredStruct struct could not be encoded.
func (*PrimitiveRequiredStruct) Equals ¶
func (v *PrimitiveRequiredStruct) Equals(rhs *PrimitiveRequiredStruct) bool
Equals returns true if all the fields of this PrimitiveRequiredStruct match the provided PrimitiveRequiredStruct.
This function performs a deep comparison.
func (*PrimitiveRequiredStruct) FromWire ¶
func (v *PrimitiveRequiredStruct) FromWire(w wire.Value) error
FromWire deserializes a PrimitiveRequiredStruct 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 PrimitiveRequiredStruct struct from the provided intermediate representation.
x, err := binaryProtocol.Decode(reader, wire.TStruct) if err != nil { return nil, err } var v PrimitiveRequiredStruct if err := v.FromWire(x); err != nil { return nil, err } return &v, nil
func (*PrimitiveRequiredStruct) GetBinaryField ¶
func (v *PrimitiveRequiredStruct) GetBinaryField() (o []byte)
GetBinaryField returns the value of BinaryField if it is set or its zero value if it is unset.
func (*PrimitiveRequiredStruct) GetBoolField ¶
func (v *PrimitiveRequiredStruct) GetBoolField() (o bool)
GetBoolField returns the value of BoolField if it is set or its zero value if it is unset.
func (*PrimitiveRequiredStruct) GetByteField ¶
func (v *PrimitiveRequiredStruct) GetByteField() (o int8)
GetByteField returns the value of ByteField if it is set or its zero value if it is unset.
func (*PrimitiveRequiredStruct) GetDoubleField ¶
func (v *PrimitiveRequiredStruct) GetDoubleField() (o float64)
GetDoubleField returns the value of DoubleField if it is set or its zero value if it is unset.
func (*PrimitiveRequiredStruct) GetInt16Field ¶
func (v *PrimitiveRequiredStruct) GetInt16Field() (o int16)
GetInt16Field returns the value of Int16Field if it is set or its zero value if it is unset.
func (*PrimitiveRequiredStruct) GetInt32Field ¶
func (v *PrimitiveRequiredStruct) GetInt32Field() (o int32)
GetInt32Field returns the value of Int32Field if it is set or its zero value if it is unset.
func (*PrimitiveRequiredStruct) GetInt64Field ¶
func (v *PrimitiveRequiredStruct) GetInt64Field() (o int64)
GetInt64Field returns the value of Int64Field if it is set or its zero value if it is unset.
func (*PrimitiveRequiredStruct) GetListOfStrings ¶
func (v *PrimitiveRequiredStruct) GetListOfStrings() (o []string)
GetListOfStrings returns the value of ListOfStrings if it is set or its zero value if it is unset.
func (*PrimitiveRequiredStruct) GetMapOfIntsToDoubles ¶
func (v *PrimitiveRequiredStruct) GetMapOfIntsToDoubles() (o map[int64]float64)
GetMapOfIntsToDoubles returns the value of MapOfIntsToDoubles if it is set or its zero value if it is unset.
func (*PrimitiveRequiredStruct) GetSetOfInts ¶
func (v *PrimitiveRequiredStruct) GetSetOfInts() (o map[int32]struct{})
GetSetOfInts returns the value of SetOfInts if it is set or its zero value if it is unset.
func (*PrimitiveRequiredStruct) GetStringField ¶
func (v *PrimitiveRequiredStruct) GetStringField() (o string)
GetStringField returns the value of StringField if it is set or its zero value if it is unset.
func (*PrimitiveRequiredStruct) IsSetBinaryField ¶ added in v1.14.0
func (v *PrimitiveRequiredStruct) IsSetBinaryField() bool
IsSetBinaryField returns true if BinaryField is not nil.
func (*PrimitiveRequiredStruct) IsSetListOfStrings ¶ added in v1.14.0
func (v *PrimitiveRequiredStruct) IsSetListOfStrings() bool
IsSetListOfStrings returns true if ListOfStrings is not nil.
func (*PrimitiveRequiredStruct) IsSetMapOfIntsToDoubles ¶ added in v1.14.0
func (v *PrimitiveRequiredStruct) IsSetMapOfIntsToDoubles() bool
IsSetMapOfIntsToDoubles returns true if MapOfIntsToDoubles is not nil.
func (*PrimitiveRequiredStruct) IsSetSetOfInts ¶ added in v1.14.0
func (v *PrimitiveRequiredStruct) IsSetSetOfInts() bool
IsSetSetOfInts returns true if SetOfInts is not nil.
func (*PrimitiveRequiredStruct) String ¶
func (v *PrimitiveRequiredStruct) String() string
String returns a readable string representation of a PrimitiveRequiredStruct struct.
func (*PrimitiveRequiredStruct) ToWire ¶
func (v *PrimitiveRequiredStruct) ToWire() (wire.Value, error)
ToWire translates a PrimitiveRequiredStruct 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 Primitives ¶
type Primitives PrimitiveRequiredStruct
func (*Primitives) Decode ¶ added in v1.29.0
func (v *Primitives) Decode(sr stream.Reader) error
Decode deserializes Primitives directly off the wire.
func (*Primitives) Equals ¶
func (lhs *Primitives) Equals(rhs *Primitives) bool
Equals returns true if this Primitives is equal to the provided Primitives.
func (*Primitives) FromWire ¶
func (v *Primitives) FromWire(w wire.Value) error
FromWire deserializes Primitives from its Thrift-level representation. The Thrift-level representation may be obtained from a ThriftRW protocol implementation.
func (*Primitives) String ¶
func (v *Primitives) String() string
String returns a readable string representation of Primitives.
type StringList ¶
type StringList []string
func (*StringList) Decode ¶ added in v1.29.0
func (v *StringList) Decode(sr stream.Reader) error
Decode deserializes StringList directly off the wire.
func (StringList) Equals ¶
func (lhs StringList) Equals(rhs StringList) bool
Equals returns true if this StringList is equal to the provided StringList.
func (*StringList) FromWire ¶
func (v *StringList) FromWire(w wire.Value) error
FromWire deserializes StringList from its Thrift-level representation. The Thrift-level representation may be obtained from a ThriftRW protocol implementation.
func (StringList) String ¶
func (v StringList) String() string
String returns a readable string representation of StringList.
type StringMap ¶
func (*StringMap) FromWire ¶
FromWire deserializes StringMap from its Thrift-level representation. The Thrift-level representation may be obtained from a ThriftRW protocol implementation.