internal

package
v1.37.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ThriftModule = &thriftreflect.ThriftModule{
	Name:     "internal",
	Package:  "go.uber.org/yarpc/encoding/thrift/internal",
	FilePath: "internal.thrift",
	SHA1:     "43d339d0566531c13482a795ecce0eb36785cbff",
	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 added in v1.10.0

func ExceptionType_Values() []ExceptionType

ExceptionType_Values returns all recognized values of ExceptionType.

func (ExceptionType) Equals added in v1.8.0

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 added in v0.4.0

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 added in v1.33.0

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 added in v1.31.0

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 added in v1.26.0

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 added in v0.4.0

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 added in v1.10.0

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"`
}

TApplicationException is a Thrift-level exception.

Thrift envelopes with the type Exception contain an exception of this shape.

func (*TApplicationException) Equals added in v1.8.0

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

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 added in v1.14.0

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 added in v1.35.2

func (v *TApplicationException) IsSetMessage() bool

IsSetMessage returns true if Message is not nil.

func (*TApplicationException) IsSetType added in v1.35.2

func (v *TApplicationException) IsSetType() bool

IsSetType returns true if Type is not nil.

func (*TApplicationException) MarshalLogObject added in v1.33.0

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
}

Jump to

Keyboard shortcuts

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