Documentation ¶
Index ¶
- Variables
- type AnotherStringList
- func (v *AnotherStringList) Decode(sr stream.Reader) error
- func (v AnotherStringList) Encode(sw stream.Writer) error
- func (lhs AnotherStringList) Equals(rhs AnotherStringList) bool
- func (v *AnotherStringList) FromWire(w wire.Value) error
- func (v AnotherStringList) MarshalLogArray(enc zapcore.ArrayEncoder) error
- func (v AnotherStringList) String() string
- func (v AnotherStringList) ToWire() (wire.Value, error)
- type Bar
- func (v *Bar) Decode(sr stream.Reader) error
- func (v *Bar) Encode(sw stream.Writer) error
- func (v *Bar) Equals(rhs *Bar) bool
- func (v *Bar) FromWire(w wire.Value) error
- func (v *Bar) GetOptionalFooListField() (o []*Foo)
- func (v *Bar) GetOptionalStringListField() (o []string)
- func (v *Bar) GetOptionalTypedefFooListField() (o FooList)
- func (v *Bar) GetOptionalTypedefStringListField() (o StringList)
- func (v *Bar) GetRequiredFooListField() (o []*Foo)
- func (v *Bar) GetRequiredInt32ListField() (o []int32)
- func (v *Bar) GetRequiredStringListListField() (o [][]string)
- func (v *Bar) GetRequiredTypedefFooListField() (o FooList)
- func (v *Bar) GetRequiredTypedefStringListField() (o StringList)
- func (v *Bar) GetRequiredTypedefStringListListField() (o StringListList)
- func (v *Bar) IsSetOptionalFooListField() bool
- func (v *Bar) IsSetOptionalStringListField() bool
- func (v *Bar) IsSetOptionalTypedefFooListField() bool
- func (v *Bar) IsSetOptionalTypedefStringListField() bool
- func (v *Bar) IsSetRequiredFooListField() bool
- func (v *Bar) IsSetRequiredInt32ListField() bool
- func (v *Bar) IsSetRequiredStringListListField() bool
- func (v *Bar) IsSetRequiredTypedefFooListField() bool
- func (v *Bar) IsSetRequiredTypedefStringListField() bool
- func (v *Bar) IsSetRequiredTypedefStringListListField() bool
- func (v *Bar) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
- func (v *Bar) String() string
- func (v *Bar) ToWire() (wire.Value, error)
- type Foo
- func (v *Foo) Decode(sr stream.Reader) error
- func (v *Foo) Encode(sw stream.Writer) error
- func (v *Foo) Equals(rhs *Foo) bool
- func (v *Foo) FromWire(w wire.Value) error
- func (v *Foo) GetStringField() (o string)
- func (v *Foo) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
- func (v *Foo) String() string
- func (v *Foo) ToWire() (wire.Value, error)
- type FooList
- func (v *FooList) Decode(sr stream.Reader) error
- func (v FooList) Encode(sw stream.Writer) error
- func (lhs FooList) Equals(rhs FooList) bool
- func (v *FooList) FromWire(w wire.Value) error
- func (v FooList) MarshalLogArray(enc zapcore.ArrayEncoder) error
- func (v FooList) String() string
- func (v FooList) ToWire() (wire.Value, error)
- type MyStringList
- func (v *MyStringList) Decode(sr stream.Reader) error
- func (v MyStringList) Encode(sw stream.Writer) error
- func (lhs MyStringList) Equals(rhs MyStringList) bool
- func (v *MyStringList) FromWire(w wire.Value) error
- func (v MyStringList) MarshalLogArray(enc zapcore.ArrayEncoder) error
- func (v MyStringList) String() string
- func (v MyStringList) ToWire() (wire.Value, error)
- type StringList
- func (v *StringList) Decode(sr stream.Reader) error
- func (v StringList) Encode(sw stream.Writer) error
- func (lhs StringList) Equals(rhs StringList) bool
- func (v *StringList) FromWire(w wire.Value) error
- func (v StringList) MarshalLogArray(enc zapcore.ArrayEncoder) error
- func (v StringList) String() string
- func (v StringList) ToWire() (wire.Value, error)
- type StringListList
- func (v *StringListList) Decode(sr stream.Reader) error
- func (v StringListList) Encode(sw stream.Writer) error
- func (lhs StringListList) Equals(rhs StringListList) bool
- func (v *StringListList) FromWire(w wire.Value) error
- func (v StringListList) MarshalLogArray(enc zapcore.ArrayEncoder) error
- func (v StringListList) String() string
- func (v StringListList) ToWire() (wire.Value, error)
- type StringSet
- func (v *StringSet) Decode(sr stream.Reader) error
- func (v StringSet) Encode(sw stream.Writer) error
- func (lhs StringSet) Equals(rhs StringSet) bool
- func (v *StringSet) FromWire(w wire.Value) error
- func (v StringSet) MarshalLogArray(enc zapcore.ArrayEncoder) error
- func (v StringSet) String() string
- func (v StringSet) ToWire() (wire.Value, error)
Constants ¶
This section is empty.
Variables ¶
var ConstListStringList [][]string = [][]string{ []string{ "hello", }, []string{ "world", }, }
var ConstStringList []string = []string{
"hello",
}
var ThriftModule = &thriftreflect.ThriftModule{
Name: "set_to_slice",
Package: "go.uber.org/thriftrw/gen/internal/tests/set_to_slice",
FilePath: "set_to_slice.thrift",
SHA1: "34a394ad873ba45745fa9002fe3625d8162d35e9",
Raw: rawIDL,
}
ThriftModule represents the IDL file used to generate this package.
Functions ¶
This section is empty.
Types ¶
type AnotherStringList ¶
type AnotherStringList MyStringList
func (*AnotherStringList) Decode ¶ added in v1.29.0
func (v *AnotherStringList) Decode(sr stream.Reader) error
Decode deserializes AnotherStringList directly off the wire.
func (AnotherStringList) Encode ¶ added in v1.29.0
func (v AnotherStringList) Encode(sw stream.Writer) error
func (AnotherStringList) Equals ¶
func (lhs AnotherStringList) Equals(rhs AnotherStringList) bool
Equals returns true if this AnotherStringList is equal to the provided AnotherStringList.
func (*AnotherStringList) FromWire ¶
func (v *AnotherStringList) FromWire(w wire.Value) error
FromWire deserializes AnotherStringList from its Thrift-level representation. The Thrift-level representation may be obtained from a ThriftRW protocol implementation.
func (AnotherStringList) MarshalLogArray ¶
func (v AnotherStringList) MarshalLogArray(enc zapcore.ArrayEncoder) error
func (AnotherStringList) String ¶
func (v AnotherStringList) String() string
String returns a readable string representation of AnotherStringList.
type Bar ¶
type Bar struct { RequiredInt32ListField []int32 `json:"requiredInt32ListField,required"` OptionalStringListField []string `json:"optionalStringListField,omitempty"` RequiredTypedefStringListField StringList `json:"requiredTypedefStringListField,required"` OptionalTypedefStringListField StringList `json:"optionalTypedefStringListField,omitempty"` RequiredFooListField []*Foo `json:"requiredFooListField,required"` OptionalFooListField []*Foo `json:"optionalFooListField,omitempty"` RequiredTypedefFooListField FooList `json:"requiredTypedefFooListField,required"` OptionalTypedefFooListField FooList `json:"optionalTypedefFooListField,omitempty"` RequiredStringListListField [][]string `json:"requiredStringListListField,required"` RequiredTypedefStringListListField StringListList `json:"requiredTypedefStringListListField,required"` }
func (*Bar) Decode ¶ added in v1.29.0
Decode deserializes a Bar struct directly from its Thrift-level representation, without going through an intemediary type.
An error is returned if a Bar struct could not be generated from the wire representation.
func (*Bar) Encode ¶ added in v1.29.0
Encode serializes a Bar struct directly into bytes, without going through an intermediary type.
An error is returned if a Bar struct could not be encoded.
func (*Bar) Equals ¶
Equals returns true if all the fields of this Bar match the provided Bar.
This function performs a deep comparison.
func (*Bar) FromWire ¶
FromWire deserializes a Bar 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 Bar struct from the provided intermediate representation.
x, err := binaryProtocol.Decode(reader, wire.TStruct) if err != nil { return nil, err } var v Bar if err := v.FromWire(x); err != nil { return nil, err } return &v, nil
func (*Bar) GetOptionalFooListField ¶
GetOptionalFooListField returns the value of OptionalFooListField if it is set or its zero value if it is unset.
func (*Bar) GetOptionalStringListField ¶
GetOptionalStringListField returns the value of OptionalStringListField if it is set or its zero value if it is unset.
func (*Bar) GetOptionalTypedefFooListField ¶
GetOptionalTypedefFooListField returns the value of OptionalTypedefFooListField if it is set or its zero value if it is unset.
func (*Bar) GetOptionalTypedefStringListField ¶
func (v *Bar) GetOptionalTypedefStringListField() (o StringList)
GetOptionalTypedefStringListField returns the value of OptionalTypedefStringListField if it is set or its zero value if it is unset.
func (*Bar) GetRequiredFooListField ¶
GetRequiredFooListField returns the value of RequiredFooListField if it is set or its zero value if it is unset.
func (*Bar) GetRequiredInt32ListField ¶
GetRequiredInt32ListField returns the value of RequiredInt32ListField if it is set or its zero value if it is unset.
func (*Bar) GetRequiredStringListListField ¶
GetRequiredStringListListField returns the value of RequiredStringListListField if it is set or its zero value if it is unset.
func (*Bar) GetRequiredTypedefFooListField ¶
GetRequiredTypedefFooListField returns the value of RequiredTypedefFooListField if it is set or its zero value if it is unset.
func (*Bar) GetRequiredTypedefStringListField ¶
func (v *Bar) GetRequiredTypedefStringListField() (o StringList)
GetRequiredTypedefStringListField returns the value of RequiredTypedefStringListField if it is set or its zero value if it is unset.
func (*Bar) GetRequiredTypedefStringListListField ¶
func (v *Bar) GetRequiredTypedefStringListListField() (o StringListList)
GetRequiredTypedefStringListListField returns the value of RequiredTypedefStringListListField if it is set or its zero value if it is unset.
func (*Bar) IsSetOptionalFooListField ¶
IsSetOptionalFooListField returns true if OptionalFooListField is not nil.
func (*Bar) IsSetOptionalStringListField ¶
IsSetOptionalStringListField returns true if OptionalStringListField is not nil.
func (*Bar) IsSetOptionalTypedefFooListField ¶
IsSetOptionalTypedefFooListField returns true if OptionalTypedefFooListField is not nil.
func (*Bar) IsSetOptionalTypedefStringListField ¶
IsSetOptionalTypedefStringListField returns true if OptionalTypedefStringListField is not nil.
func (*Bar) IsSetRequiredFooListField ¶
IsSetRequiredFooListField returns true if RequiredFooListField is not nil.
func (*Bar) IsSetRequiredInt32ListField ¶
IsSetRequiredInt32ListField returns true if RequiredInt32ListField is not nil.
func (*Bar) IsSetRequiredStringListListField ¶
IsSetRequiredStringListListField returns true if RequiredStringListListField is not nil.
func (*Bar) IsSetRequiredTypedefFooListField ¶
IsSetRequiredTypedefFooListField returns true if RequiredTypedefFooListField is not nil.
func (*Bar) IsSetRequiredTypedefStringListField ¶
IsSetRequiredTypedefStringListField returns true if RequiredTypedefStringListField is not nil.
func (*Bar) IsSetRequiredTypedefStringListListField ¶
IsSetRequiredTypedefStringListListField returns true if RequiredTypedefStringListListField is not nil.
func (*Bar) MarshalLogObject ¶
func (v *Bar) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
MarshalLogObject implements zapcore.ObjectMarshaler, enabling fast logging of Bar.
func (*Bar) ToWire ¶
ToWire translates a Bar 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 Foo ¶
type Foo struct {
StringField string `json:"stringField,required"`
}
func (*Foo) Decode ¶ added in v1.29.0
Decode deserializes a Foo struct directly from its Thrift-level representation, without going through an intemediary type.
An error is returned if a Foo struct could not be generated from the wire representation.
func (*Foo) Encode ¶ added in v1.29.0
Encode serializes a Foo struct directly into bytes, without going through an intermediary type.
An error is returned if a Foo struct could not be encoded.
func (*Foo) Equals ¶
Equals returns true if all the fields of this Foo match the provided Foo.
This function performs a deep comparison.
func (*Foo) FromWire ¶
FromWire deserializes a Foo 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 Foo struct from the provided intermediate representation.
x, err := binaryProtocol.Decode(reader, wire.TStruct) if err != nil { return nil, err } var v Foo if err := v.FromWire(x); err != nil { return nil, err } return &v, nil
func (*Foo) GetStringField ¶
GetStringField returns the value of StringField if it is set or its zero value if it is unset.
func (*Foo) MarshalLogObject ¶
func (v *Foo) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)
MarshalLogObject implements zapcore.ObjectMarshaler, enabling fast logging of Foo.
func (*Foo) ToWire ¶
ToWire translates a Foo 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 FooList ¶
type FooList []*Foo
func (*FooList) FromWire ¶
FromWire deserializes FooList from its Thrift-level representation. The Thrift-level representation may be obtained from a ThriftRW protocol implementation.
func (FooList) MarshalLogArray ¶
func (v FooList) MarshalLogArray(enc zapcore.ArrayEncoder) error
type MyStringList ¶
type MyStringList StringList
func (*MyStringList) Decode ¶ added in v1.29.0
func (v *MyStringList) Decode(sr stream.Reader) error
Decode deserializes MyStringList directly off the wire.
func (MyStringList) Equals ¶
func (lhs MyStringList) Equals(rhs MyStringList) bool
Equals returns true if this MyStringList is equal to the provided MyStringList.
func (*MyStringList) FromWire ¶
func (v *MyStringList) FromWire(w wire.Value) error
FromWire deserializes MyStringList from its Thrift-level representation. The Thrift-level representation may be obtained from a ThriftRW protocol implementation.
func (MyStringList) MarshalLogArray ¶
func (v MyStringList) MarshalLogArray(enc zapcore.ArrayEncoder) error
func (MyStringList) String ¶
func (v MyStringList) String() string
String returns a readable string representation of MyStringList.
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) MarshalLogArray ¶
func (v StringList) MarshalLogArray(enc zapcore.ArrayEncoder) error
func (StringList) String ¶
func (v StringList) String() string
String returns a readable string representation of StringList.
type StringListList ¶
type StringListList [][]string
func (*StringListList) Decode ¶ added in v1.29.0
func (v *StringListList) Decode(sr stream.Reader) error
Decode deserializes StringListList directly off the wire.
func (StringListList) Encode ¶ added in v1.29.0
func (v StringListList) Encode(sw stream.Writer) error
func (StringListList) Equals ¶
func (lhs StringListList) Equals(rhs StringListList) bool
Equals returns true if this StringListList is equal to the provided StringListList.
func (*StringListList) FromWire ¶
func (v *StringListList) FromWire(w wire.Value) error
FromWire deserializes StringListList from its Thrift-level representation. The Thrift-level representation may be obtained from a ThriftRW protocol implementation.
func (StringListList) MarshalLogArray ¶
func (v StringListList) MarshalLogArray(enc zapcore.ArrayEncoder) error
func (StringListList) String ¶
func (v StringListList) String() string
String returns a readable string representation of StringListList.
type StringSet ¶ added in v1.19.1
type StringSet map[string]struct{}
func (StringSet) Equals ¶ added in v1.19.1
Equals returns true if this StringSet is equal to the provided StringSet.
func (*StringSet) FromWire ¶ added in v1.19.1
FromWire deserializes StringSet from its Thrift-level representation. The Thrift-level representation may be obtained from a ThriftRW protocol implementation.
func (StringSet) MarshalLogArray ¶ added in v1.19.1
func (v StringSet) MarshalLogArray(enc zapcore.ArrayEncoder) error