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

package exceptions

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

Index

Package Files

exceptions.go

Variables

var ThriftModule = &thriftreflect.ThriftModule{
    Name:     "exceptions",
    Package:  "go.uber.org/thriftrw/gen/internal/tests/exceptions",
    FilePath: "exceptions.thrift",
    SHA1:     "a31a29f9f7bca3221100e43e32b0d833ca9c774e",
    Raw:      rawIDL,
}

ThriftModule represents the IDL file used to generate this package.

type DoesNotExistException Uses

type DoesNotExistException struct {
    // Key that was missing.
    Key    string  `json:"key,required"`
    Error2 *string `json:"Error,omitempty"`
}

Raised when something doesn't exist.

func (*DoesNotExistException) Equals Uses

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

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

This function performs a deep comparison.

func (*DoesNotExistException) Error Uses

func (v *DoesNotExistException) Error() string

func (*DoesNotExistException) ErrorName Uses

func (*DoesNotExistException) ErrorName() string

ErrorName is the name of this type as defined in the Thrift file.

func (*DoesNotExistException) FromWire Uses

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

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

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

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

func (*DoesNotExistException) GetError2 Uses

func (v *DoesNotExistException) GetError2() (o string)

GetError2 returns the value of Error2 if it is set or its zero value if it is unset.

func (*DoesNotExistException) GetKey Uses

func (v *DoesNotExistException) GetKey() (o string)

GetKey returns the value of Key if it is set or its zero value if it is unset.

func (*DoesNotExistException) IsSetError2 Uses

func (v *DoesNotExistException) IsSetError2() bool

IsSetError2 returns true if Error2 is not nil.

func (*DoesNotExistException) MarshalLogObject Uses

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

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

func (*DoesNotExistException) String Uses

func (v *DoesNotExistException) String() string

String returns a readable string representation of a DoesNotExistException struct.

func (*DoesNotExistException) ToWire Uses

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

ToWire translates a DoesNotExistException 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 DoesNotExistException2 Uses

type DoesNotExistException2 struct {
    // Key that was missing.
    Key    string  `json:"key,required"`
    Error2 *string `json:"Error,omitempty"`
}

func (*DoesNotExistException2) Equals Uses

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

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

This function performs a deep comparison.

func (*DoesNotExistException2) Error Uses

func (v *DoesNotExistException2) Error() string

func (*DoesNotExistException2) ErrorName Uses

func (*DoesNotExistException2) ErrorName() string

ErrorName is the name of this type as defined in the Thrift file.

func (*DoesNotExistException2) FromWire Uses

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

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

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

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

func (*DoesNotExistException2) GetError2 Uses

func (v *DoesNotExistException2) GetError2() (o string)

GetError2 returns the value of Error2 if it is set or its zero value if it is unset.

func (*DoesNotExistException2) GetKey Uses

func (v *DoesNotExistException2) GetKey() (o string)

GetKey returns the value of Key if it is set or its zero value if it is unset.

func (*DoesNotExistException2) IsSetError2 Uses

func (v *DoesNotExistException2) IsSetError2() bool

IsSetError2 returns true if Error2 is not nil.

func (*DoesNotExistException2) MarshalLogObject Uses

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

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

func (*DoesNotExistException2) String Uses

func (v *DoesNotExistException2) String() string

String returns a readable string representation of a DoesNotExistException2 struct.

func (*DoesNotExistException2) ToWire Uses

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

ToWire translates a DoesNotExistException2 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 EmptyException Uses

type EmptyException struct {
}

func (*EmptyException) Equals Uses

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

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

This function performs a deep comparison.

func (*EmptyException) Error Uses

func (v *EmptyException) Error() string

func (*EmptyException) ErrorName Uses

func (*EmptyException) ErrorName() string

ErrorName is the name of this type as defined in the Thrift file.

func (*EmptyException) FromWire Uses

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

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

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

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

func (*EmptyException) MarshalLogObject Uses

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

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

func (*EmptyException) String Uses

func (v *EmptyException) String() string

String returns a readable string representation of a EmptyException struct.

func (*EmptyException) ToWire Uses

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

ToWire translates a EmptyException 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
}

Package exceptions imports 6 packages (graph) and is imported by 4 packages. Updated 2020-01-23. Refresh now. Tools for package owners.