thriftrw: go.uber.org/thriftrw/gen/internal/tests/nozap Index | Files

package nozap

import "go.uber.org/thriftrw/gen/internal/tests/nozap"

Index

Package Files

nozap.go

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.

type EnumDefault Uses

type EnumDefault int32
const (
    EnumDefaultFoo EnumDefault = 0
    EnumDefaultBar EnumDefault = 1
    EnumDefaultBaz EnumDefault = 2
)

func EnumDefault_Values Uses

func EnumDefault_Values() []EnumDefault

EnumDefault_Values returns all recognized values of EnumDefault.

func (EnumDefault) Equals Uses

func (v EnumDefault) Equals(rhs EnumDefault) bool

Equals returns true if this EnumDefault value matches the provided value.

func (*EnumDefault) FromWire Uses

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 Uses

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 Uses

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 Uses

func (v EnumDefault) Ptr() *EnumDefault

Ptr returns a pointer to this enum value.

func (EnumDefault) String Uses

func (v EnumDefault) String() string

String returns a readable string representation of EnumDefault.

func (EnumDefault) ToWire Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

func (v *PrimitiveRequiredStruct) IsSetBinaryField() bool

IsSetBinaryField returns true if BinaryField is not nil.

func (*PrimitiveRequiredStruct) IsSetListOfStrings Uses

func (v *PrimitiveRequiredStruct) IsSetListOfStrings() bool

IsSetListOfStrings returns true if ListOfStrings is not nil.

func (*PrimitiveRequiredStruct) IsSetMapOfIntsToDoubles Uses

func (v *PrimitiveRequiredStruct) IsSetMapOfIntsToDoubles() bool

IsSetMapOfIntsToDoubles returns true if MapOfIntsToDoubles is not nil.

func (*PrimitiveRequiredStruct) IsSetSetOfInts Uses

func (v *PrimitiveRequiredStruct) IsSetSetOfInts() bool

IsSetSetOfInts returns true if SetOfInts is not nil.

func (*PrimitiveRequiredStruct) String Uses

func (v *PrimitiveRequiredStruct) String() string

String returns a readable string representation of a PrimitiveRequiredStruct struct.

func (*PrimitiveRequiredStruct) ToWire Uses

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 Uses

type Primitives PrimitiveRequiredStruct

func (*Primitives) Equals Uses

func (lhs *Primitives) Equals(rhs *Primitives) bool

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

func (*Primitives) FromWire Uses

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 Uses

func (v *Primitives) String() string

String returns a readable string representation of Primitives.

func (*Primitives) ToWire Uses

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 Uses

type StringList []string

func (StringList) Equals Uses

func (lhs StringList) Equals(rhs StringList) bool

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

func (*StringList) FromWire Uses

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 Uses

func (v StringList) String() string

String returns a readable string representation of StringList.

func (StringList) ToWire Uses

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 Uses

type StringMap map[string]string

func (StringMap) Equals Uses

func (lhs StringMap) Equals(rhs StringMap) bool

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

func (*StringMap) FromWire Uses

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 Uses

func (v StringMap) String() string

String returns a readable string representation of StringMap.

func (StringMap) ToWire Uses

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.

Package nozap imports 9 packages (graph). Updated 2020-04-01. Refresh now. Tools for package owners.