thriftrw: go.uber.org/thriftrw/internal/envelope/exception Index | Files

package exception

import "go.uber.org/thriftrw/internal/envelope/exception"

Index

Package Files

exception.go

Variables

var ThriftModule = &thriftreflect.ThriftModule{
    Name:     "exception",
    Package:  "go.uber.org/thriftrw/internal/envelope/exception",
    FilePath: "exception.thrift",
    SHA1:     "88105bcd404d4aee06542af9452f7cf76647ae98",
    Raw:      rawIDL,
}

ThriftModule represents the IDL file used to generate this package.

type ExceptionType Uses

type ExceptionType int32
const (
    ExceptionTypeUnknown               ExceptionType = 0
    ExceptionTypeUnknownMethod         ExceptionType = 1
    ExceptionTypeInvalidMessageType    ExceptionType = 2
    ExceptionTypeWrongMethodName       ExceptionType = 3
    ExceptionTypeBadSequenceID         ExceptionType = 4
    ExceptionTypeMissingResult         ExceptionType = 5
    ExceptionTypeInternalError         ExceptionType = 6
    ExceptionTypeProtocolError         ExceptionType = 7
    ExceptionTypeInvalidTransform      ExceptionType = 8
    ExceptionTypeInvalidProtocol       ExceptionType = 9
    ExceptionTypeUnsupportedClientType ExceptionType = 10
)

func ExceptionType_Values Uses

func ExceptionType_Values() []ExceptionType

ExceptionType_Values returns all recognized values of ExceptionType.

func (ExceptionType) Equals Uses

func (v ExceptionType) Equals(rhs ExceptionType) bool

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

func (*ExceptionType) FromWire Uses

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

FromWire deserializes ExceptionType from its Thrift-level representation.

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

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

func (ExceptionType) MarshalJSON Uses

func (v ExceptionType) MarshalJSON() ([]byte, error)

MarshalJSON serializes ExceptionType into JSON.

If the enum value is recognized, its name is returned. Otherwise, its integer value is returned.

This implements json.Marshaler.

func (ExceptionType) MarshalLogObject Uses

func (v ExceptionType) MarshalLogObject(enc zapcore.ObjectEncoder) error

MarshalLogObject implements zapcore.ObjectMarshaler, enabling fast logging of ExceptionType. Enums are logged as objects, where the value is logged with key "value", and if this value's name is known, the name is logged with key "name".

func (ExceptionType) MarshalText Uses

func (v ExceptionType) MarshalText() ([]byte, error)

MarshalText encodes ExceptionType to text.

If the enum value is recognized, its name is returned. Otherwise, its integer value is returned.

This implements the TextMarshaler interface.

func (ExceptionType) Ptr Uses

func (v ExceptionType) Ptr() *ExceptionType

Ptr returns a pointer to this enum value.

func (ExceptionType) String Uses

func (v ExceptionType) String() string

String returns a readable string representation of ExceptionType.

func (ExceptionType) ToWire Uses

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

ToWire translates ExceptionType 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 (*ExceptionType) UnmarshalJSON Uses

func (v *ExceptionType) UnmarshalJSON(text []byte) error

UnmarshalJSON attempts to decode ExceptionType 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 (*ExceptionType) UnmarshalText Uses

func (v *ExceptionType) UnmarshalText(value []byte) error

UnmarshalText tries to decode ExceptionType from a byte slice containing its name.

var v ExceptionType
err := v.UnmarshalText([]byte("UNKNOWN"))

type TApplicationException Uses

type TApplicationException struct {
    Message *string        `json:"message,omitempty"`
    Type    *ExceptionType `json:"type,omitempty"`
}

func (*TApplicationException) Equals Uses

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

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

This function performs a deep comparison.

func (*TApplicationException) Error Uses

func (v *TApplicationException) Error() string

func (*TApplicationException) ErrorName Uses

func (*TApplicationException) ErrorName() string

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

func (*TApplicationException) FromWire Uses

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

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

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

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

func (*TApplicationException) GetMessage Uses

func (v *TApplicationException) GetMessage() (o string)

GetMessage returns the value of Message if it is set or its zero value if it is unset.

func (*TApplicationException) GetType Uses

func (v *TApplicationException) GetType() (o ExceptionType)

GetType returns the value of Type if it is set or its zero value if it is unset.

func (*TApplicationException) IsSetMessage Uses

func (v *TApplicationException) IsSetMessage() bool

IsSetMessage returns true if Message is not nil.

func (*TApplicationException) IsSetType Uses

func (v *TApplicationException) IsSetType() bool

IsSetType returns true if Type is not nil.

func (*TApplicationException) MarshalLogObject Uses

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

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

func (*TApplicationException) String Uses

func (v *TApplicationException) String() string

String returns a readable string representation of a TApplicationException struct.

func (*TApplicationException) ToWire Uses

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

ToWire translates a TApplicationException 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 exception imports 10 packages (graph) and is imported by 9 packages. Updated 2020-04-01. Refresh now. Tools for package owners.