set_to_slice

package
v1.31.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConstListStringList [][]string = [][]string{
	[]string{
		"hello",
	},
	[]string{
		"world",
	},
}
View Source
var ConstStringList []string = []string{
	"hello",
}
View Source
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.

func (AnotherStringList) ToWire

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

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

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

func (v *Bar) Decode(sr stream.Reader) error

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

func (v *Bar) Encode(sw stream.Writer) error

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

func (v *Bar) Equals(rhs *Bar) bool

Equals returns true if all the fields of this Bar match the provided Bar.

This function performs a deep comparison.

func (*Bar) FromWire

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

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

func (v *Bar) GetOptionalFooListField() (o []*Foo)

GetOptionalFooListField returns the value of OptionalFooListField if it is set or its zero value if it is unset.

func (*Bar) GetOptionalStringListField

func (v *Bar) GetOptionalStringListField() (o []string)

GetOptionalStringListField returns the value of OptionalStringListField if it is set or its zero value if it is unset.

func (*Bar) GetOptionalTypedefFooListField

func (v *Bar) GetOptionalTypedefFooListField() (o FooList)

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

func (v *Bar) GetRequiredFooListField() (o []*Foo)

GetRequiredFooListField returns the value of RequiredFooListField if it is set or its zero value if it is unset.

func (*Bar) GetRequiredInt32ListField

func (v *Bar) GetRequiredInt32ListField() (o []int32)

GetRequiredInt32ListField returns the value of RequiredInt32ListField if it is set or its zero value if it is unset.

func (*Bar) GetRequiredStringListListField

func (v *Bar) GetRequiredStringListListField() (o [][]string)

GetRequiredStringListListField returns the value of RequiredStringListListField if it is set or its zero value if it is unset.

func (*Bar) GetRequiredTypedefFooListField

func (v *Bar) GetRequiredTypedefFooListField() (o FooList)

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

func (v *Bar) IsSetOptionalFooListField() bool

IsSetOptionalFooListField returns true if OptionalFooListField is not nil.

func (*Bar) IsSetOptionalStringListField

func (v *Bar) IsSetOptionalStringListField() bool

IsSetOptionalStringListField returns true if OptionalStringListField is not nil.

func (*Bar) IsSetOptionalTypedefFooListField

func (v *Bar) IsSetOptionalTypedefFooListField() bool

IsSetOptionalTypedefFooListField returns true if OptionalTypedefFooListField is not nil.

func (*Bar) IsSetOptionalTypedefStringListField

func (v *Bar) IsSetOptionalTypedefStringListField() bool

IsSetOptionalTypedefStringListField returns true if OptionalTypedefStringListField is not nil.

func (*Bar) IsSetRequiredFooListField

func (v *Bar) IsSetRequiredFooListField() bool

IsSetRequiredFooListField returns true if RequiredFooListField is not nil.

func (*Bar) IsSetRequiredInt32ListField

func (v *Bar) IsSetRequiredInt32ListField() bool

IsSetRequiredInt32ListField returns true if RequiredInt32ListField is not nil.

func (*Bar) IsSetRequiredStringListListField

func (v *Bar) IsSetRequiredStringListListField() bool

IsSetRequiredStringListListField returns true if RequiredStringListListField is not nil.

func (*Bar) IsSetRequiredTypedefFooListField

func (v *Bar) IsSetRequiredTypedefFooListField() bool

IsSetRequiredTypedefFooListField returns true if RequiredTypedefFooListField is not nil.

func (*Bar) IsSetRequiredTypedefStringListField

func (v *Bar) IsSetRequiredTypedefStringListField() bool

IsSetRequiredTypedefStringListField returns true if RequiredTypedefStringListField is not nil.

func (*Bar) IsSetRequiredTypedefStringListListField

func (v *Bar) IsSetRequiredTypedefStringListListField() bool

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

func (v *Bar) String() string

String returns a readable string representation of a Bar struct.

func (*Bar) ToWire

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

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

func (v *Foo) Decode(sr stream.Reader) error

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

func (v *Foo) Encode(sw stream.Writer) error

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

func (v *Foo) Equals(rhs *Foo) bool

Equals returns true if all the fields of this Foo match the provided Foo.

This function performs a deep comparison.

func (*Foo) FromWire

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

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

func (v *Foo) GetStringField() (o string)

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

func (v *Foo) String() string

String returns a readable string representation of a Foo struct.

func (*Foo) ToWire

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

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) Decode added in v1.29.0

func (v *FooList) Decode(sr stream.Reader) error

Decode deserializes FooList directly off the wire.

func (FooList) Encode added in v1.29.0

func (v FooList) Encode(sw stream.Writer) error

func (FooList) Equals

func (lhs FooList) Equals(rhs FooList) bool

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

func (*FooList) FromWire

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

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

func (FooList) String

func (v FooList) String() string

String returns a readable string representation of FooList.

func (FooList) ToWire

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

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

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) Encode added in v1.29.0

func (v MyStringList) Encode(sw stream.Writer) error

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.

func (MyStringList) ToWire

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

ToWire translates MyStringList 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) Decode added in v1.29.0

func (v *StringList) Decode(sr stream.Reader) error

Decode deserializes StringList directly off the wire.

func (StringList) Encode added in v1.29.0

func (v StringList) Encode(sw stream.Writer) error

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.

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

func (StringListList) ToWire

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

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

type StringSet added in v1.19.1

type StringSet map[string]struct{}

func (*StringSet) Decode added in v1.29.0

func (v *StringSet) Decode(sr stream.Reader) error

Decode deserializes StringSet directly off the wire.

func (StringSet) Encode added in v1.29.0

func (v StringSet) Encode(sw stream.Writer) error

func (StringSet) Equals added in v1.19.1

func (lhs StringSet) Equals(rhs StringSet) bool

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

func (*StringSet) FromWire added in v1.19.1

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

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

func (StringSet) String added in v1.19.1

func (v StringSet) String() string

String returns a readable string representation of StringSet.

func (StringSet) ToWire added in v1.19.1

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

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL