Back to godoc.org

Package unions

v1.20.2
Latest Go to latest
Published: Oct 17, 2019 | License: MIT | Module: gopkg.in/thriftrw/thriftrw-go.v1

Index

Package Files

Variables

var ThriftModule = &thriftreflect.ThriftModule{
	Name:     "unions",
	Package:  "go.uber.org/thriftrw/gen/internal/tests/unions",
	FilePath: "unions.thrift",
	SHA1:     "ae222d8ff3a8efe55b3d2ebb0c70b4565255623c",
	Includes: []*thriftreflect.ThriftModule{
		typedefs.ThriftModule,
	},
	Raw: rawIDL,
}

ThriftModule represents the IDL file used to generate this package.

type ArbitraryValue

type ArbitraryValue struct {
	BoolValue   *bool                      `json:"boolValue,omitempty"`
	Int64Value  *int64                     `json:"int64Value,omitempty"`
	StringValue *string                    `json:"stringValue,omitempty"`
	ListValue   []*ArbitraryValue          `json:"listValue,omitempty"`
	MapValue    map[string]*ArbitraryValue `json:"mapValue,omitempty"`
}

ArbitraryValue allows constructing complex values without a schema.

A value is one of,

* Boolean * Integer * String * A list of other values * A dictionary of other values

func (*ArbitraryValue) Equals

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

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

This function performs a deep comparison.

func (*ArbitraryValue) FromWire

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

FromWire deserializes a ArbitraryValue 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 ArbitraryValue struct from the provided intermediate representation.

x, err := binaryProtocol.Decode(reader, wire.TStruct)
if err != nil {
  return nil, err
}

var v ArbitraryValue
if err := v.FromWire(x); err != nil {
  return nil, err
}
return &v, nil

func (*ArbitraryValue) GetBoolValue

func (v *ArbitraryValue) GetBoolValue() (o bool)

GetBoolValue returns the value of BoolValue if it is set or its zero value if it is unset.

func (*ArbitraryValue) GetInt64Value

func (v *ArbitraryValue) GetInt64Value() (o int64)

GetInt64Value returns the value of Int64Value if it is set or its zero value if it is unset.

func (*ArbitraryValue) GetListValue

func (v *ArbitraryValue) GetListValue() (o []*ArbitraryValue)

GetListValue returns the value of ListValue if it is set or its zero value if it is unset.

func (*ArbitraryValue) GetMapValue

func (v *ArbitraryValue) GetMapValue() (o map[string]*ArbitraryValue)

GetMapValue returns the value of MapValue if it is set or its zero value if it is unset.

func (*ArbitraryValue) GetStringValue

func (v *ArbitraryValue) GetStringValue() (o string)

GetStringValue returns the value of StringValue if it is set or its zero value if it is unset.

func (*ArbitraryValue) IsSetBoolValue

func (v *ArbitraryValue) IsSetBoolValue() bool

IsSetBoolValue returns true if BoolValue is not nil.

func (*ArbitraryValue) IsSetInt64Value

func (v *ArbitraryValue) IsSetInt64Value() bool

IsSetInt64Value returns true if Int64Value is not nil.

func (*ArbitraryValue) IsSetListValue

func (v *ArbitraryValue) IsSetListValue() bool

IsSetListValue returns true if ListValue is not nil.

func (*ArbitraryValue) IsSetMapValue

func (v *ArbitraryValue) IsSetMapValue() bool

IsSetMapValue returns true if MapValue is not nil.

func (*ArbitraryValue) IsSetStringValue

func (v *ArbitraryValue) IsSetStringValue() bool

IsSetStringValue returns true if StringValue is not nil.

func (*ArbitraryValue) MarshalLogObject

func (v *ArbitraryValue) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)

MarshalLogObject implements zapcore.ObjectMarshaler, enabling fast logging of ArbitraryValue.

func (*ArbitraryValue) String

func (v *ArbitraryValue) String() string

String returns a readable string representation of a ArbitraryValue struct.

func (*ArbitraryValue) ToWire

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

ToWire translates a ArbitraryValue 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 Document

type Document struct {
	Pdf       typedefs.PDF `json:"pdf,omitempty"`
	PlainText *string      `json:"plainText,omitempty"`
}

func (*Document) Equals

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

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

This function performs a deep comparison.

func (*Document) FromWire

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

FromWire deserializes a Document 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 Document struct from the provided intermediate representation.

x, err := binaryProtocol.Decode(reader, wire.TStruct)
if err != nil {
  return nil, err
}

var v Document
if err := v.FromWire(x); err != nil {
  return nil, err
}
return &v, nil

func (*Document) GetPdf

func (v *Document) GetPdf() (o typedefs.PDF)

GetPdf returns the value of Pdf if it is set or its zero value if it is unset.

func (*Document) GetPlainText

func (v *Document) GetPlainText() (o string)

GetPlainText returns the value of PlainText if it is set or its zero value if it is unset.

func (*Document) IsSetPdf

func (v *Document) IsSetPdf() bool

IsSetPdf returns true if Pdf is not nil.

func (*Document) IsSetPlainText

func (v *Document) IsSetPlainText() bool

IsSetPlainText returns true if PlainText is not nil.

func (*Document) MarshalLogObject

func (v *Document) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)

MarshalLogObject implements zapcore.ObjectMarshaler, enabling fast logging of Document.

func (*Document) String

func (v *Document) String() string

String returns a readable string representation of a Document struct.

func (*Document) ToWire

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

ToWire translates a Document 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 EmptyUnion

type EmptyUnion struct {
}

func (*EmptyUnion) Equals

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

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

This function performs a deep comparison.

func (*EmptyUnion) FromWire

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

FromWire deserializes a EmptyUnion 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 EmptyUnion struct from the provided intermediate representation.

x, err := binaryProtocol.Decode(reader, wire.TStruct)
if err != nil {
  return nil, err
}

var v EmptyUnion
if err := v.FromWire(x); err != nil {
  return nil, err
}
return &v, nil

func (*EmptyUnion) MarshalLogObject

func (v *EmptyUnion) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)

MarshalLogObject implements zapcore.ObjectMarshaler, enabling fast logging of EmptyUnion.

func (*EmptyUnion) String

func (v *EmptyUnion) String() string

String returns a readable string representation of a EmptyUnion struct.

func (*EmptyUnion) ToWire

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

ToWire translates a EmptyUnion 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
}
Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier