Documentation

Index

Constants

This section is empty.

Variables

View Source
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) 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) Equals

                          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

                                                  func (v *PrimitiveRequiredStruct) IsSetBinaryField() bool

                                                    IsSetBinaryField returns true if BinaryField is not nil.

                                                    func (*PrimitiveRequiredStruct) IsSetListOfStrings

                                                    func (v *PrimitiveRequiredStruct) IsSetListOfStrings() bool

                                                      IsSetListOfStrings returns true if ListOfStrings is not nil.

                                                      func (*PrimitiveRequiredStruct) IsSetMapOfIntsToDoubles

                                                      func (v *PrimitiveRequiredStruct) IsSetMapOfIntsToDoubles() bool

                                                        IsSetMapOfIntsToDoubles returns true if MapOfIntsToDoubles is not nil.

                                                        func (*PrimitiveRequiredStruct) IsSetSetOfInts

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

                                                                    func (*Primitives) ToWire

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

                                                                      ToWire translates Primitives into a Thrift-level intermediate representation. This intermediate representation may be serialized into bytes using a ThriftRW protocol implementation.

                                                                      type StringList

                                                                      type StringList []string

                                                                      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.

                                                                            func (StringList) ToWire

                                                                            func (v StringList) ToWire() (wire.Value, error)

                                                                              ToWire translates StringList into a Thrift-level intermediate representation. This intermediate representation may be serialized into bytes using a ThriftRW protocol implementation.

                                                                              type StringMap

                                                                              type StringMap map[string]string

                                                                              func (StringMap) Equals

                                                                              func (lhs StringMap) Equals(rhs StringMap) bool

                                                                                Equals returns true if this StringMap is equal to the provided StringMap.

                                                                                func (*StringMap) FromWire

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

                                                                                  FromWire deserializes StringMap from its Thrift-level representation. The Thrift-level representation may be obtained from a ThriftRW protocol implementation.

                                                                                  func (StringMap) String

                                                                                  func (v StringMap) String() string

                                                                                    String returns a readable string representation of StringMap.

                                                                                    func (StringMap) ToWire

                                                                                    func (v StringMap) ToWire() (wire.Value, error)

                                                                                      ToWire translates StringMap into a Thrift-level intermediate representation. This intermediate representation may be serialized into bytes using a ThriftRW protocol implementation.

                                                                                      Source Files