Documentation

Index

Constants

This section is empty.

Variables

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

    Functions

    This section is empty.

    Types

    type ExceptionType

    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

    func ExceptionType_Values() []ExceptionType

      ExceptionType_Values returns all recognized values of ExceptionType.

      func (ExceptionType) Equals

      func (v ExceptionType) Equals(rhs ExceptionType) bool

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

        func (*ExceptionType) FromWire

        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

          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

            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

              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

                func (v ExceptionType) Ptr() *ExceptionType

                  Ptr returns a pointer to this enum value.

                  func (ExceptionType) String

                  func (v ExceptionType) String() string

                    String returns a readable string representation of ExceptionType.

                    func (ExceptionType) ToWire

                    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

                      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

                        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

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

                          func (*TApplicationException) Equals

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

                            This function performs a deep comparison.

                            func (*TApplicationException) Error

                            func (v *TApplicationException) Error() string

                            func (*TApplicationException) ErrorName

                            func (*TApplicationException) ErrorName() string

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

                              func (*TApplicationException) FromWire

                              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

                                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

                                  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

                                    func (v *TApplicationException) IsSetMessage() bool

                                      IsSetMessage returns true if Message is not nil.

                                      func (*TApplicationException) IsSetType

                                      func (v *TApplicationException) IsSetType() bool

                                        IsSetType returns true if Type is not nil.

                                        func (*TApplicationException) MarshalLogObject

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

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

                                          func (*TApplicationException) String

                                          func (v *TApplicationException) String() string

                                            String returns a readable string representation of a TApplicationException struct.

                                            func (*TApplicationException) ToWire

                                            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
                                              }
                                              

                                              Source Files