thrift

package module
v0.0.0-...-4e95448 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 28 Imported by: 587

README

Facebook Thrift Go

The files in this repository is only for the Go libraries of fbthrift, see facebook/fbthrift for the remaining code.

Documentation

Index

Constants

View Source
const (
	UNKNOWN_APPLICATION_EXCEPTION  = 0
	UNKNOWN_METHOD                 = 1
	INVALID_MESSAGE_TYPE_EXCEPTION = 2
	WRONG_METHOD_NAME              = 3
	BAD_SEQUENCE_ID                = 4
	MISSING_RESULT                 = 5
	INTERNAL_ERROR                 = 6
	PROTOCOL_ERROR                 = 7
)
View Source
const (
	COMPACT_PROTOCOL_ID       = 0x082
	COMPACT_VERSION           = 0x01
	COMPACT_VERSION_BE        = 0x02
	COMPACT_VERSION_MASK      = 0x1f
	COMPACT_TYPE_MASK         = 0x0E0
	COMPACT_TYPE_BITS         = 0x07
	COMPACT_TYPE_SHIFT_AMOUNT = 5
)
View Source
const (
	COMPACT_BOOLEAN_TRUE  = 0x01
	COMPACT_BOOLEAN_FALSE = 0x02
	COMPACT_BYTE          = 0x03
	COMPACT_I16           = 0x04
	COMPACT_I32           = 0x05
	COMPACT_I64           = 0x06
	COMPACT_DOUBLE        = 0x07
	COMPACT_BINARY        = 0x08
	COMPACT_LIST          = 0x09
	COMPACT_SET           = 0x0A
	COMPACT_MAP           = 0x0B
	COMPACT_STRUCT        = 0x0C
	COMPACT_FLOAT         = 0x0D
)
View Source
const (
	VERSION_MASK = 0xffff0000
	VERSION_1    = 0x80010000
)
View Source
const (
	IdentityHeader       string = "identity"
	IDVersionHeader      string = "id_version"
	IDVersion            string = "1"
	PriorityHeader       string = "thrift_priority"
	ClientTimeoutHeader  string = "client_timeout"
	QueueTimeoutHeader   string = "queue_timeout"
	ClientMetadataHeader string = "client_metadata"
	ClientMetadata       string = "{\"agent\":\"headertransport.go\"}"
	// Header Magicks
	// 0 and 16th bits must be 0 to differentiate from framed & unframed
	HeaderMagic         uint32 = 0x0FFF0000
	HeaderMask          uint32 = 0xFFFF0000
	FlagsMask           uint32 = 0x0000FFFF
	HTTPServerMagic     uint32 = 0x504F5354 // POST
	HTTPClientMagic     uint32 = 0x48545450 // HTTP
	HTTPGetClientMagic  uint32 = 0x47455420 // GET
	HTTPHeadClientMagic uint32 = 0x48454144 // HEAD
	BigFrameMagic       uint32 = 0x42494746 // BIGF
	MaxFrameSize        uint32 = 0x3FFFFFFF
	CommonHeaderSize    uint64 = 10
	MaxHeaderSize       uint32 = 131071
)

Header keys

View Source
const (
	DefaulprotoID     = ProtocolIDCompact
	DefaultClientType = HeaderClientType
)
View Source
const (
	UNKNOWN_PROTOCOL_EXCEPTION = 0
	INVALID_DATA               = 1
	NEGATIVE_SIZE              = 2
	SIZE_LIMIT                 = 3
	BAD_VERSION                = 4
	NOT_IMPLEMENTED            = 5
	DEPTH_LIMIT                = 6
)
View Source
const (
	UNKNOWN_TRANSPORT_EXCEPTION = 0
	NOT_OPEN                    = 1
	ALREADY_OPEN                = 2
	TIMED_OUT                   = 3
	END_OF_FILE                 = 4
	INTERRUPTED                 = 5
	BAD_ARGS                    = 6
	CORRUPTED_DATA              = 7
	NOT_SUPPORTED               = 9
	INVALID_STATE               = 10
	INVALID_FRAME_SIZE          = 11
	SSL_ERROR                   = 12
	COULD_NOT_BIND              = 13
	NETWORK_ERROR               = 15
	INVALID_HEADERS_TYPE        = 16
)
View Source
const (
	STOP   = 0
	VOID   = 1
	BOOL   = 2
	BYTE   = 3
	I08    = 3
	DOUBLE = 4
	I16    = 6
	I32    = 8
	I64    = 10
	STRING = 11
	UTF7   = 11
	STRUCT = 12
	MAP    = 13
	SET    = 14
	LIST   = 15
	UTF8   = 16
	UTF16  = 17
	STREAM = 18
	FLOAT  = 19
)
View Source
const BinaryVersion1 uint32 = 0x80010000
View Source
const BinaryVersionMask uint32 = 0xffff0000
View Source
const DEFAULT_MAX_LENGTH = 16384000
View Source
const DEFAULT_RECURSION_DEPTH = 64

The maximum recursive depth the skip() function will traverse

View Source
const KRocketProtocolKey int64 = 4036991616
View Source
const KRocketProtocolKeyWithSBE int64 = 4036991617
View Source
const MULTIPLEXED_SEPARATOR = ":"
View Source
const (
	THRIFT_JSON_PROTOCOL_VERSION = 1
)
View Source
const UnknownRemaining = ^uint64(0)

UnknownRemaining is used by transports that can not return a real answer for RemainingBytes()

Variables

View Source
var (
	ProtocolIdToName = map[ProtocolId]string{
		ProtocolId_BINARY:  "BINARY",
		ProtocolId_COMPACT: "COMPACT",
	}

	ProtocolIdToValue = map[string]ProtocolId{
		"BINARY":  ProtocolId_BINARY,
		"COMPACT": ProtocolId_COMPACT,
	}

	ProtocolIdNames = []string{
		"BINARY",
		"COMPACT",
	}

	ProtocolIdValues = []ProtocolId{
		ProtocolId_BINARY,
		ProtocolId_COMPACT,
	}
)

Enum value maps for ProtocolId

View Source
var (
	RpcKindToName = map[RpcKind]string{
		RpcKind_SINGLE_REQUEST_SINGLE_RESPONSE:    "SINGLE_REQUEST_SINGLE_RESPONSE",
		RpcKind_SINGLE_REQUEST_NO_RESPONSE:        "SINGLE_REQUEST_NO_RESPONSE",
		RpcKind_SINGLE_REQUEST_STREAMING_RESPONSE: "SINGLE_REQUEST_STREAMING_RESPONSE",
		RpcKind_SINK: "SINK",
	}

	RpcKindToValue = map[string]RpcKind{
		"SINGLE_REQUEST_SINGLE_RESPONSE":    RpcKind_SINGLE_REQUEST_SINGLE_RESPONSE,
		"SINGLE_REQUEST_NO_RESPONSE":        RpcKind_SINGLE_REQUEST_NO_RESPONSE,
		"SINGLE_REQUEST_STREAMING_RESPONSE": RpcKind_SINGLE_REQUEST_STREAMING_RESPONSE,
		"SINK":                              RpcKind_SINK,
	}

	RpcKindNames = []string{
		"SINGLE_REQUEST_SINGLE_RESPONSE",
		"SINGLE_REQUEST_NO_RESPONSE",
		"SINGLE_REQUEST_STREAMING_RESPONSE",
		"SINK",
	}

	RpcKindValues = []RpcKind{
		RpcKind_SINGLE_REQUEST_SINGLE_RESPONSE,
		RpcKind_SINGLE_REQUEST_NO_RESPONSE,
		RpcKind_SINGLE_REQUEST_STREAMING_RESPONSE,
		RpcKind_SINK,
	}
)

Enum value maps for RpcKind

View Source
var (
	RpcPriorityToName = map[RpcPriority]string{
		RpcPriority_HIGH_IMPORTANT: "HIGH_IMPORTANT",
		RpcPriority_HIGH:           "HIGH",
		RpcPriority_IMPORTANT:      "IMPORTANT",
		RpcPriority_NORMAL:         "NORMAL",
		RpcPriority_BEST_EFFORT:    "BEST_EFFORT",
		RpcPriority_N_PRIORITIES:   "N_PRIORITIES",
	}

	RpcPriorityToValue = map[string]RpcPriority{
		"HIGH_IMPORTANT": RpcPriority_HIGH_IMPORTANT,
		"HIGH":           RpcPriority_HIGH,
		"IMPORTANT":      RpcPriority_IMPORTANT,
		"NORMAL":         RpcPriority_NORMAL,
		"BEST_EFFORT":    RpcPriority_BEST_EFFORT,
		"N_PRIORITIES":   RpcPriority_N_PRIORITIES,
	}

	RpcPriorityNames = []string{
		"HIGH_IMPORTANT",
		"HIGH",
		"IMPORTANT",
		"NORMAL",
		"BEST_EFFORT",
		"N_PRIORITIES",
	}

	RpcPriorityValues = []RpcPriority{
		RpcPriority_HIGH_IMPORTANT,
		RpcPriority_HIGH,
		RpcPriority_IMPORTANT,
		RpcPriority_NORMAL,
		RpcPriority_BEST_EFFORT,
		RpcPriority_N_PRIORITIES,
	}
)

Enum value maps for RpcPriority

View Source
var (
	CompressionAlgorithmToName = map[CompressionAlgorithm]string{
		CompressionAlgorithm_NONE: "NONE",
		CompressionAlgorithm_ZLIB: "ZLIB",
		CompressionAlgorithm_ZSTD: "ZSTD",
	}

	CompressionAlgorithmToValue = map[string]CompressionAlgorithm{
		"NONE": CompressionAlgorithm_NONE,
		"ZLIB": CompressionAlgorithm_ZLIB,
		"ZSTD": CompressionAlgorithm_ZSTD,
	}

	CompressionAlgorithmNames = []string{
		"NONE",
		"ZLIB",
		"ZSTD",
	}

	CompressionAlgorithmValues = []CompressionAlgorithm{
		CompressionAlgorithm_NONE,
		CompressionAlgorithm_ZLIB,
		CompressionAlgorithm_ZSTD,
	}
)

Enum value maps for CompressionAlgorithm

View Source
var (
	ErrorKindToName = map[ErrorKind]string{
		ErrorKind_UNSPECIFIED: "UNSPECIFIED",
		ErrorKind_TRANSIENT:   "TRANSIENT",
		ErrorKind_STATEFUL:    "STATEFUL",
		ErrorKind_PERMANENT:   "PERMANENT",
	}

	ErrorKindToValue = map[string]ErrorKind{
		"UNSPECIFIED": ErrorKind_UNSPECIFIED,
		"TRANSIENT":   ErrorKind_TRANSIENT,
		"STATEFUL":    ErrorKind_STATEFUL,
		"PERMANENT":   ErrorKind_PERMANENT,
	}

	ErrorKindNames = []string{
		"UNSPECIFIED",
		"TRANSIENT",
		"STATEFUL",
		"PERMANENT",
	}

	ErrorKindValues = []ErrorKind{
		ErrorKind_UNSPECIFIED,
		ErrorKind_TRANSIENT,
		ErrorKind_STATEFUL,
		ErrorKind_PERMANENT,
	}
)

Enum value maps for ErrorKind

View Source
var (
	ErrorBlameToName = map[ErrorBlame]string{
		ErrorBlame_UNSPECIFIED: "UNSPECIFIED",
		ErrorBlame_SERVER:      "SERVER",
		ErrorBlame_CLIENT:      "CLIENT",
	}

	ErrorBlameToValue = map[string]ErrorBlame{
		"UNSPECIFIED": ErrorBlame_UNSPECIFIED,
		"SERVER":      ErrorBlame_SERVER,
		"CLIENT":      ErrorBlame_CLIENT,
	}

	ErrorBlameNames = []string{
		"UNSPECIFIED",
		"SERVER",
		"CLIENT",
	}

	ErrorBlameValues = []ErrorBlame{
		ErrorBlame_UNSPECIFIED,
		ErrorBlame_SERVER,
		ErrorBlame_CLIENT,
	}
)

Enum value maps for ErrorBlame

View Source
var (
	ErrorSafetyToName = map[ErrorSafety]string{
		ErrorSafety_UNSPECIFIED: "UNSPECIFIED",
		ErrorSafety_SAFE:        "SAFE",
	}

	ErrorSafetyToValue = map[string]ErrorSafety{
		"UNSPECIFIED": ErrorSafety_UNSPECIFIED,
		"SAFE":        ErrorSafety_SAFE,
	}

	ErrorSafetyNames = []string{
		"UNSPECIFIED",
		"SAFE",
	}

	ErrorSafetyValues = []ErrorSafety{
		ErrorSafety_UNSPECIFIED,
		ErrorSafety_SAFE,
	}
)

Enum value maps for ErrorSafety

View Source
var (
	ResponseRpcErrorCategoryToName = map[ResponseRpcErrorCategory]string{
		ResponseRpcErrorCategory_INTERNAL_ERROR:  "INTERNAL_ERROR",
		ResponseRpcErrorCategory_INVALID_REQUEST: "INVALID_REQUEST",
		ResponseRpcErrorCategory_LOADSHEDDING:    "LOADSHEDDING",
		ResponseRpcErrorCategory_SHUTDOWN:        "SHUTDOWN",
	}

	ResponseRpcErrorCategoryToValue = map[string]ResponseRpcErrorCategory{
		"INTERNAL_ERROR":  ResponseRpcErrorCategory_INTERNAL_ERROR,
		"INVALID_REQUEST": ResponseRpcErrorCategory_INVALID_REQUEST,
		"LOADSHEDDING":    ResponseRpcErrorCategory_LOADSHEDDING,
		"SHUTDOWN":        ResponseRpcErrorCategory_SHUTDOWN,
	}

	ResponseRpcErrorCategoryNames = []string{
		"INTERNAL_ERROR",
		"INVALID_REQUEST",
		"LOADSHEDDING",
		"SHUTDOWN",
	}

	ResponseRpcErrorCategoryValues = []ResponseRpcErrorCategory{
		ResponseRpcErrorCategory_INTERNAL_ERROR,
		ResponseRpcErrorCategory_INVALID_REQUEST,
		ResponseRpcErrorCategory_LOADSHEDDING,
		ResponseRpcErrorCategory_SHUTDOWN,
	}
)

Enum value maps for ResponseRpcErrorCategory

View Source
var (
	ResponseRpcErrorCodeToName = map[ResponseRpcErrorCode]string{
		ResponseRpcErrorCode_UNKNOWN:                       "UNKNOWN",
		ResponseRpcErrorCode_OVERLOAD:                      "OVERLOAD",
		ResponseRpcErrorCode_TASK_EXPIRED:                  "TASK_EXPIRED",
		ResponseRpcErrorCode_QUEUE_OVERLOADED:              "QUEUE_OVERLOADED",
		ResponseRpcErrorCode_SHUTDOWN:                      "SHUTDOWN",
		ResponseRpcErrorCode_INJECTED_FAILURE:              "INJECTED_FAILURE",
		ResponseRpcErrorCode_REQUEST_PARSING_FAILURE:       "REQUEST_PARSING_FAILURE",
		ResponseRpcErrorCode_QUEUE_TIMEOUT:                 "QUEUE_TIMEOUT",
		ResponseRpcErrorCode_RESPONSE_TOO_BIG:              "RESPONSE_TOO_BIG",
		ResponseRpcErrorCode_WRONG_RPC_KIND:                "WRONG_RPC_KIND",
		ResponseRpcErrorCode_UNKNOWN_METHOD:                "UNKNOWN_METHOD",
		ResponseRpcErrorCode_CHECKSUM_MISMATCH:             "CHECKSUM_MISMATCH",
		ResponseRpcErrorCode_INTERRUPTION:                  "INTERRUPTION",
		ResponseRpcErrorCode_APP_OVERLOAD:                  "APP_OVERLOAD",
		ResponseRpcErrorCode_UNKNOWN_INTERACTION_ID:        "UNKNOWN_INTERACTION_ID",
		ResponseRpcErrorCode_INTERACTION_CONSTRUCTOR_ERROR: "INTERACTION_CONSTRUCTOR_ERROR",
		ResponseRpcErrorCode_UNIMPLEMENTED_METHOD:          "UNIMPLEMENTED_METHOD",
		ResponseRpcErrorCode_TENANT_QUOTA_EXCEEDED:         "TENANT_QUOTA_EXCEEDED",
	}

	ResponseRpcErrorCodeToValue = map[string]ResponseRpcErrorCode{
		"UNKNOWN":                       ResponseRpcErrorCode_UNKNOWN,
		"OVERLOAD":                      ResponseRpcErrorCode_OVERLOAD,
		"TASK_EXPIRED":                  ResponseRpcErrorCode_TASK_EXPIRED,
		"QUEUE_OVERLOADED":              ResponseRpcErrorCode_QUEUE_OVERLOADED,
		"SHUTDOWN":                      ResponseRpcErrorCode_SHUTDOWN,
		"INJECTED_FAILURE":              ResponseRpcErrorCode_INJECTED_FAILURE,
		"REQUEST_PARSING_FAILURE":       ResponseRpcErrorCode_REQUEST_PARSING_FAILURE,
		"QUEUE_TIMEOUT":                 ResponseRpcErrorCode_QUEUE_TIMEOUT,
		"RESPONSE_TOO_BIG":              ResponseRpcErrorCode_RESPONSE_TOO_BIG,
		"WRONG_RPC_KIND":                ResponseRpcErrorCode_WRONG_RPC_KIND,
		"UNKNOWN_METHOD":                ResponseRpcErrorCode_UNKNOWN_METHOD,
		"CHECKSUM_MISMATCH":             ResponseRpcErrorCode_CHECKSUM_MISMATCH,
		"INTERRUPTION":                  ResponseRpcErrorCode_INTERRUPTION,
		"APP_OVERLOAD":                  ResponseRpcErrorCode_APP_OVERLOAD,
		"UNKNOWN_INTERACTION_ID":        ResponseRpcErrorCode_UNKNOWN_INTERACTION_ID,
		"INTERACTION_CONSTRUCTOR_ERROR": ResponseRpcErrorCode_INTERACTION_CONSTRUCTOR_ERROR,
		"UNIMPLEMENTED_METHOD":          ResponseRpcErrorCode_UNIMPLEMENTED_METHOD,
		"TENANT_QUOTA_EXCEEDED":         ResponseRpcErrorCode_TENANT_QUOTA_EXCEEDED,
	}

	ResponseRpcErrorCodeNames = []string{
		"UNKNOWN",
		"OVERLOAD",
		"TASK_EXPIRED",
		"QUEUE_OVERLOADED",
		"SHUTDOWN",
		"INJECTED_FAILURE",
		"REQUEST_PARSING_FAILURE",
		"QUEUE_TIMEOUT",
		"RESPONSE_TOO_BIG",
		"WRONG_RPC_KIND",
		"UNKNOWN_METHOD",
		"CHECKSUM_MISMATCH",
		"INTERRUPTION",
		"APP_OVERLOAD",
		"UNKNOWN_INTERACTION_ID",
		"INTERACTION_CONSTRUCTOR_ERROR",
		"UNIMPLEMENTED_METHOD",
		"TENANT_QUOTA_EXCEEDED",
	}

	ResponseRpcErrorCodeValues = []ResponseRpcErrorCode{
		ResponseRpcErrorCode_UNKNOWN,
		ResponseRpcErrorCode_OVERLOAD,
		ResponseRpcErrorCode_TASK_EXPIRED,
		ResponseRpcErrorCode_QUEUE_OVERLOADED,
		ResponseRpcErrorCode_SHUTDOWN,
		ResponseRpcErrorCode_INJECTED_FAILURE,
		ResponseRpcErrorCode_REQUEST_PARSING_FAILURE,
		ResponseRpcErrorCode_QUEUE_TIMEOUT,
		ResponseRpcErrorCode_RESPONSE_TOO_BIG,
		ResponseRpcErrorCode_WRONG_RPC_KIND,
		ResponseRpcErrorCode_UNKNOWN_METHOD,
		ResponseRpcErrorCode_CHECKSUM_MISMATCH,
		ResponseRpcErrorCode_INTERRUPTION,
		ResponseRpcErrorCode_APP_OVERLOAD,
		ResponseRpcErrorCode_UNKNOWN_INTERACTION_ID,
		ResponseRpcErrorCode_INTERACTION_CONSTRUCTOR_ERROR,
		ResponseRpcErrorCode_UNIMPLEMENTED_METHOD,
		ResponseRpcErrorCode_TENANT_QUOTA_EXCEEDED,
	}
)

Enum value maps for ResponseRpcErrorCode

View Source
var (
	StreamRpcErrorCodeToName = map[StreamRpcErrorCode]string{
		StreamRpcErrorCode_UNKNOWN:        "UNKNOWN",
		StreamRpcErrorCode_CREDIT_TIMEOUT: "CREDIT_TIMEOUT",
		StreamRpcErrorCode_CHUNK_TIMEOUT:  "CHUNK_TIMEOUT",
	}

	StreamRpcErrorCodeToValue = map[string]StreamRpcErrorCode{
		"UNKNOWN":        StreamRpcErrorCode_UNKNOWN,
		"CREDIT_TIMEOUT": StreamRpcErrorCode_CREDIT_TIMEOUT,
		"CHUNK_TIMEOUT":  StreamRpcErrorCode_CHUNK_TIMEOUT,
	}

	StreamRpcErrorCodeNames = []string{
		"UNKNOWN",
		"CREDIT_TIMEOUT",
		"CHUNK_TIMEOUT",
	}

	StreamRpcErrorCodeValues = []StreamRpcErrorCode{
		StreamRpcErrorCode_UNKNOWN,
		StreamRpcErrorCode_CREDIT_TIMEOUT,
		StreamRpcErrorCode_CHUNK_TIMEOUT,
	}
)

Enum value maps for StreamRpcErrorCode

View Source
var (
	InterfaceKindToName = map[InterfaceKind]string{
		InterfaceKind_USER:       "USER",
		InterfaceKind_DEBUGGING:  "DEBUGGING",
		InterfaceKind_MONITORING: "MONITORING",
		InterfaceKind_PROFILING:  "PROFILING",
	}

	InterfaceKindToValue = map[string]InterfaceKind{
		"USER":       InterfaceKind_USER,
		"DEBUGGING":  InterfaceKind_DEBUGGING,
		"MONITORING": InterfaceKind_MONITORING,
		"PROFILING":  InterfaceKind_PROFILING,
	}

	InterfaceKindNames = []string{
		"USER",
		"DEBUGGING",
		"MONITORING",
		"PROFILING",
	}

	InterfaceKindValues = []InterfaceKind{
		InterfaceKind_USER,
		InterfaceKind_DEBUGGING,
		InterfaceKind_MONITORING,
		InterfaceKind_PROFILING,
	}
)

Enum value maps for InterfaceKind

View Source
var (
	DrainCompleteCodeToName = map[DrainCompleteCode]string{
		DrainCompleteCode_EXCEEDED_INGRESS_MEM_LIMIT: "EXCEEDED_INGRESS_MEM_LIMIT",
	}

	DrainCompleteCodeToValue = map[string]DrainCompleteCode{
		"EXCEEDED_INGRESS_MEM_LIMIT": DrainCompleteCode_EXCEEDED_INGRESS_MEM_LIMIT,
	}

	DrainCompleteCodeNames = []string{
		"EXCEEDED_INGRESS_MEM_LIMIT",
	}

	DrainCompleteCodeValues = []DrainCompleteCode{
		DrainCompleteCode_EXCEEDED_INGRESS_MEM_LIMIT,
	}
)

Enum value maps for DrainCompleteCode

View Source
var (
	JSON_COMMA                   []byte
	JSON_COLON                   []byte
	JSON_LBRACE                  []byte
	JSON_RBRACE                  []byte
	JSON_LBRACKET                []byte
	JSON_RBRACKET                []byte
	JSON_QUOTE                   byte
	JSON_QUOTE_BYTES             []byte
	JSON_NULL                    []byte
	JSON_TRUE                    []byte
	JSON_FALSE                   []byte
	JSON_INFINITY                string
	JSON_NEGATIVE_INFINITY       string
	JSON_NAN                     string
	JSON_INFINITY_BYTES          []byte
	JSON_NEGATIVE_INFINITY_BYTES []byte
	JSON_NAN_BYTES               []byte
)
View Source
var ANONYMOUS_FIELD *field
View Source
var DefaultConfig = TimingConfig{
	History:   120 * time.Second,
	Precision: time.Microsecond,
	Interval:  time.Second,
}

DefaultConfig records timing data at μs precision, remembers 120s of history, and has 1 second granularity. PRO TIP: use the defaults.

View Source
var DefaultHTTPClient *http.Client = http.DefaultClient

Default to using the shared http client. Library users are free to change this global client or specify one through httpClientOptions.

View Source
var ErrServerClosed = errors.New("thrift: Server closed")

ErrServerClosed is returned by the Serve methods after a call to Stop

Functions

func AddHeader

func AddHeader(ctx context.Context, key string, value string) (context.Context, error)

AddHeader adds a header to the context, which will be sent as part of the request. AddHeader can be called multiple times to add multiple headers. These headers are not persistent and will only be sent with the current request.

func BoolPtr

func BoolPtr(v bool) *bool

func BytePtr

func BytePtr(v byte) *byte

func ByteSlicePtr

func ByteSlicePtr(v []byte) *[]byte

func Float32Ptr

func Float32Ptr(v float32) *float32

func Float64Ptr

func Float64Ptr(v float64) *float64

func HeadersFromContext

func HeadersFromContext(ctx context.Context) map[string]string

HeadersFromContext extracts headers for this message, both per-message and persistent headers. When both a per-message header and a persistent header exist with the same name, the persistent header is returned. This is also the behaviour of the C++ implementation. This function returns nil when the underlying transport/protocol do not support headers.

func Int16Ptr

func Int16Ptr(v int16) *int16

func Int32Ptr

func Int32Ptr(v int32) *int32

func Int64Ptr

func Int64Ptr(v int64) *int64

func Int8Ptr

func Int8Ptr(v int8) *int8

func IntPtr

func IntPtr(v int) *int

func Logger

func Logger(log *log.Logger) func(*ServerOptions)

Logger sets the logger used for the server

func NewStoredMessageProtocol

func NewStoredMessageProtocol(protocol Protocol, name string, typeID MessageType, seqid int32) *storedMessageProtocol

func PrependError

func PrependError(prepend string, err error) error

PrependError prepends additional information to an error without losing the thrift exception interface

func Skip

func Skip(self Format, fieldType Type, maxDepth int) (err error)

Skip skips over the next data element from the provided Protocol object.

func SkipDefaultDepth

func SkipDefaultDepth(prot Format, typeID Type) (err error)

SkipDefaultDepth skips over the next data element from the provided Protocol object.

func StringPtr

func StringPtr(v string) *string

func Uint16Ptr

func Uint16Ptr(v uint16) *uint16

func Uint32Ptr

func Uint32Ptr(v uint32) *uint32

func Uint64Ptr

func Uint64Ptr(v uint64) *uint64

func Uint8Ptr

func Uint8Ptr(v uint8) *uint8

func WithConnInfo

func WithConnInfo(ctx context.Context, client Transport) context.Context

WithConnInfo adds connection info (from a thrift.Transport) to context, if applicable

func WithInterceptor

func WithInterceptor(interceptor Interceptor) func(*ServerOptions)

WithInterceptor sets the interceptor for the server

func WithProtocol

func WithProtocol(ctx context.Context, proto Protocol) context.Context

WithProtocol attaches thrift protocol to a context

func WithRPCOptions

func WithRPCOptions(ctx context.Context, opts *RPCOptions) context.Context

WithRPCOptions sets the RPCOptions in a client request go context

func WithRequestContext

func WithRequestContext(ctx context.Context, reqCtx *RequestContext) context.Context

WithRequestContext sets the RequestContext in a given go context

func WriteIOBufPtr

func WriteIOBufPtr(item IOBufPtr, p Format) error

func WriteManagedStringViewField

func WriteManagedStringViewField(item ManagedStringViewField, p Format) error

func WriteString_4852

func WriteString_4852(item String_4852, p Format) error

Types

type ApplicationException

type ApplicationException interface {
	Exception
	TypeID() int32
	Read(prot Format) (ApplicationException, error)
	Write(prot Format) error
}

ApplicationException is an application level Thrift exception

func NewApplicationException

func NewApplicationException(exceptionType int32, message string) ApplicationException

NewApplicationException creates a new ApplicationException

func NewApplicationExceptionCause

func NewApplicationExceptionCause(exceptionType int32, message string, cause error) ApplicationException

NewApplicationExceptionCause creates a new ApplicationException with a root cause error

type AtomicCounter

type AtomicCounter struct {
	Counter int64
}

AtomicCounter is a simple non-blocking incr/decr counter for instantaneous values exported by thrift

func (*AtomicCounter) Decr

func (ac *AtomicCounter) Decr() int64

Decr non blocking increments by 1

func (*AtomicCounter) Get

func (ac *AtomicCounter) Get() int64

Get non blocking gets current value

func (*AtomicCounter) Incr

func (ac *AtomicCounter) Incr() int64

Incr non blocking increments by 1

type BinaryProtocol

type BinaryProtocol struct {
	// contains filtered or unexported fields
}

func NewBinaryProtocol

func NewBinaryProtocol(t Transport, strictRead, strictWrite bool) *BinaryProtocol

func NewBinaryProtocolTransport

func NewBinaryProtocolTransport(t Transport) *BinaryProtocol

func (*BinaryProtocol) Close

func (p *BinaryProtocol) Close() error

func (*BinaryProtocol) Flush

func (p *BinaryProtocol) Flush() (err error)

func (*BinaryProtocol) ReadBinary

func (p *BinaryProtocol) ReadBinary() ([]byte, error)

func (*BinaryProtocol) ReadBool

func (p *BinaryProtocol) ReadBool() (bool, error)

func (*BinaryProtocol) ReadByte

func (p *BinaryProtocol) ReadByte() (byte, error)

func (*BinaryProtocol) ReadDouble

func (p *BinaryProtocol) ReadDouble() (value float64, err error)

func (*BinaryProtocol) ReadFieldBegin

func (p *BinaryProtocol) ReadFieldBegin() (name string, typeID Type, seqID int16, err error)

func (*BinaryProtocol) ReadFieldEnd

func (p *BinaryProtocol) ReadFieldEnd() error

func (*BinaryProtocol) ReadFloat

func (p *BinaryProtocol) ReadFloat() (value float32, err error)

func (*BinaryProtocol) ReadI16

func (p *BinaryProtocol) ReadI16() (value int16, err error)

func (*BinaryProtocol) ReadI32

func (p *BinaryProtocol) ReadI32() (value int32, err error)

func (*BinaryProtocol) ReadI64

func (p *BinaryProtocol) ReadI64() (value int64, err error)

func (*BinaryProtocol) ReadListBegin

func (p *BinaryProtocol) ReadListBegin() (elemType Type, size int, err error)

func (*BinaryProtocol) ReadListEnd

func (p *BinaryProtocol) ReadListEnd() error

func (*BinaryProtocol) ReadMapBegin

func (p *BinaryProtocol) ReadMapBegin() (kType, vType Type, size int, err error)

func (*BinaryProtocol) ReadMapEnd

func (p *BinaryProtocol) ReadMapEnd() error

func (*BinaryProtocol) ReadMessageBegin

func (p *BinaryProtocol) ReadMessageBegin() (name string, typeID MessageType, seqID int32, err error)

func (*BinaryProtocol) ReadMessageEnd

func (p *BinaryProtocol) ReadMessageEnd() error

func (*BinaryProtocol) ReadSetBegin

func (p *BinaryProtocol) ReadSetBegin() (elemType Type, size int, err error)

func (*BinaryProtocol) ReadSetEnd

func (p *BinaryProtocol) ReadSetEnd() error

func (*BinaryProtocol) ReadString

func (p *BinaryProtocol) ReadString() (value string, err error)

func (*BinaryProtocol) ReadStructBegin

func (p *BinaryProtocol) ReadStructBegin() (name string, err error)

func (*BinaryProtocol) ReadStructEnd

func (p *BinaryProtocol) ReadStructEnd() error

func (*BinaryProtocol) Skip

func (p *BinaryProtocol) Skip(fieldType Type) (err error)

func (*BinaryProtocol) WriteBinary

func (p *BinaryProtocol) WriteBinary(value []byte) error

func (*BinaryProtocol) WriteBool

func (p *BinaryProtocol) WriteBool(value bool) error

func (*BinaryProtocol) WriteByte

func (p *BinaryProtocol) WriteByte(value byte) error

func (*BinaryProtocol) WriteDouble

func (p *BinaryProtocol) WriteDouble(value float64) error

func (*BinaryProtocol) WriteFieldBegin

func (p *BinaryProtocol) WriteFieldBegin(name string, typeID Type, id int16) error

func (*BinaryProtocol) WriteFieldEnd

func (p *BinaryProtocol) WriteFieldEnd() error

func (*BinaryProtocol) WriteFieldStop

func (p *BinaryProtocol) WriteFieldStop() error

func (*BinaryProtocol) WriteFloat

func (p *BinaryProtocol) WriteFloat(value float32) error

func (*BinaryProtocol) WriteI16

func (p *BinaryProtocol) WriteI16(value int16) error

func (*BinaryProtocol) WriteI32

func (p *BinaryProtocol) WriteI32(value int32) error

func (*BinaryProtocol) WriteI64

func (p *BinaryProtocol) WriteI64(value int64) error

func (*BinaryProtocol) WriteListBegin

func (p *BinaryProtocol) WriteListBegin(elemType Type, size int) error

func (*BinaryProtocol) WriteListEnd

func (p *BinaryProtocol) WriteListEnd() error

func (*BinaryProtocol) WriteMapBegin

func (p *BinaryProtocol) WriteMapBegin(keyType Type, valueType Type, size int) error

func (*BinaryProtocol) WriteMapEnd

func (p *BinaryProtocol) WriteMapEnd() error

func (*BinaryProtocol) WriteMessageBegin

func (p *BinaryProtocol) WriteMessageBegin(name string, typeID MessageType, seqID int32) error

func (*BinaryProtocol) WriteMessageEnd

func (p *BinaryProtocol) WriteMessageEnd() error

func (*BinaryProtocol) WriteSetBegin

func (p *BinaryProtocol) WriteSetBegin(elemType Type, size int) error

func (*BinaryProtocol) WriteSetEnd

func (p *BinaryProtocol) WriteSetEnd() error

func (*BinaryProtocol) WriteString

func (p *BinaryProtocol) WriteString(value string) error

func (*BinaryProtocol) WriteStructBegin

func (p *BinaryProtocol) WriteStructBegin(name string) error

func (*BinaryProtocol) WriteStructEnd

func (p *BinaryProtocol) WriteStructEnd() error

type BufferedTransport

type BufferedTransport struct {
	bufio.ReadWriter
	// contains filtered or unexported fields
}

func NewBufferedTransport

func NewBufferedTransport(trans Transport, bufferSize int) *BufferedTransport

func (*BufferedTransport) Close

func (p *BufferedTransport) Close() (err error)

func (*BufferedTransport) Flush

func (p *BufferedTransport) Flush() error

func (*BufferedTransport) Read

func (p *BufferedTransport) Read(b []byte) (int, error)

func (*BufferedTransport) RemainingBytes

func (p *BufferedTransport) RemainingBytes() (num_bytes uint64)

func (*BufferedTransport) Write

func (p *BufferedTransport) Write(b []byte) (int, error)

type ClientConn

type ClientConn struct {
	// contains filtered or unexported fields
}

ClientConn holds all the connection information for a thrift client

func NewClientConn

func NewClientConn(proto Protocol) ClientConn

NewClientConn creates a new ClientConn object using a protocol

func (*ClientConn) Close

func (cc *ClientConn) Close() error

Close closes the client connection

func (*ClientConn) RecvMsg

func (cc *ClientConn) RecvMsg(ctx context.Context, method string, res IResponse) error

RecvMsg receives the response from a call to a thrift endpoint

func (*ClientConn) SendMsg

func (cc *ClientConn) SendMsg(ctx context.Context, method string, req IRequest, msgType MessageType) error

SendMsg sends a request to a given thrift endpoint

type ClientInterface

type ClientInterface interface {
	Close() error
}

ClientInterface specifies the common methods every thrift client should implement

type ClientPushMetadata

type ClientPushMetadata struct {
	InteractionTerminate  *InteractionTerminate  `thrift:"interactionTerminate,1" json:"interactionTerminate,omitempty" db:"interactionTerminate"`
	StreamHeadersPush     *StreamHeadersPush     `thrift:"streamHeadersPush,2" json:"streamHeadersPush,omitempty" db:"streamHeadersPush"`
	TransportMetadataPush *TransportMetadataPush `thrift:"transportMetadataPush,3" json:"transportMetadataPush,omitempty" db:"transportMetadataPush"`
}

func NewClientPushMetadata

func NewClientPushMetadata() *ClientPushMetadata

func (*ClientPushMetadata) CountSetFieldsClientPushMetadata

func (x *ClientPushMetadata) CountSetFieldsClientPushMetadata() int

func (*ClientPushMetadata) GetInteractionTerminate

func (x *ClientPushMetadata) GetInteractionTerminate() *InteractionTerminate

func (*ClientPushMetadata) GetInteractionTerminateNonCompat

func (x *ClientPushMetadata) GetInteractionTerminateNonCompat() *InteractionTerminate

func (*ClientPushMetadata) GetStreamHeadersPush

func (x *ClientPushMetadata) GetStreamHeadersPush() *StreamHeadersPush

func (*ClientPushMetadata) GetStreamHeadersPushNonCompat

func (x *ClientPushMetadata) GetStreamHeadersPushNonCompat() *StreamHeadersPush

func (*ClientPushMetadata) GetTransportMetadataPush

func (x *ClientPushMetadata) GetTransportMetadataPush() *TransportMetadataPush

func (*ClientPushMetadata) GetTransportMetadataPushNonCompat

func (x *ClientPushMetadata) GetTransportMetadataPushNonCompat() *TransportMetadataPush

func (*ClientPushMetadata) IsSetInteractionTerminate

func (x *ClientPushMetadata) IsSetInteractionTerminate() bool

func (*ClientPushMetadata) IsSetStreamHeadersPush

func (x *ClientPushMetadata) IsSetStreamHeadersPush() bool

func (*ClientPushMetadata) IsSetTransportMetadataPush

func (x *ClientPushMetadata) IsSetTransportMetadataPush() bool

func (*ClientPushMetadata) Read

func (x *ClientPushMetadata) Read(p Format) error

func (*ClientPushMetadata) SetInteractionTerminate

func (x *ClientPushMetadata) SetInteractionTerminate(value *InteractionTerminate) *ClientPushMetadata

func (*ClientPushMetadata) SetInteractionTerminateNonCompat

func (x *ClientPushMetadata) SetInteractionTerminateNonCompat(value InteractionTerminate) *ClientPushMetadata

func (*ClientPushMetadata) SetStreamHeadersPush

func (x *ClientPushMetadata) SetStreamHeadersPush(value *StreamHeadersPush) *ClientPushMetadata

func (*ClientPushMetadata) SetStreamHeadersPushNonCompat

func (x *ClientPushMetadata) SetStreamHeadersPushNonCompat(value StreamHeadersPush) *ClientPushMetadata

func (*ClientPushMetadata) SetTransportMetadataPush

func (x *ClientPushMetadata) SetTransportMetadataPush(value *TransportMetadataPush) *ClientPushMetadata

func (*ClientPushMetadata) SetTransportMetadataPushNonCompat

func (x *ClientPushMetadata) SetTransportMetadataPushNonCompat(value TransportMetadataPush) *ClientPushMetadata

func (*ClientPushMetadata) String

func (x *ClientPushMetadata) String() string

func (*ClientPushMetadata) Write

func (x *ClientPushMetadata) Write(p Format) error

type ClientType

type ClientType int64
const (
	HeaderClientType ClientType = iota
	FramedDeprecated
	UnframedDeprecated
	HTTPServerType
	HTTPClientType
	FramedCompact
	HTTPGetClientType
	UnknownClientType
	UnframedCompactDeprecated
)

func (ClientType) String

func (c ClientType) String() string

type CodecConfig

type CodecConfig struct {
	ZlibConfig *ZlibCompressionCodecConfig `thrift:"zlibConfig,1" json:"zlibConfig,omitempty" db:"zlibConfig"`
	ZstdConfig *ZstdCompressionCodecConfig `thrift:"zstdConfig,2" json:"zstdConfig,omitempty" db:"zstdConfig"`
}

func NewCodecConfig

func NewCodecConfig() *CodecConfig

func (*CodecConfig) CountSetFieldsCodecConfig

func (x *CodecConfig) CountSetFieldsCodecConfig() int

func (*CodecConfig) GetZlibConfig

func (x *CodecConfig) GetZlibConfig() *ZlibCompressionCodecConfig

func (*CodecConfig) GetZlibConfigNonCompat

func (x *CodecConfig) GetZlibConfigNonCompat() *ZlibCompressionCodecConfig

func (*CodecConfig) GetZstdConfig

func (x *CodecConfig) GetZstdConfig() *ZstdCompressionCodecConfig

func (*CodecConfig) GetZstdConfigNonCompat

func (x *CodecConfig) GetZstdConfigNonCompat() *ZstdCompressionCodecConfig

func (*CodecConfig) IsSetZlibConfig

func (x *CodecConfig) IsSetZlibConfig() bool

func (*CodecConfig) IsSetZstdConfig

func (x *CodecConfig) IsSetZstdConfig() bool

func (*CodecConfig) Read

func (x *CodecConfig) Read(p Format) error

func (*CodecConfig) SetZlibConfig

func (x *CodecConfig) SetZlibConfig(value *ZlibCompressionCodecConfig) *CodecConfig

func (*CodecConfig) SetZlibConfigNonCompat

func (x *CodecConfig) SetZlibConfigNonCompat(value ZlibCompressionCodecConfig) *CodecConfig

func (*CodecConfig) SetZstdConfig

func (x *CodecConfig) SetZstdConfig(value *ZstdCompressionCodecConfig) *CodecConfig

func (*CodecConfig) SetZstdConfigNonCompat

func (x *CodecConfig) SetZstdConfigNonCompat(value ZstdCompressionCodecConfig) *CodecConfig

func (*CodecConfig) String

func (x *CodecConfig) String() string

func (*CodecConfig) Write

func (x *CodecConfig) Write(p Format) error

type CompactProtocol

type CompactProtocol struct {
	// contains filtered or unexported fields
}

func NewCompactProtocol

func NewCompactProtocol(trans Transport) *CompactProtocol

Create a CompactProtocol given a Transport

func (*CompactProtocol) Close

func (p *CompactProtocol) Close() error

func (*CompactProtocol) Flush

func (p *CompactProtocol) Flush() (err error)

func (*CompactProtocol) ReadBinary

func (p *CompactProtocol) ReadBinary() (value []byte, err error)

Read a []byte from the wire.

func (*CompactProtocol) ReadBool

func (p *CompactProtocol) ReadBool() (value bool, err error)

Read a boolean off the wire. If this is a boolean field, the value should already have been read during readFieldBegin, so we'll just consume the pre-stored value. Otherwise, read a byte.

func (*CompactProtocol) ReadByte

func (p *CompactProtocol) ReadByte() (byte, error)

Read a single byte off the wire. Nothing interesting here.

func (*CompactProtocol) ReadDouble

func (p *CompactProtocol) ReadDouble() (value float64, err error)

No magic here - just read a double off the wire.

func (*CompactProtocol) ReadFieldBegin

func (p *CompactProtocol) ReadFieldBegin() (name string, typeID Type, id int16, err error)

Read a field header off the wire.

func (*CompactProtocol) ReadFieldEnd

func (p *CompactProtocol) ReadFieldEnd() error

func (*CompactProtocol) ReadFloat

func (p *CompactProtocol) ReadFloat() (value float32, err error)

No magic here - just read a float off the wire.

func (*CompactProtocol) ReadI16

func (p *CompactProtocol) ReadI16() (value int16, err error)

Read an i16 from the wire as a zigzag varint.

func (*CompactProtocol) ReadI32

func (p *CompactProtocol) ReadI32() (value int32, err error)

Read an i32 from the wire as a zigzag varint.

func (*CompactProtocol) ReadI64

func (p *CompactProtocol) ReadI64() (value int64, err error)

Read an i64 from the wire as a zigzag varint.

func (*CompactProtocol) ReadListBegin

func (p *CompactProtocol) ReadListBegin() (elemType Type, size int, err error)

Read a list header off the wire. If the list size is 0-14, the size will be packed into the element type header. If it's a longer list, the 4 MSB of the element type header will be 0xF, and a varint will follow with the true size.

func (*CompactProtocol) ReadListEnd

func (p *CompactProtocol) ReadListEnd() error

func (*CompactProtocol) ReadMapBegin

func (p *CompactProtocol) ReadMapBegin() (keyType Type, valueType Type, size int, err error)

Read a map header off the wire. If the size is zero, skip reading the key and value type. This means that 0-length maps will yield Maps without the "correct" types.

func (*CompactProtocol) ReadMapEnd

func (p *CompactProtocol) ReadMapEnd() error

func (*CompactProtocol) ReadMessageBegin

func (p *CompactProtocol) ReadMessageBegin() (name string, typeID MessageType, seqID int32, err error)

Read a message header.

func (*CompactProtocol) ReadMessageEnd

func (p *CompactProtocol) ReadMessageEnd() error

func (*CompactProtocol) ReadSetBegin

func (p *CompactProtocol) ReadSetBegin() (elemType Type, size int, err error)

Read a set header off the wire. If the set size is 0-14, the size will be packed into the element type header. If it's a longer set, the 4 MSB of the element type header will be 0xF, and a varint will follow with the true size.

func (*CompactProtocol) ReadSetEnd

func (p *CompactProtocol) ReadSetEnd() error

func (*CompactProtocol) ReadString

func (p *CompactProtocol) ReadString() (value string, err error)

Reads a []byte (via readBinary), and then UTF-8 decodes it.

func (*CompactProtocol) ReadStructBegin

func (p *CompactProtocol) ReadStructBegin() (name string, err error)

Read a struct begin. There's nothing on the wire for this, but it is our opportunity to push a new struct begin marker onto the field stack.

func (*CompactProtocol) ReadStructEnd

func (p *CompactProtocol) ReadStructEnd() error

Doesn't actually consume any wire data, just removes the last field for this struct from the field stack.

func (*CompactProtocol) Skip

func (p *CompactProtocol) Skip(fieldType Type) (err error)

func (*CompactProtocol) WriteBinary

func (p *CompactProtocol) WriteBinary(bin []byte) error

Write a byte array, using a varint for the size.

func (*CompactProtocol) WriteBool

func (p *CompactProtocol) WriteBool(value bool) error

func (*CompactProtocol) WriteByte

func (p *CompactProtocol) WriteByte(value byte) error

Write a byte. Nothing to see here!

func (*CompactProtocol) WriteDouble

func (p *CompactProtocol) WriteDouble(value float64) error

Write a double to the wire as 8 bytes.

func (*CompactProtocol) WriteFieldBegin

func (p *CompactProtocol) WriteFieldBegin(name string, typeID Type, id int16) error

func (*CompactProtocol) WriteFieldEnd

func (p *CompactProtocol) WriteFieldEnd() error

func (*CompactProtocol) WriteFieldStop

func (p *CompactProtocol) WriteFieldStop() error

func (*CompactProtocol) WriteFloat

func (p *CompactProtocol) WriteFloat(value float32) error

Write a float to the wire as 4 bytes.

func (*CompactProtocol) WriteI16

func (p *CompactProtocol) WriteI16(value int16) error

Write an I16 as a zigzag varint.

func (*CompactProtocol) WriteI32

func (p *CompactProtocol) WriteI32(value int32) error

Write an i32 as a zigzag varint.

func (*CompactProtocol) WriteI64

func (p *CompactProtocol) WriteI64(value int64) error

Write an i64 as a zigzag varint.

func (*CompactProtocol) WriteListBegin

func (p *CompactProtocol) WriteListBegin(elemType Type, size int) error

Write a list header.

func (*CompactProtocol) WriteListEnd

func (p *CompactProtocol) WriteListEnd() error

func (*CompactProtocol) WriteMapBegin

func (p *CompactProtocol) WriteMapBegin(keyType Type, valueType Type, size int) error

func (*CompactProtocol) WriteMapEnd

func (p *CompactProtocol) WriteMapEnd() error

func (*CompactProtocol) WriteMessageBegin

func (p *CompactProtocol) WriteMessageBegin(name string, typeID MessageType, seqid int32) error

Write a message header to the wire. Compact Protocol messages contain the protocol version so we can migrate forwards in the future if need be.

func (*CompactProtocol) WriteMessageEnd

func (p *CompactProtocol) WriteMessageEnd() error

func (*CompactProtocol) WriteSetBegin

func (p *CompactProtocol) WriteSetBegin(elemType Type, size int) error

Write a set header.

func (*CompactProtocol) WriteSetEnd

func (p *CompactProtocol) WriteSetEnd() error

func (*CompactProtocol) WriteString

func (p *CompactProtocol) WriteString(value string) error

Write a string to the wire with a varint size preceding.

func (*CompactProtocol) WriteStructBegin

func (p *CompactProtocol) WriteStructBegin(name string) error

Write a struct begin. This doesn't actually put anything on the wire. We use it as an opportunity to put special placeholder markers on the field stack so we can get the field id deltas correct.

func (*CompactProtocol) WriteStructEnd

func (p *CompactProtocol) WriteStructEnd() error

Write a struct end. This doesn't actually put anything on the wire. We use this as an opportunity to pop the last field from the current struct off of the field stack.

type CompressionAlgorithm

type CompressionAlgorithm int32
const (
	CompressionAlgorithm_NONE CompressionAlgorithm = 0
	CompressionAlgorithm_ZLIB CompressionAlgorithm = 1
	CompressionAlgorithm_ZSTD CompressionAlgorithm = 2
)

func (CompressionAlgorithm) Ptr

func (CompressionAlgorithm) String

func (x CompressionAlgorithm) String() string

type CompressionConfig

type CompressionConfig struct {
	CodecConfig          *CodecConfig `thrift:"codecConfig,1,optional" json:"codecConfig,omitempty" db:"codecConfig"`
	CompressionSizeLimit *int64       `thrift:"compressionSizeLimit,2,optional" json:"compressionSizeLimit,omitempty" db:"compressionSizeLimit"`
}

func NewCompressionConfig

func NewCompressionConfig() *CompressionConfig

func (*CompressionConfig) GetCodecConfig

func (x *CompressionConfig) GetCodecConfig() *CodecConfig

func (*CompressionConfig) GetCodecConfigNonCompat

func (x *CompressionConfig) GetCodecConfigNonCompat() *CodecConfig

func (*CompressionConfig) GetCompressionSizeLimit

func (x *CompressionConfig) GetCompressionSizeLimit() int64

func (*CompressionConfig) GetCompressionSizeLimitNonCompat

func (x *CompressionConfig) GetCompressionSizeLimitNonCompat() *int64

func (*CompressionConfig) IsSetCodecConfig

func (x *CompressionConfig) IsSetCodecConfig() bool

func (*CompressionConfig) IsSetCompressionSizeLimit

func (x *CompressionConfig) IsSetCompressionSizeLimit() bool

func (*CompressionConfig) Read

func (x *CompressionConfig) Read(p Format) error

func (*CompressionConfig) SetCodecConfig

func (x *CompressionConfig) SetCodecConfig(value *CodecConfig) *CompressionConfig

func (*CompressionConfig) SetCodecConfigNonCompat

func (x *CompressionConfig) SetCodecConfigNonCompat(value CodecConfig) *CompressionConfig

func (*CompressionConfig) SetCompressionSizeLimit

func (x *CompressionConfig) SetCompressionSizeLimit(value *int64) *CompressionConfig

func (*CompressionConfig) SetCompressionSizeLimitNonCompat

func (x *CompressionConfig) SetCompressionSizeLimitNonCompat(value int64) *CompressionConfig

func (*CompressionConfig) String

func (x *CompressionConfig) String() string

func (*CompressionConfig) Write

func (x *CompressionConfig) Write(p Format) error

type ConnInfo

type ConnInfo struct {
	LocalAddr  net.Addr
	RemoteAddr net.Addr
	// contains filtered or unexported fields
}

ConnInfo contains connection information from clients of the SimpleServer.

func ConnInfoFromContext

func ConnInfoFromContext(ctx context.Context) (ConnInfo, bool)

ConnInfoFromContext extracts and returns ConnInfo from context.

func (ConnInfo) String

func (c ConnInfo) String() string

String implements the fmt.Stringer interface.

func (ConnInfo) TLS

func (c ConnInfo) TLS() *tls.ConnectionState

TLS returns the TLS connection state.

type DebugProtocol

type DebugProtocol struct {
	Delegate  Format
	LogPrefix string
}

func (*DebugProtocol) Flush

func (tdp *DebugProtocol) Flush() (err error)

func (*DebugProtocol) ReadBinary

func (tdp *DebugProtocol) ReadBinary() (value []byte, err error)

func (*DebugProtocol) ReadBool

func (tdp *DebugProtocol) ReadBool() (value bool, err error)

func (*DebugProtocol) ReadByte

func (tdp *DebugProtocol) ReadByte() (value byte, err error)

func (*DebugProtocol) ReadDouble

func (tdp *DebugProtocol) ReadDouble() (value float64, err error)

func (*DebugProtocol) ReadFieldBegin

func (tdp *DebugProtocol) ReadFieldBegin() (name string, typeId Type, id int16, err error)

func (*DebugProtocol) ReadFieldEnd

func (tdp *DebugProtocol) ReadFieldEnd() (err error)

func (*DebugProtocol) ReadFloat

func (tdp *DebugProtocol) ReadFloat() (value float32, err error)

func (*DebugProtocol) ReadI16

func (tdp *DebugProtocol) ReadI16() (value int16, err error)

func (*DebugProtocol) ReadI32

func (tdp *DebugProtocol) ReadI32() (value int32, err error)

func (*DebugProtocol) ReadI64

func (tdp *DebugProtocol) ReadI64() (value int64, err error)

func (*DebugProtocol) ReadListBegin

func (tdp *DebugProtocol) ReadListBegin() (elemType Type, size int, err error)

func (*DebugProtocol) ReadListEnd

func (tdp *DebugProtocol) ReadListEnd() (err error)

func (*DebugProtocol) ReadMapBegin

func (tdp *DebugProtocol) ReadMapBegin() (keyType Type, valueType Type, size int, err error)

func (*DebugProtocol) ReadMapEnd

func (tdp *DebugProtocol) ReadMapEnd() (err error)

func (*DebugProtocol) ReadMessageBegin

func (tdp *DebugProtocol) ReadMessageBegin() (name string, typeId MessageType, seqid int32, err error)

func (*DebugProtocol) ReadMessageEnd

func (tdp *DebugProtocol) ReadMessageEnd() (err error)

func (*DebugProtocol) ReadSetBegin

func (tdp *DebugProtocol) ReadSetBegin() (elemType Type, size int, err error)

func (*DebugProtocol) ReadSetEnd

func (tdp *DebugProtocol) ReadSetEnd() (err error)

func (*DebugProtocol) ReadString

func (tdp *DebugProtocol) ReadString() (value string, err error)

func (*DebugProtocol) ReadStructBegin

func (tdp *DebugProtocol) ReadStructBegin() (name string, err error)

func (*DebugProtocol) ReadStructEnd

func (tdp *DebugProtocol) ReadStructEnd() (err error)

func (*DebugProtocol) Skip

func (tdp *DebugProtocol) Skip(fieldType Type) (err error)

func (*DebugProtocol) WriteBinary

func (tdp *DebugProtocol) WriteBinary(value []byte) error

func (*DebugProtocol) WriteBool

func (tdp *DebugProtocol) WriteBool(value bool) error

func (*DebugProtocol) WriteByte

func (tdp *DebugProtocol) WriteByte(value byte) error

func (*DebugProtocol) WriteDouble

func (tdp *DebugProtocol) WriteDouble(value float64) error

func (*DebugProtocol) WriteFieldBegin

func (tdp *DebugProtocol) WriteFieldBegin(name string, typeId Type, id int16) error

func (*DebugProtocol) WriteFieldEnd

func (tdp *DebugProtocol) WriteFieldEnd() error

func (*DebugProtocol) WriteFieldStop

func (tdp *DebugProtocol) WriteFieldStop() error

func (*DebugProtocol) WriteFloat

func (tdp *DebugProtocol) WriteFloat(value float32) error

func (*DebugProtocol) WriteI16

func (tdp *DebugProtocol) WriteI16(value int16) error

func (*DebugProtocol) WriteI32

func (tdp *DebugProtocol) WriteI32(value int32) error

func (*DebugProtocol) WriteI64

func (tdp *DebugProtocol) WriteI64(value int64) error

func (*DebugProtocol) WriteListBegin

func (tdp *DebugProtocol) WriteListBegin(elemType Type, size int) error

func (*DebugProtocol) WriteListEnd

func (tdp *DebugProtocol) WriteListEnd() error

func (*DebugProtocol) WriteMapBegin

func (tdp *DebugProtocol) WriteMapBegin(keyType Type, valueType Type, size int) error

func (*DebugProtocol) WriteMapEnd

func (tdp *DebugProtocol) WriteMapEnd() error

func (*DebugProtocol) WriteMessageBegin

func (tdp *DebugProtocol) WriteMessageBegin(name string, typeId MessageType, seqid int32) error

func (*DebugProtocol) WriteMessageEnd

func (tdp *DebugProtocol) WriteMessageEnd() error

func (*DebugProtocol) WriteSetBegin

func (tdp *DebugProtocol) WriteSetBegin(elemType Type, size int) error

func (*DebugProtocol) WriteSetEnd

func (tdp *DebugProtocol) WriteSetEnd() error

func (*DebugProtocol) WriteString

func (tdp *DebugProtocol) WriteString(value string) error

func (*DebugProtocol) WriteStructBegin

func (tdp *DebugProtocol) WriteStructBegin(name string) error

func (*DebugProtocol) WriteStructEnd

func (tdp *DebugProtocol) WriteStructEnd() error

type Deserializer

type Deserializer struct {
	Transport Transport
	Protocol  Format
}

func NewCompactDeserializer

func NewCompactDeserializer() *Deserializer

NewCompactDeserializer creates a new deserializer using the compact protocol

func NewDeserializer

func NewDeserializer() *Deserializer

func NewJSONDeserializer

func NewJSONDeserializer() *Deserializer

NewJSONDeserializer creates a new deserializer using the JSON protocol

func NewSimpleJSONDeserializer

func NewSimpleJSONDeserializer() *Deserializer

func (*Deserializer) Read

func (t *Deserializer) Read(msg Struct, b []byte) (err error)

func (*Deserializer) ReadString

func (t *Deserializer) ReadString(msg Struct, s string) (err error)

type DrainCompleteCode

type DrainCompleteCode int32
const (
	DrainCompleteCode_EXCEEDED_INGRESS_MEM_LIMIT DrainCompleteCode = 1
)

func (DrainCompleteCode) Ptr

func (DrainCompleteCode) String

func (x DrainCompleteCode) String() string

type DrainCompletePush

type DrainCompletePush struct {
	DrainCompleteCode *DrainCompleteCode `thrift:"drainCompleteCode,1,optional" json:"drainCompleteCode,omitempty" db:"drainCompleteCode"`
}

func NewDrainCompletePush

func NewDrainCompletePush() *DrainCompletePush

func (*DrainCompletePush) GetDrainCompleteCode

func (x *DrainCompletePush) GetDrainCompleteCode() DrainCompleteCode

func (*DrainCompletePush) GetDrainCompleteCodeNonCompat

func (x *DrainCompletePush) GetDrainCompleteCodeNonCompat() *DrainCompleteCode

func (*DrainCompletePush) IsSetDrainCompleteCode

func (x *DrainCompletePush) IsSetDrainCompleteCode() bool

func (*DrainCompletePush) Read

func (x *DrainCompletePush) Read(p Format) error

func (*DrainCompletePush) SetDrainCompleteCode

func (x *DrainCompletePush) SetDrainCompleteCode(value *DrainCompleteCode) *DrainCompletePush

func (*DrainCompletePush) SetDrainCompleteCodeNonCompat

func (x *DrainCompletePush) SetDrainCompleteCodeNonCompat(value DrainCompleteCode) *DrainCompletePush

func (*DrainCompletePush) String

func (x *DrainCompletePush) String() string

func (*DrainCompletePush) Write

func (x *DrainCompletePush) Write(p Format) error

type ErrorBlame

type ErrorBlame int32
const (
	ErrorBlame_UNSPECIFIED ErrorBlame = 0
	ErrorBlame_SERVER      ErrorBlame = 1
	ErrorBlame_CLIENT      ErrorBlame = 2
)

func (ErrorBlame) Ptr

func (x ErrorBlame) Ptr() *ErrorBlame

func (ErrorBlame) String

func (x ErrorBlame) String() string

type ErrorClassification

type ErrorClassification struct {
	Kind   *ErrorKind   `thrift:"kind,1,optional" json:"kind,omitempty" db:"kind"`
	Blame  *ErrorBlame  `thrift:"blame,2,optional" json:"blame,omitempty" db:"blame"`
	Safety *ErrorSafety `thrift:"safety,3,optional" json:"safety,omitempty" db:"safety"`
}

func NewErrorClassification

func NewErrorClassification() *ErrorClassification

func (*ErrorClassification) GetBlame

func (x *ErrorClassification) GetBlame() ErrorBlame

func (*ErrorClassification) GetBlameNonCompat

func (x *ErrorClassification) GetBlameNonCompat() *ErrorBlame

func (*ErrorClassification) GetKind

func (x *ErrorClassification) GetKind() ErrorKind

func (*ErrorClassification) GetKindNonCompat

func (x *ErrorClassification) GetKindNonCompat() *ErrorKind

func (*ErrorClassification) GetSafety

func (x *ErrorClassification) GetSafety() ErrorSafety

func (*ErrorClassification) GetSafetyNonCompat

func (x *ErrorClassification) GetSafetyNonCompat() *ErrorSafety

func (*ErrorClassification) IsSetBlame

func (x *ErrorClassification) IsSetBlame() bool

func (*ErrorClassification) IsSetKind

func (x *ErrorClassification) IsSetKind() bool

func (*ErrorClassification) IsSetSafety

func (x *ErrorClassification) IsSetSafety() bool

func (*ErrorClassification) Read

func (x *ErrorClassification) Read(p Format) error

func (*ErrorClassification) SetBlame

func (x *ErrorClassification) SetBlame(value *ErrorBlame) *ErrorClassification

func (*ErrorClassification) SetBlameNonCompat

func (x *ErrorClassification) SetBlameNonCompat(value ErrorBlame) *ErrorClassification

func (*ErrorClassification) SetKind

func (*ErrorClassification) SetKindNonCompat

func (x *ErrorClassification) SetKindNonCompat(value ErrorKind) *ErrorClassification

func (*ErrorClassification) SetSafety

func (x *ErrorClassification) SetSafety(value *ErrorSafety) *ErrorClassification

func (*ErrorClassification) SetSafetyNonCompat

func (x *ErrorClassification) SetSafetyNonCompat(value ErrorSafety) *ErrorClassification

func (*ErrorClassification) String

func (x *ErrorClassification) String() string

func (*ErrorClassification) Write

func (x *ErrorClassification) Write(p Format) error

type ErrorKind

type ErrorKind int32
const (
	ErrorKind_UNSPECIFIED ErrorKind = 0
	ErrorKind_TRANSIENT   ErrorKind = 1
	ErrorKind_STATEFUL    ErrorKind = 2
	ErrorKind_PERMANENT   ErrorKind = 3
)

func (ErrorKind) Ptr

func (x ErrorKind) Ptr() *ErrorKind

func (ErrorKind) String

func (x ErrorKind) String() string

type ErrorSafety

type ErrorSafety int32
const (
	ErrorSafety_UNSPECIFIED ErrorSafety = 0
	ErrorSafety_SAFE        ErrorSafety = 1
)

func (ErrorSafety) Ptr

func (x ErrorSafety) Ptr() *ErrorSafety

func (ErrorSafety) String

func (x ErrorSafety) String() string

type Exception

type Exception interface {
	error
}

Exception is a generic thrift exception

type FdMetadata

type FdMetadata struct {
	FdSeqNum *int64 `thrift:"fdSeqNum,1,optional" json:"fdSeqNum,omitempty" db:"fdSeqNum"`
	NumFds   *int32 `thrift:"numFds,2,optional" json:"numFds,omitempty" db:"numFds"`
}

func NewFdMetadata

func NewFdMetadata() *FdMetadata

func (*FdMetadata) GetFdSeqNum

func (x *FdMetadata) GetFdSeqNum() int64

func (*FdMetadata) GetFdSeqNumNonCompat

func (x *FdMetadata) GetFdSeqNumNonCompat() *int64

func (*FdMetadata) GetNumFds

func (x *FdMetadata) GetNumFds() int32

func (*FdMetadata) GetNumFdsNonCompat

func (x *FdMetadata) GetNumFdsNonCompat() *int32

func (*FdMetadata) IsSetFdSeqNum

func (x *FdMetadata) IsSetFdSeqNum() bool

func (*FdMetadata) IsSetNumFds

func (x *FdMetadata) IsSetNumFds() bool

func (*FdMetadata) Read

func (x *FdMetadata) Read(p Format) error

func (*FdMetadata) SetFdSeqNum

func (x *FdMetadata) SetFdSeqNum(value *int64) *FdMetadata

func (*FdMetadata) SetFdSeqNumNonCompat

func (x *FdMetadata) SetFdSeqNumNonCompat(value int64) *FdMetadata

func (*FdMetadata) SetNumFds

func (x *FdMetadata) SetNumFds(value *int32) *FdMetadata

func (*FdMetadata) SetNumFdsNonCompat

func (x *FdMetadata) SetNumFdsNonCompat(value int32) *FdMetadata

func (*FdMetadata) String

func (x *FdMetadata) String() string

func (*FdMetadata) Write

func (x *FdMetadata) Write(p Format) error

type Flusher

type Flusher interface {
	Flush() (err error)
}

Flusher is the interface that wraps the basic Flush method

type Format

type Format interface {
	WriteMessageBegin(name string, typeID MessageType, seqid int32) error
	WriteMessageEnd() error
	WriteStructBegin(name string) error
	WriteStructEnd() error
	WriteFieldBegin(name string, typeID Type, id int16) error
	WriteFieldEnd() error
	WriteFieldStop() error
	WriteMapBegin(keyType Type, valueType Type, size int) error
	WriteMapEnd() error
	WriteListBegin(elemType Type, size int) error
	WriteListEnd() error
	WriteSetBegin(elemType Type, size int) error
	WriteSetEnd() error
	WriteBool(value bool) error
	WriteByte(value byte) error
	WriteI16(value int16) error
	WriteI32(value int32) error
	WriteI64(value int64) error
	WriteDouble(value float64) error
	WriteFloat(value float32) error
	WriteString(value string) error
	WriteBinary(value []byte) error

	ReadMessageBegin() (name string, typeID MessageType, seqid int32, err error)
	ReadMessageEnd() error
	ReadStructBegin() (name string, err error)
	ReadStructEnd() error
	ReadFieldBegin() (name string, typeID Type, id int16, err error)
	ReadFieldEnd() error
	ReadMapBegin() (keyType Type, valueType Type, size int, err error)
	ReadMapEnd() error
	ReadListBegin() (elemType Type, size int, err error)
	ReadListEnd() error
	ReadSetBegin() (elemType Type, size int, err error)
	ReadSetEnd() error
	ReadBool() (value bool, err error)
	ReadByte() (value byte, err error)
	ReadI16() (value int16, err error)
	ReadI32() (value int32, err error)
	ReadI64() (value int64, err error)
	ReadDouble() (value float64, err error)
	ReadFloat() (value float32, err error)
	ReadString() (value string, err error)
	ReadBinary() (value []byte, err error)

	Skip(fieldType Type) (err error)
	Flush() (err error)
}

Format is the interface that must be implemented by all serialization formats.

type FramedTransport

type FramedTransport struct {
	// contains filtered or unexported fields
}

func NewFramedTransport

func NewFramedTransport(transport Transport) *FramedTransport

func NewFramedTransportMaxLength

func NewFramedTransportMaxLength(transport Transport, maxLength uint32) *FramedTransport

func (*FramedTransport) Close

func (p *FramedTransport) Close() error

func (*FramedTransport) Flush

func (p *FramedTransport) Flush() error

func (*FramedTransport) Read

func (p *FramedTransport) Read(buf []byte) (l int, err error)

func (*FramedTransport) ReadByte

func (p *FramedTransport) ReadByte() (c byte, err error)

func (*FramedTransport) RemainingBytes

func (p *FramedTransport) RemainingBytes() (num_bytes uint64)

func (*FramedTransport) Write

func (p *FramedTransport) Write(buf []byte) (int, error)

func (*FramedTransport) WriteByte

func (p *FramedTransport) WriteByte(c byte) error

func (*FramedTransport) WriteString

func (p *FramedTransport) WriteString(s string) (n int, err error)

type HTTPClient

type HTTPClient struct {
	// contains filtered or unexported fields
}

func (*HTTPClient) Close

func (p *HTTPClient) Close() error

func (*HTTPClient) DelHeader

func (p *HTTPClient) DelHeader(key string)

Deletes the HTTP Header given a Header Key for this specific Thrift Transport It is important that you first assert the Transport as a HTTPClient type like so:

httpTrans := trans.(HTTPClient) httpTrans.DelHeader("User-Agent")

func (*HTTPClient) Flush

func (p *HTTPClient) Flush() error

func (*HTTPClient) GetHeader

func (p *HTTPClient) GetHeader(key string) string

Get the HTTP Header represented by the supplied Header Key for this specific Thrift Transport It is important that you first assert the Transport as a HTTPClient type like so:

httpTrans := trans.(HTTPClient) hdrValue := httpTrans.GetHeader("User-Agent")

func (*HTTPClient) IsOpen

func (p *HTTPClient) IsOpen() bool

func (*HTTPClient) Open

func (p *HTTPClient) Open() error

func (*HTTPClient) Read

func (p *HTTPClient) Read(buf []byte) (int, error)

func (*HTTPClient) ReadByte

func (p *HTTPClient) ReadByte() (c byte, err error)

func (*HTTPClient) RemainingBytes

func (p *HTTPClient) RemainingBytes() (num_bytes uint64)

func (*HTTPClient) SetHeader

func (p *HTTPClient) SetHeader(key string, value string)

Set the HTTP Header for this specific Thrift Transport It is important that you first assert the Transport as a HTTPClient type like so:

httpTrans := trans.(HTTPClient) httpTrans.SetHeader("User-Agent","Thrift Client 1.0")

func (*HTTPClient) Write

func (p *HTTPClient) Write(buf []byte) (int, error)

func (*HTTPClient) WriteByte

func (p *HTTPClient) WriteByte(c byte) error

func (*HTTPClient) WriteString

func (p *HTTPClient) WriteString(s string) (n int, err error)

type HeaderFlags

type HeaderFlags uint16
const (
	HeaderFlagSupportOutOfOrder HeaderFlags = 0x01
	HeaderFlagDuplexReverse     HeaderFlags = 0x08
)

type HeaderProtocolFlags deprecated

type HeaderProtocolFlags interface {
	GetFlags() HeaderFlags
	SetFlags(flags HeaderFlags)
}

Deprecated: HeaderProtocolFlags is a deprecated type, temporarily introduced to ease transition to new API.

type HeaderProtocolIdentity deprecated

type HeaderProtocolIdentity interface {
	SetIdentity(identity string)
	Identity() string
}

Deprecated: HeaderProtocolIdentity is a deprecated type, temporarily introduced to ease transition to new API.

type HeaderProtocolProtocolID deprecated

type HeaderProtocolProtocolID interface {
	ProtocolID() ProtocolID
	SetProtocolID(protoID ProtocolID) error
}

Deprecated: HeaderProtocolProtocolID is a deprecated type, temporarily introduced to ease transition to new API.

type HeaderProtocolSeqID deprecated

type HeaderProtocolSeqID interface {
	GetSeqID() uint32
	SetSeqID(uint32)
}

Deprecated: HeaderProtocolSeqID is a deprecated type, temporarily introduced to ease transition to new API.

type HeadersPayloadContent

type HeadersPayloadContent struct {
	OtherMetadata map[string]String_4852 `thrift:"otherMetadata,1,optional" json:"otherMetadata,omitempty" db:"otherMetadata"`
}

func NewHeadersPayloadContent

func NewHeadersPayloadContent() *HeadersPayloadContent

func (*HeadersPayloadContent) GetOtherMetadata

func (x *HeadersPayloadContent) GetOtherMetadata() map[string]String_4852

func (*HeadersPayloadContent) GetOtherMetadataNonCompat

func (x *HeadersPayloadContent) GetOtherMetadataNonCompat() map[string]String_4852

func (*HeadersPayloadContent) IsSetOtherMetadata

func (x *HeadersPayloadContent) IsSetOtherMetadata() bool

func (*HeadersPayloadContent) Read

func (x *HeadersPayloadContent) Read(p Format) error

func (*HeadersPayloadContent) SetOtherMetadata

func (x *HeadersPayloadContent) SetOtherMetadata(value map[string]String_4852) *HeadersPayloadContent

func (*HeadersPayloadContent) SetOtherMetadataNonCompat

func (x *HeadersPayloadContent) SetOtherMetadataNonCompat(value map[string]String_4852) *HeadersPayloadContent

func (*HeadersPayloadContent) String

func (x *HeadersPayloadContent) String() string

func (*HeadersPayloadContent) Write

func (x *HeadersPayloadContent) Write(p Format) error

type HeadersPayloadMetadata

type HeadersPayloadMetadata struct {
	Compression *CompressionAlgorithm `thrift:"compression,1,optional" json:"compression,omitempty" db:"compression"`
}

func NewHeadersPayloadMetadata

func NewHeadersPayloadMetadata() *HeadersPayloadMetadata

func (*HeadersPayloadMetadata) GetCompression

func (x *HeadersPayloadMetadata) GetCompression() CompressionAlgorithm

func (*HeadersPayloadMetadata) GetCompressionNonCompat

func (x *HeadersPayloadMetadata) GetCompressionNonCompat() *CompressionAlgorithm

func (*HeadersPayloadMetadata) IsSetCompression

func (x *HeadersPayloadMetadata) IsSetCompression() bool

func (*HeadersPayloadMetadata) Read

func (x *HeadersPayloadMetadata) Read(p Format) error

func (*HeadersPayloadMetadata) SetCompression

func (*HeadersPayloadMetadata) SetCompressionNonCompat

func (x *HeadersPayloadMetadata) SetCompressionNonCompat(value CompressionAlgorithm) *HeadersPayloadMetadata

func (*HeadersPayloadMetadata) String

func (x *HeadersPayloadMetadata) String() string

func (*HeadersPayloadMetadata) Write

func (x *HeadersPayloadMetadata) Write(p Format) error

type IOBufPtr

type IOBufPtr = []byte

func NewIOBufPtr

func NewIOBufPtr() IOBufPtr

func ReadIOBufPtr

func ReadIOBufPtr(p Format) (IOBufPtr, error)

type IRequest

type IRequest interface {
	Write(p Format) error
}

IRequest represents a request to be sent to a thrift endpoint

type IResponse

type IResponse interface {
	Read(p Format) error
}

IResponse represents a response received from a thrift call

type Identity

type Identity struct {
	Type string
	Data string
}

Identity represents a secure peer identity

type InfoIDType

type InfoIDType uint32
const (
	InfoIDPadding   InfoIDType = 0
	InfoIDKeyValue  InfoIDType = 1
	InfoIDPKeyValue InfoIDType = 2
)

type InteractionCreate

type InteractionCreate struct {
	InteractionId   int64                  `thrift:"interactionId,1" json:"interactionId" db:"interactionId"`
	InteractionName ManagedStringViewField `thrift:"interactionName,2" json:"interactionName" db:"interactionName"`
}

func NewInteractionCreate

func NewInteractionCreate() *InteractionCreate

func (*InteractionCreate) GetInteractionId

func (x *InteractionCreate) GetInteractionId() int64

func (*InteractionCreate) GetInteractionIdNonCompat

func (x *InteractionCreate) GetInteractionIdNonCompat() int64

func (*InteractionCreate) GetInteractionName

func (x *InteractionCreate) GetInteractionName() ManagedStringViewField

func (*InteractionCreate) GetInteractionNameNonCompat

func (x *InteractionCreate) GetInteractionNameNonCompat() ManagedStringViewField

func (*InteractionCreate) Read

func (x *InteractionCreate) Read(p Format) error

func (*InteractionCreate) SetInteractionId

func (x *InteractionCreate) SetInteractionId(value int64) *InteractionCreate

func (*InteractionCreate) SetInteractionIdNonCompat

func (x *InteractionCreate) SetInteractionIdNonCompat(value int64) *InteractionCreate

func (*InteractionCreate) SetInteractionName

func (x *InteractionCreate) SetInteractionName(value ManagedStringViewField) *InteractionCreate

func (*InteractionCreate) SetInteractionNameNonCompat

func (x *InteractionCreate) SetInteractionNameNonCompat(value ManagedStringViewField) *InteractionCreate

func (*InteractionCreate) String

func (x *InteractionCreate) String() string

func (*InteractionCreate) Write

func (x *InteractionCreate) Write(p Format) error

type InteractionTerminate

type InteractionTerminate struct {
	InteractionId int64 `thrift:"interactionId,1" json:"interactionId" db:"interactionId"`
}

func NewInteractionTerminate

func NewInteractionTerminate() *InteractionTerminate

func (*InteractionTerminate) GetInteractionId

func (x *InteractionTerminate) GetInteractionId() int64

func (*InteractionTerminate) GetInteractionIdNonCompat

func (x *InteractionTerminate) GetInteractionIdNonCompat() int64

func (*InteractionTerminate) Read

func (x *InteractionTerminate) Read(p Format) error

func (*InteractionTerminate) SetInteractionId

func (x *InteractionTerminate) SetInteractionId(value int64) *InteractionTerminate

func (*InteractionTerminate) SetInteractionIdNonCompat

func (x *InteractionTerminate) SetInteractionIdNonCompat(value int64) *InteractionTerminate

func (*InteractionTerminate) String

func (x *InteractionTerminate) String() string

func (*InteractionTerminate) Write

func (x *InteractionTerminate) Write(p Format) error

type Interceptor

type Interceptor func(ctx context.Context, methodName string, pfunc ProcessorFunctionContext, args Struct) (WritableStruct, ApplicationException)

Interceptor is a function that runs before the actual method. It is passed the connection context, the method name and the args for that method. The interceptor is responsible for calling pfunc.RunContext() and it can return a result or an exception which are then sent back to the caller. The interceptor is expected to be concurrency safe.

type InterfaceKind

type InterfaceKind int32
const (
	InterfaceKind_USER       InterfaceKind = 0
	InterfaceKind_DEBUGGING  InterfaceKind = 1
	InterfaceKind_MONITORING InterfaceKind = 2
	InterfaceKind_PROFILING  InterfaceKind = 3
)

func (InterfaceKind) Ptr

func (x InterfaceKind) Ptr() *InterfaceKind

func (InterfaceKind) String

func (x InterfaceKind) String() string

type JSONProtocol

type JSONProtocol struct {
	*SimpleJSONProtocol
}

JSONProtocol is the Compact JSON protocol implementation for thrift.

This protocol produces/consumes a compact JSON output with field numbers as object keys and field values lightly encoded.

Example: With the Message definition

struct Message {
  1: bool aBool
  2: map<string, bool> aBoolStringMap
},

Message(aBool=True, aBoolStringMap={"key1": True, "key2": False})

will be encoded as:

{"1":{"tf":1},"2":{"map":["str","tf",2,{"key1": 1,"key2":0}]}}'

func NewJSONProtocol

func NewJSONProtocol(t Transport) *JSONProtocol

Constructor

func (*JSONProtocol) Close

func (p *JSONProtocol) Close() error

func (*JSONProtocol) Flush

func (p *JSONProtocol) Flush() (err error)

func (*JSONProtocol) OutputElemListBegin

func (p *JSONProtocol) OutputElemListBegin(elemType Type, size int) error

func (*JSONProtocol) ParseElemListBegin

func (p *JSONProtocol) ParseElemListBegin() (elemType Type, size int, e error)

func (*JSONProtocol) ReadBinary

func (p *JSONProtocol) ReadBinary() ([]byte, error)

func (*JSONProtocol) ReadBool

func (p *JSONProtocol) ReadBool() (bool, error)

func (*JSONProtocol) ReadByte

func (p *JSONProtocol) ReadByte() (byte, error)

func (*JSONProtocol) ReadDouble

func (p *JSONProtocol) ReadDouble() (float64, error)

func (*JSONProtocol) ReadFieldBegin

func (p *JSONProtocol) ReadFieldBegin() (string, Type, int16, error)

func (*JSONProtocol) ReadFieldEnd

func (p *JSONProtocol) ReadFieldEnd() error

func (*JSONProtocol) ReadFloat

func (p *JSONProtocol) ReadFloat() (float32, error)

func (*JSONProtocol) ReadI16

func (p *JSONProtocol) ReadI16() (int16, error)

func (*JSONProtocol) ReadI32

func (p *JSONProtocol) ReadI32() (int32, error)

func (*JSONProtocol) ReadI64

func (p *JSONProtocol) ReadI64() (int64, error)

func (*JSONProtocol) ReadListBegin

func (p *JSONProtocol) ReadListBegin() (elemType Type, size int, e error)

func (*JSONProtocol) ReadListEnd

func (p *JSONProtocol) ReadListEnd() error

func (*JSONProtocol) ReadMapBegin

func (p *JSONProtocol) ReadMapBegin() (keyType Type, valueType Type, size int, e error)

func (*JSONProtocol) ReadMapEnd

func (p *JSONProtocol) ReadMapEnd() error

func (*JSONProtocol) ReadMessageBegin

func (p *JSONProtocol) ReadMessageBegin() (name string, typeID MessageType, seqID int32, err error)

Reading methods.

func (*JSONProtocol) ReadMessageEnd

func (p *JSONProtocol) ReadMessageEnd() error

func (*JSONProtocol) ReadSetBegin

func (p *JSONProtocol) ReadSetBegin() (elemType Type, size int, e error)

func (*JSONProtocol) ReadSetEnd

func (p *JSONProtocol) ReadSetEnd() error

func (*JSONProtocol) ReadString

func (p *JSONProtocol) ReadString() (string, error)

func (*JSONProtocol) ReadStructBegin

func (p *JSONProtocol) ReadStructBegin() (name string, err error)

func (*JSONProtocol) ReadStructEnd

func (p *JSONProtocol) ReadStructEnd() error

func (*JSONProtocol) Skip

func (p *JSONProtocol) Skip(fieldType Type) (err error)

func (*JSONProtocol) StringToTypeId

func (p *JSONProtocol) StringToTypeId(fieldType string) (Type, error)

func (*JSONProtocol) TypeIdToString

func (p *JSONProtocol) TypeIdToString(fieldType Type) (string, error)

func (*JSONProtocol) WriteBinary

func (p *JSONProtocol) WriteBinary(v []byte) error

func (*JSONProtocol) WriteBool

func (p *JSONProtocol) WriteBool(b bool) error

func (*JSONProtocol) WriteByte

func (p *JSONProtocol) WriteByte(b byte) error

func (*JSONProtocol) WriteDouble

func (p *JSONProtocol) WriteDouble(v float64) error

func (*JSONProtocol) WriteFieldBegin

func (p *JSONProtocol) WriteFieldBegin(name string, typeID Type, id int16) error

func (*JSONProtocol) WriteFieldEnd

func (p *JSONProtocol) WriteFieldEnd() error

func (*JSONProtocol) WriteFieldStop

func (p *JSONProtocol) WriteFieldStop() error

func (*JSONProtocol) WriteFloat

func (p *JSONProtocol) WriteFloat(v float32) error

func (*JSONProtocol) WriteI16

func (p *JSONProtocol) WriteI16(v int16) error

func (*JSONProtocol) WriteI32

func (p *JSONProtocol) WriteI32(v int32) error

func (*JSONProtocol) WriteI64

func (p *JSONProtocol) WriteI64(v int64) error

func (*JSONProtocol) WriteListBegin

func (p *JSONProtocol) WriteListBegin(elemType Type, size int) error

func (*JSONProtocol) WriteListEnd

func (p *JSONProtocol) WriteListEnd() error

func (*JSONProtocol) WriteMapBegin

func (p *JSONProtocol) WriteMapBegin(keyType Type, valueType Type, size int) error

func (*JSONProtocol) WriteMapEnd

func (p *JSONProtocol) WriteMapEnd() error

func (*JSONProtocol) WriteMessageBegin

func (p *JSONProtocol) WriteMessageBegin(name string, typeID MessageType, seqID int32) error

func (*JSONProtocol) WriteMessageEnd

func (p *JSONProtocol) WriteMessageEnd() error

func (*JSONProtocol) WriteSetBegin

func (p *JSONProtocol) WriteSetBegin(elemType Type, size int) error

func (*JSONProtocol) WriteSetEnd

func (p *JSONProtocol) WriteSetEnd() error

func (*JSONProtocol) WriteString

func (p *JSONProtocol) WriteString(v string) error

func (*JSONProtocol) WriteStructBegin

func (p *JSONProtocol) WriteStructBegin(name string) error

func (*JSONProtocol) WriteStructEnd

func (p *JSONProtocol) WriteStructEnd() error

type LoggingContext

type LoggingContext struct {
	LogSampleRatio      int64   `thrift:"logSampleRatio,1" json:"logSampleRatio" db:"logSampleRatio"`
	LogErrorSampleRatio int64   `thrift:"logErrorSampleRatio,2" json:"logErrorSampleRatio" db:"logErrorSampleRatio"`
	RequestId           *string `thrift:"requestId,3,optional" json:"requestId,omitempty" db:"requestId"`
	RoutingTarget       *string `thrift:"routingTarget,4,optional" json:"routingTarget,omitempty" db:"routingTarget"`
}

func NewLoggingContext

func NewLoggingContext() *LoggingContext

func (*LoggingContext) GetLogErrorSampleRatio

func (x *LoggingContext) GetLogErrorSampleRatio() int64

func (*LoggingContext) GetLogErrorSampleRatioNonCompat

func (x *LoggingContext) GetLogErrorSampleRatioNonCompat() int64

func (*LoggingContext) GetLogSampleRatio

func (x *LoggingContext) GetLogSampleRatio() int64

func (*LoggingContext) GetLogSampleRatioNonCompat

func (x *LoggingContext) GetLogSampleRatioNonCompat() int64

func (*LoggingContext) GetRequestId

func (x *LoggingContext) GetRequestId() string

func (*LoggingContext) GetRequestIdNonCompat

func (x *LoggingContext) GetRequestIdNonCompat() *string

func (*LoggingContext) GetRoutingTarget

func (x *LoggingContext) GetRoutingTarget() string

func (*LoggingContext) GetRoutingTargetNonCompat

func (x *LoggingContext) GetRoutingTargetNonCompat() *string

func (*LoggingContext) IsSetRequestId

func (x *LoggingContext) IsSetRequestId() bool

func (*LoggingContext) IsSetRoutingTarget

func (x *LoggingContext) IsSetRoutingTarget() bool

func (*LoggingContext) Read

func (x *LoggingContext) Read(p Format) error

func (*LoggingContext) SetLogErrorSampleRatio

func (x *LoggingContext) SetLogErrorSampleRatio(value int64) *LoggingContext

func (*LoggingContext) SetLogErrorSampleRatioNonCompat

func (x *LoggingContext) SetLogErrorSampleRatioNonCompat(value int64) *LoggingContext

func (*LoggingContext) SetLogSampleRatio

func (x *LoggingContext) SetLogSampleRatio(value int64) *LoggingContext

func (*LoggingContext) SetLogSampleRatioNonCompat

func (x *LoggingContext) SetLogSampleRatioNonCompat(value int64) *LoggingContext

func (*LoggingContext) SetRequestId

func (x *LoggingContext) SetRequestId(value *string) *LoggingContext

func (*LoggingContext) SetRequestIdNonCompat

func (x *LoggingContext) SetRequestIdNonCompat(value string) *LoggingContext

func (*LoggingContext) SetRoutingTarget

func (x *LoggingContext) SetRoutingTarget(value *string) *LoggingContext

func (*LoggingContext) SetRoutingTargetNonCompat

func (x *LoggingContext) SetRoutingTargetNonCompat(value string) *LoggingContext

func (*LoggingContext) String

func (x *LoggingContext) String() string

func (*LoggingContext) Write

func (x *LoggingContext) Write(p Format) error

type ManagedStringViewField

type ManagedStringViewField = string

func NewManagedStringViewField

func NewManagedStringViewField() ManagedStringViewField

func ReadManagedStringViewField

func ReadManagedStringViewField(p Format) (ManagedStringViewField, error)

type MemoryBuffer

type MemoryBuffer struct {
	*bytes.Buffer
	// contains filtered or unexported fields
}

Memory buffer-based implementation of the Transport interface.

func NewMemoryBuffer

func NewMemoryBuffer() *MemoryBuffer

func NewMemoryBufferLen

func NewMemoryBufferLen(size int) *MemoryBuffer

func NewMemoryBufferWithData

func NewMemoryBufferWithData(data []byte) *MemoryBuffer

func (*MemoryBuffer) Close

func (p *MemoryBuffer) Close() error

func (*MemoryBuffer) Flush

func (p *MemoryBuffer) Flush() error

Flushing a memory buffer is a no-op

func (*MemoryBuffer) IsOpen

func (p *MemoryBuffer) IsOpen() bool

func (*MemoryBuffer) Open

func (p *MemoryBuffer) Open() error

func (*MemoryBuffer) RemainingBytes

func (p *MemoryBuffer) RemainingBytes() uint64

type MessageType

type MessageType int32

Message type constants in the Thrift protocol.

const (
	INVALID_MESSAGE_TYPE MessageType = 0
	CALL                 MessageType = 1
	REPLY                MessageType = 2
	EXCEPTION            MessageType = 3
	ONEWAY               MessageType = 4
)

type MultiplexedProcessor

type MultiplexedProcessor struct {
	Defaulprocessor Processor
	// contains filtered or unexported fields
}

func NewMultiplexedProcessor

func NewMultiplexedProcessor() *MultiplexedProcessor

func (*MultiplexedProcessor) GetProcessorFunction

func (t *MultiplexedProcessor) GetProcessorFunction(name string) (ProcessorFunction, error)

GetProcessorFunction implements the thrift.Processor interface. It parses the thrift function name to figure out which processor to route the request to and returns descriptive error messages to help clients diagnose errors.

func (*MultiplexedProcessor) RegisterDefault

func (t *MultiplexedProcessor) RegisterDefault(processor Processor)

func (*MultiplexedProcessor) RegisterProcessor

func (t *MultiplexedProcessor) RegisterProcessor(name string, processor Processor)

type MultiplexedProtocol

type MultiplexedProtocol struct {
	Protocol
	// contains filtered or unexported fields
}

func NewMultiplexedProtocol

func NewMultiplexedProtocol(protocol Protocol, serviceName string) *MultiplexedProtocol

func (*MultiplexedProtocol) WriteMessageBegin

func (t *MultiplexedProtocol) WriteMessageBegin(name string, typeID MessageType, seqid int32) error

type NegotiationParameters

type NegotiationParameters struct {
	CompressionAlgos *int64 `thrift:"compressionAlgos,1,optional" json:"compressionAlgos,omitempty" db:"compressionAlgos"`
	UseStopTLS       *bool  `thrift:"useStopTLS,2,optional" json:"useStopTLS,omitempty" db:"useStopTLS"`
}

func NewNegotiationParameters

func NewNegotiationParameters() *NegotiationParameters

func (*NegotiationParameters) GetCompressionAlgos

func (x *NegotiationParameters) GetCompressionAlgos() int64

func (*NegotiationParameters) GetCompressionAlgosNonCompat

func (x *NegotiationParameters) GetCompressionAlgosNonCompat() *int64

func (*NegotiationParameters) GetUseStopTLS

func (x *NegotiationParameters) GetUseStopTLS() bool

func (*NegotiationParameters) GetUseStopTLSNonCompat

func (x *NegotiationParameters) GetUseStopTLSNonCompat() *bool

func (*NegotiationParameters) IsSetCompressionAlgos

func (x *NegotiationParameters) IsSetCompressionAlgos() bool

func (*NegotiationParameters) IsSetUseStopTLS

func (x *NegotiationParameters) IsSetUseStopTLS() bool

func (*NegotiationParameters) Read

func (x *NegotiationParameters) Read(p Format) error

func (*NegotiationParameters) SetCompressionAlgos

func (x *NegotiationParameters) SetCompressionAlgos(value *int64) *NegotiationParameters

func (*NegotiationParameters) SetCompressionAlgosNonCompat

func (x *NegotiationParameters) SetCompressionAlgosNonCompat(value int64) *NegotiationParameters

func (*NegotiationParameters) SetUseStopTLS

func (x *NegotiationParameters) SetUseStopTLS(value *bool) *NegotiationParameters

func (*NegotiationParameters) SetUseStopTLSNonCompat

func (x *NegotiationParameters) SetUseStopTLSNonCompat(value bool) *NegotiationParameters

func (*NegotiationParameters) String

func (x *NegotiationParameters) String() string

func (*NegotiationParameters) Write

func (x *NegotiationParameters) Write(p Format) error

type Numeric

type Numeric interface {
	Int64() int64
	Int32() int32
	Int16() int16
	Byte() byte
	Int() int
	Float64() float64
	Float32() float32
	String() string
	// contains filtered or unexported methods
}
var (
	INFINITY          Numeric = &numeric{iValue: 0, dValue: math.Inf(1), sValue: "Infinity", isNil: false}
	NEGATIVE_INFINITY Numeric = &numeric{iValue: 0, dValue: math.Inf(-1), sValue: "-Infinity", isNil: false}
	NAN               Numeric = &numeric{iValue: 0, dValue: math.NaN(), sValue: "NaN", isNil: false}
	ZERO              Numeric = &numeric{iValue: 0, dValue: 0, sValue: "0", isNil: false}
	NUMERIC_NULL      Numeric = &numeric{iValue: 0, dValue: 0, sValue: "0", isNil: true}
)

func NewNullNumeric

func NewNullNumeric() Numeric

func NewNumericFromDouble

func NewNumericFromDouble(dValue float64) Numeric

func NewNumericFromFloat

func NewNumericFromFloat(dValue float32) Numeric

func NewNumericFromI32

func NewNumericFromI32(iValue int32) Numeric

func NewNumericFromI64

func NewNumericFromI64(iValue int64) Numeric

func NewNumericFromJSONString

func NewNumericFromJSONString(sValue string, isNull bool) Numeric

func NewNumericFromString

func NewNumericFromString(sValue string) Numeric

type PayloadAnyExceptionMetadata

type PayloadAnyExceptionMetadata struct {
}

func NewPayloadAnyExceptionMetadata

func NewPayloadAnyExceptionMetadata() *PayloadAnyExceptionMetadata

func (*PayloadAnyExceptionMetadata) Read

func (*PayloadAnyExceptionMetadata) String

func (x *PayloadAnyExceptionMetadata) String() string

func (*PayloadAnyExceptionMetadata) Write

type PayloadAppUnknownExceptionMetdata

type PayloadAppUnknownExceptionMetdata struct {
	ErrorClassification *ErrorClassification `thrift:"errorClassification,1,optional" json:"errorClassification,omitempty" db:"errorClassification"`
}

func NewPayloadAppUnknownExceptionMetdata

func NewPayloadAppUnknownExceptionMetdata() *PayloadAppUnknownExceptionMetdata

func (*PayloadAppUnknownExceptionMetdata) GetErrorClassification

func (x *PayloadAppUnknownExceptionMetdata) GetErrorClassification() *ErrorClassification

func (*PayloadAppUnknownExceptionMetdata) GetErrorClassificationNonCompat

func (x *PayloadAppUnknownExceptionMetdata) GetErrorClassificationNonCompat() *ErrorClassification

func (*PayloadAppUnknownExceptionMetdata) IsSetErrorClassification

func (x *PayloadAppUnknownExceptionMetdata) IsSetErrorClassification() bool

func (*PayloadAppUnknownExceptionMetdata) Read

func (*PayloadAppUnknownExceptionMetdata) SetErrorClassification

func (*PayloadAppUnknownExceptionMetdata) SetErrorClassificationNonCompat

func (*PayloadAppUnknownExceptionMetdata) String

func (*PayloadAppUnknownExceptionMetdata) Write

type PayloadDeclaredExceptionMetadata

type PayloadDeclaredExceptionMetadata struct {
	ErrorClassification *ErrorClassification `thrift:"errorClassification,1,optional" json:"errorClassification,omitempty" db:"errorClassification"`
}

func NewPayloadDeclaredExceptionMetadata

func NewPayloadDeclaredExceptionMetadata() *PayloadDeclaredExceptionMetadata

func (*PayloadDeclaredExceptionMetadata) GetErrorClassification

func (x *PayloadDeclaredExceptionMetadata) GetErrorClassification() *ErrorClassification

func (*PayloadDeclaredExceptionMetadata) GetErrorClassificationNonCompat

func (x *PayloadDeclaredExceptionMetadata) GetErrorClassificationNonCompat() *ErrorClassification

func (*PayloadDeclaredExceptionMetadata) IsSetErrorClassification

func (x *PayloadDeclaredExceptionMetadata) IsSetErrorClassification() bool

func (*PayloadDeclaredExceptionMetadata) Read

func (*PayloadDeclaredExceptionMetadata) SetErrorClassification

func (*PayloadDeclaredExceptionMetadata) SetErrorClassificationNonCompat

func (*PayloadDeclaredExceptionMetadata) String

func (*PayloadDeclaredExceptionMetadata) Write

type PayloadExceptionMetadata

type PayloadExceptionMetadata struct {
	DeclaredException        *PayloadDeclaredExceptionMetadata  `thrift:"declaredException,1" json:"declaredException,omitempty" db:"declaredException"`
	DEPRECATEDProxyException *PayloadProxyExceptionMetadata     `thrift:"DEPRECATED_proxyException,2" json:"DEPRECATED_proxyException,omitempty" db:"DEPRECATED_proxyException"`
	AppUnknownException      *PayloadAppUnknownExceptionMetdata `thrift:"appUnknownException,6" json:"appUnknownException,omitempty" db:"appUnknownException"`
	AnyException             *PayloadAnyExceptionMetadata       `thrift:"anyException,7" json:"anyException,omitempty" db:"anyException"`
}

func NewPayloadExceptionMetadata

func NewPayloadExceptionMetadata() *PayloadExceptionMetadata

func (*PayloadExceptionMetadata) CountSetFieldsPayloadExceptionMetadata

func (x *PayloadExceptionMetadata) CountSetFieldsPayloadExceptionMetadata() int

func (*PayloadExceptionMetadata) GetAnyException

func (*PayloadExceptionMetadata) GetAnyExceptionNonCompat

func (x *PayloadExceptionMetadata) GetAnyExceptionNonCompat() *PayloadAnyExceptionMetadata

func (*PayloadExceptionMetadata) GetAppUnknownException

func (x *PayloadExceptionMetadata) GetAppUnknownException() *PayloadAppUnknownExceptionMetdata

func (*PayloadExceptionMetadata) GetAppUnknownExceptionNonCompat

func (x *PayloadExceptionMetadata) GetAppUnknownExceptionNonCompat() *PayloadAppUnknownExceptionMetdata

func (*PayloadExceptionMetadata) GetDEPRECATEDProxyException

func (x *PayloadExceptionMetadata) GetDEPRECATEDProxyException() *PayloadProxyExceptionMetadata

func (*PayloadExceptionMetadata) GetDEPRECATEDProxyExceptionNonCompat

func (x *PayloadExceptionMetadata) GetDEPRECATEDProxyExceptionNonCompat() *PayloadProxyExceptionMetadata

func (*PayloadExceptionMetadata) GetDeclaredException

func (*PayloadExceptionMetadata) GetDeclaredExceptionNonCompat

func (x *PayloadExceptionMetadata) GetDeclaredExceptionNonCompat() *PayloadDeclaredExceptionMetadata

func (*PayloadExceptionMetadata) IsSetAnyException

func (x *PayloadExceptionMetadata) IsSetAnyException() bool

func (*PayloadExceptionMetadata) IsSetAppUnknownException

func (x *PayloadExceptionMetadata) IsSetAppUnknownException() bool

func (*PayloadExceptionMetadata) IsSetDEPRECATEDProxyException

func (x *PayloadExceptionMetadata) IsSetDEPRECATEDProxyException() bool

func (*PayloadExceptionMetadata) IsSetDeclaredException

func (x *PayloadExceptionMetadata) IsSetDeclaredException() bool

func (*PayloadExceptionMetadata) Read

func (*PayloadExceptionMetadata) SetAnyException

func (*PayloadExceptionMetadata) SetAnyExceptionNonCompat

func (*PayloadExceptionMetadata) SetAppUnknownException

func (*PayloadExceptionMetadata) SetAppUnknownExceptionNonCompat

func (x *PayloadExceptionMetadata) SetAppUnknownExceptionNonCompat(value PayloadAppUnknownExceptionMetdata) *PayloadExceptionMetadata

func (*PayloadExceptionMetadata) SetDEPRECATEDProxyException

func (*PayloadExceptionMetadata) SetDEPRECATEDProxyExceptionNonCompat

func (x *PayloadExceptionMetadata) SetDEPRECATEDProxyExceptionNonCompat(value PayloadProxyExceptionMetadata) *PayloadExceptionMetadata

func (*PayloadExceptionMetadata) SetDeclaredException

func (*PayloadExceptionMetadata) SetDeclaredExceptionNonCompat

func (*PayloadExceptionMetadata) String

func (x *PayloadExceptionMetadata) String() string

func (*PayloadExceptionMetadata) Write

type PayloadExceptionMetadataBase

type PayloadExceptionMetadataBase struct {
	NameUTF8 *string                   `thrift:"name_utf8,1,optional" json:"name_utf8,omitempty" db:"name_utf8"`
	WhatUTF8 *string                   `thrift:"what_utf8,2,optional" json:"what_utf8,omitempty" db:"what_utf8"`
	Metadata *PayloadExceptionMetadata `thrift:"metadata,3,optional" json:"metadata,omitempty" db:"metadata"`
}

func NewPayloadExceptionMetadataBase

func NewPayloadExceptionMetadataBase() *PayloadExceptionMetadataBase

func (*PayloadExceptionMetadataBase) GetMetadata

func (*PayloadExceptionMetadataBase) GetMetadataNonCompat

func (x *PayloadExceptionMetadataBase) GetMetadataNonCompat() *PayloadExceptionMetadata

func (*PayloadExceptionMetadataBase) GetNameUTF8

func (x *PayloadExceptionMetadataBase) GetNameUTF8() string

func (*PayloadExceptionMetadataBase) GetNameUTF8NonCompat

func (x *PayloadExceptionMetadataBase) GetNameUTF8NonCompat() *string

func (*PayloadExceptionMetadataBase) GetWhatUTF8

func (x *PayloadExceptionMetadataBase) GetWhatUTF8() string

func (*PayloadExceptionMetadataBase) GetWhatUTF8NonCompat

func (x *PayloadExceptionMetadataBase) GetWhatUTF8NonCompat() *string

func (*PayloadExceptionMetadataBase) IsSetMetadata

func (x *PayloadExceptionMetadataBase) IsSetMetadata() bool

func (*PayloadExceptionMetadataBase) IsSetNameUTF8

func (x *PayloadExceptionMetadataBase) IsSetNameUTF8() bool

func (*PayloadExceptionMetadataBase) IsSetWhatUTF8

func (x *PayloadExceptionMetadataBase) IsSetWhatUTF8() bool

func (*PayloadExceptionMetadataBase) Read

func (*PayloadExceptionMetadataBase) SetMetadata

func (*PayloadExceptionMetadataBase) SetMetadataNonCompat

func (*PayloadExceptionMetadataBase) SetNameUTF8

func (*PayloadExceptionMetadataBase) SetNameUTF8NonCompat

func (x *PayloadExceptionMetadataBase) SetNameUTF8NonCompat(value string) *PayloadExceptionMetadataBase

func (*PayloadExceptionMetadataBase) SetWhatUTF8

func (*PayloadExceptionMetadataBase) SetWhatUTF8NonCompat

func (x *PayloadExceptionMetadataBase) SetWhatUTF8NonCompat(value string) *PayloadExceptionMetadataBase

func (*PayloadExceptionMetadataBase) String

func (*PayloadExceptionMetadataBase) Write

type PayloadMetadata

type PayloadMetadata struct {
	ResponseMetadata  *PayloadResponseMetadata      `thrift:"responseMetadata,1" json:"responseMetadata,omitempty" db:"responseMetadata"`
	ExceptionMetadata *PayloadExceptionMetadataBase `thrift:"exceptionMetadata,2" json:"exceptionMetadata,omitempty" db:"exceptionMetadata"`
}

func NewPayloadMetadata

func NewPayloadMetadata() *PayloadMetadata

func (*PayloadMetadata) CountSetFieldsPayloadMetadata

func (x *PayloadMetadata) CountSetFieldsPayloadMetadata() int

func (*PayloadMetadata) GetExceptionMetadata

func (x *PayloadMetadata) GetExceptionMetadata() *PayloadExceptionMetadataBase

func (*PayloadMetadata) GetExceptionMetadataNonCompat

func (x *PayloadMetadata) GetExceptionMetadataNonCompat() *PayloadExceptionMetadataBase

func (*PayloadMetadata) GetResponseMetadata

func (x *PayloadMetadata) GetResponseMetadata() *PayloadResponseMetadata

func (*PayloadMetadata) GetResponseMetadataNonCompat

func (x *PayloadMetadata) GetResponseMetadataNonCompat() *PayloadResponseMetadata

func (*PayloadMetadata) IsSetExceptionMetadata

func (x *PayloadMetadata) IsSetExceptionMetadata() bool

func (*PayloadMetadata) IsSetResponseMetadata

func (x *PayloadMetadata) IsSetResponseMetadata() bool

func (*PayloadMetadata) Read

func (x *PayloadMetadata) Read(p Format) error

func (*PayloadMetadata) SetExceptionMetadata

func (x *PayloadMetadata) SetExceptionMetadata(value *PayloadExceptionMetadataBase) *PayloadMetadata

func (*PayloadMetadata) SetExceptionMetadataNonCompat

func (x *PayloadMetadata) SetExceptionMetadataNonCompat(value PayloadExceptionMetadataBase) *PayloadMetadata

func (*PayloadMetadata) SetResponseMetadata

func (x *PayloadMetadata) SetResponseMetadata(value *PayloadResponseMetadata) *PayloadMetadata

func (*PayloadMetadata) SetResponseMetadataNonCompat

func (x *PayloadMetadata) SetResponseMetadataNonCompat(value PayloadResponseMetadata) *PayloadMetadata

func (*PayloadMetadata) String

func (x *PayloadMetadata) String() string

func (*PayloadMetadata) Write

func (x *PayloadMetadata) Write(p Format) error

type PayloadProxiedExceptionMetadata

type PayloadProxiedExceptionMetadata struct {
}

func NewPayloadProxiedExceptionMetadata

func NewPayloadProxiedExceptionMetadata() *PayloadProxiedExceptionMetadata

func (*PayloadProxiedExceptionMetadata) Read

func (*PayloadProxiedExceptionMetadata) String

func (*PayloadProxiedExceptionMetadata) Write

type PayloadProxyExceptionMetadata

type PayloadProxyExceptionMetadata struct {
}

func NewPayloadProxyExceptionMetadata

func NewPayloadProxyExceptionMetadata() *PayloadProxyExceptionMetadata

func (*PayloadProxyExceptionMetadata) Read

func (*PayloadProxyExceptionMetadata) String

func (*PayloadProxyExceptionMetadata) Write

type PayloadResponseMetadata

type PayloadResponseMetadata struct {
}

func NewPayloadResponseMetadata

func NewPayloadResponseMetadata() *PayloadResponseMetadata

func (*PayloadResponseMetadata) Read

func (*PayloadResponseMetadata) String

func (x *PayloadResponseMetadata) String() string

func (*PayloadResponseMetadata) Write

func (x *PayloadResponseMetadata) Write(p Format) error

type PersistentHeaders

type PersistentHeaders interface {
	SetPersistentHeader(key, value string)
	GetPersistentHeader(key string) (string, bool)
	GetPersistentHeaders() map[string]string
	ClearPersistentHeaders()
}

PersistentHeaders is an interface that allows a transport to send headers as part of every request. This interface is implemented by some protocols, including HeaderProtocol, RocketProtocol and UpgradeToRocketProtocol.

type Priority

type Priority uint8

Priority maps to C++ apache::thrift::concurrency::PRIORITY

const (
	PriorityNone          Priority = 0
	PriorityHighImportant Priority = 1
	PriorityHigh          Priority = 2
	PriorityImportant     Priority = 3
	PriorityNormal        Priority = 4
	PriorityBestEffort    Priority = 5
	PriorityEnd           Priority = 6
)

Priority maps to C++ apache::thrift::concurrency::PRIORITY

type Processor

type Processor interface {
	// GetProcessorFunction is given the name of a thrift function and
	// the type of the inbound thrift message.  It is expected to return
	// a non-nil ProcessorFunction when the function can be successfully
	// found.
	//
	// If an error is returned, it will be wrapped in an application level
	// thrift exception and returned.
	//
	// If ProcessorFunction and error are both nil, a generic error will be
	// sent which explains that no processor function exists with the specified
	// name on this server.
	GetProcessorFunction(name string) (ProcessorFunction, error)
}

Processor exposes access to processor functions which manage I/O and processing of a input message for a specific server function

func WrapInterceptor

func WrapInterceptor(interceptor Interceptor, p Processor) Processor

WrapInterceptor wraps an interceptor around the Processor p such as when running the method returned by that processor it will execute the interceptor instead. The interceptor is executed with context.Background() as its context.

type ProcessorContext

type ProcessorContext interface {
	GetProcessorFunctionContext(name string) (ProcessorFunctionContext, error)
}

ProcessorContext is a Processor that supports contexts.

func NewProcessorContextAdapter

func NewProcessorContextAdapter(p Processor) ProcessorContext

NewProcessorContextAdapter creates a ProcessorContext from a regular Processor.

func WrapInterceptorContext

func WrapInterceptorContext(interceptor Interceptor, p ProcessorContext) ProcessorContext

WrapInterceptorContext wraps an interceptor around the ProcessorContext p such as when running the method returned by that processor it will execute the interceptor instead.

type ProcessorFunction

type ProcessorFunction interface {
	// Read a serializable message from the protocol.
	Read(prot Format) (Struct, Exception)
	// Process a message handing it to the client handler.
	Run(args Struct) (WritableStruct, ApplicationException)
	// Write a serializable responsne
	Write(seqID int32, result WritableStruct, prot Format) Exception
}

ProcessorFunction is the interface that must be implemented in order to perform io and message processing

type ProcessorFunctionContext

type ProcessorFunctionContext interface {
	Read(prot Format) (Struct, Exception)
	RunContext(ctx context.Context, args Struct) (WritableStruct, ApplicationException)
	Write(seqID int32, result WritableStruct, prot Format) Exception
}

ProcessorFunctionContext is a ProcessorFunction that supports contexts.

func NewProcessorFunctionContextAdapter

func NewProcessorFunctionContextAdapter(p ProcessorFunction) ProcessorFunctionContext

NewProcessorFunctionContextAdapter creates a ProcessorFunctionContext from a regular ProcessorFunction.

type Protocol

type Protocol interface {
	Format

	// used by SerialChannel and generated thrift Clients
	Close() error

	PersistentHeaders
	ResponseHeaderGetter

	// Deprecated
	RequestHeaders
}

Protocol defines the interface that must be implemented by all protocols

func NewHTTPProtocol

func NewHTTPProtocol(transport *HTTPClient, format Format) Protocol

NewHTTPProtocol creates a Protocol from a format that serializes directly to an HTTPClient.

func NewHeaderProtocol

func NewHeaderProtocol(trans Transport) Protocol

func NewRocketProtocol

func NewRocketProtocol(trans Transport) Protocol

NewRocketProtocol creates a RocketProtocol, given a RocketTransport

func NewUpgradeToRocketProtocol

func NewUpgradeToRocketProtocol(trans Transport) Protocol

NewUpgradeToRocketProtocol creates a protocol that upgrades from Header to Rocket protocol from a transport.

func NewUpgradeToRocketProtocols

func NewUpgradeToRocketProtocols(rocketProtocol, headerProtocol Protocol) Protocol

NewUpgradeToRocketProtocol creates a protocol that upgrades from Header to Rocket protocol given both protocols.

type ProtocolException

type ProtocolException interface {
	Exception
	TypeID() int
}

ProtocolException is the thrift protocol exception

func NewProtocolException

func NewProtocolException(err error) ProtocolException

NewProtocolException creates a new ProtocolException

func NewProtocolExceptionWithType

func NewProtocolExceptionWithType(errType int, err error) ProtocolException

NewProtocolExceptionWithType create a new ProtocolException with an error type

type ProtocolID

type ProtocolID int16
const (
	ProtocolIDBinary     ProtocolID = 0
	ProtocolIDJSON       ProtocolID = 1
	ProtocolIDCompact    ProtocolID = 2
	ProtocolIDDebug      ProtocolID = 3
	ProtocolIDVirtual    ProtocolID = 4
	ProtocolIDSimpleJSON ProtocolID = 5
)

func (ProtocolID) String

func (p ProtocolID) String() string

type ProtocolId

type ProtocolId int32
const (
	ProtocolId_BINARY  ProtocolId = 0
	ProtocolId_COMPACT ProtocolId = 2
)

func (ProtocolId) Ptr

func (x ProtocolId) Ptr() *ProtocolId

func (ProtocolId) String

func (x ProtocolId) String() string

type ProxiedPayloadMetadata

type ProxiedPayloadMetadata struct {
}

func NewProxiedPayloadMetadata

func NewProxiedPayloadMetadata() *ProxiedPayloadMetadata

func (*ProxiedPayloadMetadata) Read

func (x *ProxiedPayloadMetadata) Read(p Format) error

func (*ProxiedPayloadMetadata) String

func (x *ProxiedPayloadMetadata) String() string

func (*ProxiedPayloadMetadata) Write

func (x *ProxiedPayloadMetadata) Write(p Format) error

type QueueMetadata

type QueueMetadata struct {
	QueueingTimeMs int32  `thrift:"queueingTimeMs,1" json:"queueingTimeMs" db:"queueingTimeMs"`
	QueueTimeoutMs *int32 `thrift:"queueTimeoutMs,2,optional" json:"queueTimeoutMs,omitempty" db:"queueTimeoutMs"`
}

func NewQueueMetadata

func NewQueueMetadata() *QueueMetadata

func (*QueueMetadata) GetQueueTimeoutMs

func (x *QueueMetadata) GetQueueTimeoutMs() int32

func (*QueueMetadata) GetQueueTimeoutMsNonCompat

func (x *QueueMetadata) GetQueueTimeoutMsNonCompat() *int32

func (*QueueMetadata) GetQueueingTimeMs

func (x *QueueMetadata) GetQueueingTimeMs() int32

func (*QueueMetadata) GetQueueingTimeMsNonCompat

func (x *QueueMetadata) GetQueueingTimeMsNonCompat() int32

func (*QueueMetadata) IsSetQueueTimeoutMs

func (x *QueueMetadata) IsSetQueueTimeoutMs() bool

func (*QueueMetadata) Read

func (x *QueueMetadata) Read(p Format) error

func (*QueueMetadata) SetQueueTimeoutMs

func (x *QueueMetadata) SetQueueTimeoutMs(value *int32) *QueueMetadata

func (*QueueMetadata) SetQueueTimeoutMsNonCompat

func (x *QueueMetadata) SetQueueTimeoutMsNonCompat(value int32) *QueueMetadata

func (*QueueMetadata) SetQueueingTimeMs

func (x *QueueMetadata) SetQueueingTimeMs(value int32) *QueueMetadata

func (*QueueMetadata) SetQueueingTimeMsNonCompat

func (x *QueueMetadata) SetQueueingTimeMsNonCompat(value int32) *QueueMetadata

func (*QueueMetadata) String

func (x *QueueMetadata) String() string

func (*QueueMetadata) Write

func (x *QueueMetadata) Write(p Format) error

type RPCOptions

type RPCOptions struct {
	Timeout            time.Duration
	ChunkTimeout       time.Duration
	QueueTimeout       time.Duration
	OverallTimeout     time.Duration
	ProcessingTimeout  time.Duration
	Priority           Priority
	ClientOnlyTimeouts bool
	InteractionID      int64
	// contains filtered or unexported fields
}

RPCOptions is a mirror of C++ apache::thrift::RPCOptions Not all options are guaranteed to be implemented by a client

func GetRPCOptions

func GetRPCOptions(ctx context.Context) *RPCOptions

GetRPCOptions returns the RPCOptions in a go context, or nil if there is nothing

func (*RPCOptions) GetReadHeader

func (c *RPCOptions) GetReadHeader(k string) (string, bool)

func (*RPCOptions) GetWriteHeader

func (c *RPCOptions) GetWriteHeader(k string) (string, bool)

func (*RPCOptions) ReadHeaders

func (c *RPCOptions) ReadHeaders() map[string]string

func (*RPCOptions) SetReadHeader

func (c *RPCOptions) SetReadHeader(k, v string)

func (*RPCOptions) SetReadHeaders

func (c *RPCOptions) SetReadHeaders(headers map[string]string)

func (*RPCOptions) SetWriteHeader

func (c *RPCOptions) SetWriteHeader(k, v string)

func (*RPCOptions) SetWriteHeaders

func (c *RPCOptions) SetWriteHeaders(headers map[string]string)

func (*RPCOptions) WriteHeaders

func (c *RPCOptions) WriteHeaders() map[string]string

type ReadSizeProvider

type ReadSizeProvider interface {
	RemainingBytes() (numBytes uint64)
}

ReadSizeProvider is the interface that wraps the basic RemainingBytes method

type RequestChannel

type RequestChannel interface {
	ClientInterface

	Call(ctx context.Context, method string, request IRequest, response IResponse) error
	Oneway(ctx context.Context, method string, request IRequest) error
}

RequestChannel is an API that implements the most minimal surface for generated client code. An implementation:

  • Must be thread-safe
  • May implement request pipelining
  • May implement reconnection logic
  • May implement connection pooling
  • Hides implementation details of the protocol and transport.

type RequestContext

type RequestContext struct {
	RequestTimeout time.Duration
	Method         string
	SequenceID     int32
	InteractionID  int64
	Priority       Priority

	LocalAddress     net.Addr
	PeerAddress      net.Addr
	SecurityProtocol string
	PeerIdentities   []Identity
	PeerCommonName   string
	// contains filtered or unexported fields
}

RequestContext is a mirror of C++ apache::thrift::RPCOptions Not all options are guaranteed to be implemented by a client

func GetRequestContext

func GetRequestContext(ctx context.Context) *RequestContext

GetRequestContext returns the RequestContext in a go context, or nil if there is nothing

func (*RequestContext) GetReadHeader

func (c *RequestContext) GetReadHeader(k string) (string, bool)

func (*RequestContext) GetWriteHeader

func (c *RequestContext) GetWriteHeader(k string) (string, bool)

func (*RequestContext) ReadHeaders

func (c *RequestContext) ReadHeaders() map[string]string

func (*RequestContext) SetReadHeader

func (c *RequestContext) SetReadHeader(k, v string)

func (*RequestContext) SetReadHeaders

func (c *RequestContext) SetReadHeaders(headers map[string]string)

func (*RequestContext) SetWriteHeader

func (c *RequestContext) SetWriteHeader(k, v string)

func (*RequestContext) SetWriteHeaders

func (c *RequestContext) SetWriteHeaders(headers map[string]string)

func (*RequestContext) WriteHeaders

func (c *RequestContext) WriteHeaders() map[string]string

type RequestHeaders deprecated

type RequestHeaders interface {
	SetRequestHeader(key, value string)
	GetRequestHeader(key string) (value string, ok bool)
	GetRequestHeaders() map[string]string
}

Deprecated: RequestHeaders will eventually be private.

type RequestRpcMetadata

type RequestRpcMetadata struct {
	Protocol          *ProtocolId             `thrift:"protocol,1,optional" json:"protocol,omitempty" db:"protocol"`
	Name              *ManagedStringViewField `thrift:"name,2,optional" json:"name,omitempty" db:"name"`
	Kind              *RpcKind                `thrift:"kind,3,optional" json:"kind,omitempty" db:"kind"`
	ClientTimeoutMs   *int32                  `thrift:"clientTimeoutMs,5,optional" json:"clientTimeoutMs,omitempty" db:"clientTimeoutMs"`
	QueueTimeoutMs    *int32                  `thrift:"queueTimeoutMs,6,optional" json:"queueTimeoutMs,omitempty" db:"queueTimeoutMs"`
	Priority          *RpcPriority            `thrift:"priority,7,optional" json:"priority,omitempty" db:"priority"`
	OtherMetadata     map[string]string       `thrift:"otherMetadata,8,optional" json:"otherMetadata,omitempty" db:"otherMetadata"`
	Crc32c            *int32                  `thrift:"crc32c,11,optional" json:"crc32c,omitempty" db:"crc32c"`
	LoadMetric        *string                 `thrift:"loadMetric,13,optional" json:"loadMetric,omitempty" db:"loadMetric"`
	Compression       *CompressionAlgorithm   `thrift:"compression,14,optional" json:"compression,omitempty" db:"compression"`
	CompressionConfig *CompressionConfig      `thrift:"compressionConfig,15,optional" json:"compressionConfig,omitempty" db:"compressionConfig"`
	InteractionId     *int64                  `thrift:"interactionId,16,optional" json:"interactionId,omitempty" db:"interactionId"`
	InteractionCreate *InteractionCreate      `thrift:"interactionCreate,17,optional" json:"interactionCreate,omitempty" db:"interactionCreate"`
	ClientId          *string                 `thrift:"clientId,18,optional" json:"clientId,omitempty" db:"clientId"`
	ServiceTraceMeta  *string                 `thrift:"serviceTraceMeta,19,optional" json:"serviceTraceMeta,omitempty" db:"serviceTraceMeta"`
	FrameworkMetadata IOBufPtr                `thrift:"frameworkMetadata,20,optional" json:"frameworkMetadata,omitempty" db:"frameworkMetadata"`
	FdMetadata        *FdMetadata             `thrift:"fdMetadata,22,optional" json:"fdMetadata,omitempty" db:"fdMetadata"`
	LoggingContext    *LoggingContext         `thrift:"loggingContext,23,optional" json:"loggingContext,omitempty" db:"loggingContext"`
	TenantId          *string                 `thrift:"tenantId,24,optional" json:"tenantId,omitempty" db:"tenantId"`
}

func NewRequestRpcMetadata

func NewRequestRpcMetadata() *RequestRpcMetadata

func (*RequestRpcMetadata) GetClientId

func (x *RequestRpcMetadata) GetClientId() string

func (*RequestRpcMetadata) GetClientIdNonCompat

func (x *RequestRpcMetadata) GetClientIdNonCompat() *string

func (*RequestRpcMetadata) GetClientTimeoutMs

func (x *RequestRpcMetadata) GetClientTimeoutMs() int32

func (*RequestRpcMetadata) GetClientTimeoutMsNonCompat

func (x *RequestRpcMetadata) GetClientTimeoutMsNonCompat() *int32

func (*RequestRpcMetadata) GetCompression

func (x *RequestRpcMetadata) GetCompression() CompressionAlgorithm

func (*RequestRpcMetadata) GetCompressionConfig

func (x *RequestRpcMetadata) GetCompressionConfig() *CompressionConfig

func (*RequestRpcMetadata) GetCompressionConfigNonCompat

func (x *RequestRpcMetadata) GetCompressionConfigNonCompat() *CompressionConfig

func (*RequestRpcMetadata) GetCompressionNonCompat

func (x *RequestRpcMetadata) GetCompressionNonCompat() *CompressionAlgorithm

func (*RequestRpcMetadata) GetCrc32c

func (x *RequestRpcMetadata) GetCrc32c() int32

func (*RequestRpcMetadata) GetCrc32cNonCompat

func (x *RequestRpcMetadata) GetCrc32cNonCompat() *int32

func (*RequestRpcMetadata) GetFdMetadata

func (x *RequestRpcMetadata) GetFdMetadata() *FdMetadata

func (*RequestRpcMetadata) GetFdMetadataNonCompat

func (x *RequestRpcMetadata) GetFdMetadataNonCompat() *FdMetadata

func (*RequestRpcMetadata) GetFrameworkMetadata

func (x *RequestRpcMetadata) GetFrameworkMetadata() IOBufPtr

func (*RequestRpcMetadata) GetFrameworkMetadataNonCompat

func (x *RequestRpcMetadata) GetFrameworkMetadataNonCompat() IOBufPtr

func (*RequestRpcMetadata) GetInteractionCreate

func (x *RequestRpcMetadata) GetInteractionCreate() *InteractionCreate

func (*RequestRpcMetadata) GetInteractionCreateNonCompat

func (x *RequestRpcMetadata) GetInteractionCreateNonCompat() *InteractionCreate

func (*RequestRpcMetadata) GetInteractionId

func (x *RequestRpcMetadata) GetInteractionId() int64

func (*RequestRpcMetadata) GetInteractionIdNonCompat

func (x *RequestRpcMetadata) GetInteractionIdNonCompat() *int64

func (*RequestRpcMetadata) GetKind

func (x *RequestRpcMetadata) GetKind() RpcKind

func (*RequestRpcMetadata) GetKindNonCompat

func (x *RequestRpcMetadata) GetKindNonCompat() *RpcKind

func (*RequestRpcMetadata) GetLoadMetric

func (x *RequestRpcMetadata) GetLoadMetric() string

func (*RequestRpcMetadata) GetLoadMetricNonCompat

func (x *RequestRpcMetadata) GetLoadMetricNonCompat() *string

func (*RequestRpcMetadata) GetLoggingContext

func (x *RequestRpcMetadata) GetLoggingContext() *LoggingContext

func (*RequestRpcMetadata) GetLoggingContextNonCompat

func (x *RequestRpcMetadata) GetLoggingContextNonCompat() *LoggingContext

func (*RequestRpcMetadata) GetName

func (*RequestRpcMetadata) GetNameNonCompat

func (x *RequestRpcMetadata) GetNameNonCompat() *ManagedStringViewField

func (*RequestRpcMetadata) GetOtherMetadata

func (x *RequestRpcMetadata) GetOtherMetadata() map[string]string

func (*RequestRpcMetadata) GetOtherMetadataNonCompat

func (x *RequestRpcMetadata) GetOtherMetadataNonCompat() map[string]string

func (*RequestRpcMetadata) GetPriority

func (x *RequestRpcMetadata) GetPriority() RpcPriority

func (*RequestRpcMetadata) GetPriorityNonCompat

func (x *RequestRpcMetadata) GetPriorityNonCompat() *RpcPriority

func (*RequestRpcMetadata) GetProtocol

func (x *RequestRpcMetadata) GetProtocol() ProtocolId

func (*RequestRpcMetadata) GetProtocolNonCompat

func (x *RequestRpcMetadata) GetProtocolNonCompat() *ProtocolId

func (*RequestRpcMetadata) GetQueueTimeoutMs

func (x *RequestRpcMetadata) GetQueueTimeoutMs() int32

func (*RequestRpcMetadata) GetQueueTimeoutMsNonCompat

func (x *RequestRpcMetadata) GetQueueTimeoutMsNonCompat() *int32

func (*RequestRpcMetadata) GetServiceTraceMeta

func (x *RequestRpcMetadata) GetServiceTraceMeta() string

func (*RequestRpcMetadata) GetServiceTraceMetaNonCompat

func (x *RequestRpcMetadata) GetServiceTraceMetaNonCompat() *string

func (*RequestRpcMetadata) GetTenantId

func (x *RequestRpcMetadata) GetTenantId() string

func (*RequestRpcMetadata) GetTenantIdNonCompat

func (x *RequestRpcMetadata) GetTenantIdNonCompat() *string

func (*RequestRpcMetadata) IsSetClientId

func (x *RequestRpcMetadata) IsSetClientId() bool

func (*RequestRpcMetadata) IsSetClientTimeoutMs

func (x *RequestRpcMetadata) IsSetClientTimeoutMs() bool

func (*RequestRpcMetadata) IsSetCompression

func (x *RequestRpcMetadata) IsSetCompression() bool

func (*RequestRpcMetadata) IsSetCompressionConfig

func (x *RequestRpcMetadata) IsSetCompressionConfig() bool

func (*RequestRpcMetadata) IsSetCrc32c

func (x *RequestRpcMetadata) IsSetCrc32c() bool

func (*RequestRpcMetadata) IsSetFdMetadata

func (x *RequestRpcMetadata) IsSetFdMetadata() bool

func (*RequestRpcMetadata) IsSetFrameworkMetadata

func (x *RequestRpcMetadata) IsSetFrameworkMetadata() bool

func (*RequestRpcMetadata) IsSetInteractionCreate

func (x *RequestRpcMetadata) IsSetInteractionCreate() bool

func (*RequestRpcMetadata) IsSetInteractionId

func (x *RequestRpcMetadata) IsSetInteractionId() bool

func (*RequestRpcMetadata) IsSetKind

func (x *RequestRpcMetadata) IsSetKind() bool

func (*RequestRpcMetadata) IsSetLoadMetric

func (x *RequestRpcMetadata) IsSetLoadMetric() bool

func (*RequestRpcMetadata) IsSetLoggingContext

func (x *RequestRpcMetadata) IsSetLoggingContext() bool

func (*RequestRpcMetadata) IsSetName

func (x *RequestRpcMetadata) IsSetName() bool

func (*RequestRpcMetadata) IsSetOtherMetadata

func (x *RequestRpcMetadata) IsSetOtherMetadata() bool

func (*RequestRpcMetadata) IsSetPriority

func (x *RequestRpcMetadata) IsSetPriority() bool

func (*RequestRpcMetadata) IsSetProtocol

func (x *RequestRpcMetadata) IsSetProtocol() bool

func (*RequestRpcMetadata) IsSetQueueTimeoutMs

func (x *RequestRpcMetadata) IsSetQueueTimeoutMs() bool

func (*RequestRpcMetadata) IsSetServiceTraceMeta

func (x *RequestRpcMetadata) IsSetServiceTraceMeta() bool

func (*RequestRpcMetadata) IsSetTenantId

func (x *RequestRpcMetadata) IsSetTenantId() bool

func (*RequestRpcMetadata) Read

func (x *RequestRpcMetadata) Read(p Format) error

func (*RequestRpcMetadata) SetClientId

func (x *RequestRpcMetadata) SetClientId(value *string) *RequestRpcMetadata

func (*RequestRpcMetadata) SetClientIdNonCompat

func (x *RequestRpcMetadata) SetClientIdNonCompat(value string) *RequestRpcMetadata

func (*RequestRpcMetadata) SetClientTimeoutMs

func (x *RequestRpcMetadata) SetClientTimeoutMs(value *int32) *RequestRpcMetadata

func (*RequestRpcMetadata) SetClientTimeoutMsNonCompat

func (x *RequestRpcMetadata) SetClientTimeoutMsNonCompat(value int32) *RequestRpcMetadata

func (*RequestRpcMetadata) SetCompression

func (x *RequestRpcMetadata) SetCompression(value *CompressionAlgorithm) *RequestRpcMetadata

func (*RequestRpcMetadata) SetCompressionConfig

func (x *RequestRpcMetadata) SetCompressionConfig(value *CompressionConfig) *RequestRpcMetadata

func (*RequestRpcMetadata) SetCompressionConfigNonCompat

func (x *RequestRpcMetadata) SetCompressionConfigNonCompat(value CompressionConfig) *RequestRpcMetadata

func (*RequestRpcMetadata) SetCompressionNonCompat

func (x *RequestRpcMetadata) SetCompressionNonCompat(value CompressionAlgorithm) *RequestRpcMetadata

func (*RequestRpcMetadata) SetCrc32c

func (x *RequestRpcMetadata) SetCrc32c(value *int32) *RequestRpcMetadata

func (*RequestRpcMetadata) SetCrc32cNonCompat

func (x *RequestRpcMetadata) SetCrc32cNonCompat(value int32) *RequestRpcMetadata

func (*RequestRpcMetadata) SetFdMetadata

func (x *RequestRpcMetadata) SetFdMetadata(value *FdMetadata) *RequestRpcMetadata

func (*RequestRpcMetadata) SetFdMetadataNonCompat

func (x *RequestRpcMetadata) SetFdMetadataNonCompat(value FdMetadata) *RequestRpcMetadata

func (*RequestRpcMetadata) SetFrameworkMetadata

func (x *RequestRpcMetadata) SetFrameworkMetadata(value IOBufPtr) *RequestRpcMetadata

func (*RequestRpcMetadata) SetFrameworkMetadataNonCompat

func (x *RequestRpcMetadata) SetFrameworkMetadataNonCompat(value IOBufPtr) *RequestRpcMetadata

func (*RequestRpcMetadata) SetInteractionCreate

func (x *RequestRpcMetadata) SetInteractionCreate(value *InteractionCreate) *RequestRpcMetadata

func (*RequestRpcMetadata) SetInteractionCreateNonCompat

func (x *RequestRpcMetadata) SetInteractionCreateNonCompat(value InteractionCreate) *RequestRpcMetadata

func (*RequestRpcMetadata) SetInteractionId

func (x *RequestRpcMetadata) SetInteractionId(value *int64) *RequestRpcMetadata

func (*RequestRpcMetadata) SetInteractionIdNonCompat

func (x *RequestRpcMetadata) SetInteractionIdNonCompat(value int64) *RequestRpcMetadata

func (*RequestRpcMetadata) SetKind

func (x *RequestRpcMetadata) SetKind(value *RpcKind) *RequestRpcMetadata

func (*RequestRpcMetadata) SetKindNonCompat

func (x *RequestRpcMetadata) SetKindNonCompat(value RpcKind) *RequestRpcMetadata

func (*RequestRpcMetadata) SetLoadMetric

func (x *RequestRpcMetadata) SetLoadMetric(value *string) *RequestRpcMetadata

func (*RequestRpcMetadata) SetLoadMetricNonCompat

func (x *RequestRpcMetadata) SetLoadMetricNonCompat(value string) *RequestRpcMetadata

func (*RequestRpcMetadata) SetLoggingContext

func (x *RequestRpcMetadata) SetLoggingContext(value *LoggingContext) *RequestRpcMetadata

func (*RequestRpcMetadata) SetLoggingContextNonCompat

func (x *RequestRpcMetadata) SetLoggingContextNonCompat(value LoggingContext) *RequestRpcMetadata

func (*RequestRpcMetadata) SetName

func (*RequestRpcMetadata) SetNameNonCompat

func (x *RequestRpcMetadata) SetNameNonCompat(value ManagedStringViewField) *RequestRpcMetadata

func (*RequestRpcMetadata) SetOtherMetadata

func (x *RequestRpcMetadata) SetOtherMetadata(value map[string]string) *RequestRpcMetadata

func (*RequestRpcMetadata) SetOtherMetadataNonCompat

func (x *RequestRpcMetadata) SetOtherMetadataNonCompat(value map[string]string) *RequestRpcMetadata

func (*RequestRpcMetadata) SetPriority

func (x *RequestRpcMetadata) SetPriority(value *RpcPriority) *RequestRpcMetadata

func (*RequestRpcMetadata) SetPriorityNonCompat

func (x *RequestRpcMetadata) SetPriorityNonCompat(value RpcPriority) *RequestRpcMetadata

func (*RequestRpcMetadata) SetProtocol

func (x *RequestRpcMetadata) SetProtocol(value *ProtocolId) *RequestRpcMetadata

func (*RequestRpcMetadata) SetProtocolNonCompat

func (x *RequestRpcMetadata) SetProtocolNonCompat(value ProtocolId) *RequestRpcMetadata

func (*RequestRpcMetadata) SetQueueTimeoutMs

func (x *RequestRpcMetadata) SetQueueTimeoutMs(value *int32) *RequestRpcMetadata

func (*RequestRpcMetadata) SetQueueTimeoutMsNonCompat

func (x *RequestRpcMetadata) SetQueueTimeoutMsNonCompat(value int32) *RequestRpcMetadata

func (*RequestRpcMetadata) SetServiceTraceMeta

func (x *RequestRpcMetadata) SetServiceTraceMeta(value *string) *RequestRpcMetadata

func (*RequestRpcMetadata) SetServiceTraceMetaNonCompat

func (x *RequestRpcMetadata) SetServiceTraceMetaNonCompat(value string) *RequestRpcMetadata

func (*RequestRpcMetadata) SetTenantId

func (x *RequestRpcMetadata) SetTenantId(value *string) *RequestRpcMetadata

func (*RequestRpcMetadata) SetTenantIdNonCompat

func (x *RequestRpcMetadata) SetTenantIdNonCompat(value string) *RequestRpcMetadata

func (*RequestRpcMetadata) String

func (x *RequestRpcMetadata) String() string

func (*RequestRpcMetadata) Write

func (x *RequestRpcMetadata) Write(p Format) error

type RequestSetupMetadata

type RequestSetupMetadata struct {
	Opaque         map[string][]byte     `thrift:"opaque,1,optional" json:"opaque,omitempty" db:"opaque"`
	InterfaceKind  *InterfaceKind        `thrift:"interfaceKind,2,optional" json:"interfaceKind,omitempty" db:"interfaceKind"`
	MinVersion     *int32                `thrift:"minVersion,3,optional" json:"minVersion,omitempty" db:"minVersion"`
	MaxVersion     *int32                `thrift:"maxVersion,4,optional" json:"maxVersion,omitempty" db:"maxVersion"`
	DscpToReflect  *int32                `thrift:"dscpToReflect,5,optional" json:"dscpToReflect,omitempty" db:"dscpToReflect"`
	MarkToReflect  *int32                `thrift:"markToReflect,6,optional" json:"markToReflect,omitempty" db:"markToReflect"`
	ClientMetadata *RocketClientMetadata `thrift:"clientMetadata,9,optional" json:"clientMetadata,omitempty" db:"clientMetadata"`
	QosUseCaseId   *int32                `thrift:"qosUseCaseId,10,optional" json:"qosUseCaseId,omitempty" db:"qosUseCaseId"`
	QosPolicyId    *int32                `thrift:"qosPolicyId,11,optional" json:"qosPolicyId,omitempty" db:"qosPolicyId"`
}

func NewRequestSetupMetadata

func NewRequestSetupMetadata() *RequestSetupMetadata

func (*RequestSetupMetadata) GetClientMetadata

func (x *RequestSetupMetadata) GetClientMetadata() *RocketClientMetadata

func (*RequestSetupMetadata) GetClientMetadataNonCompat

func (x *RequestSetupMetadata) GetClientMetadataNonCompat() *RocketClientMetadata

func (*RequestSetupMetadata) GetDscpToReflect

func (x *RequestSetupMetadata) GetDscpToReflect() int32

func (*RequestSetupMetadata) GetDscpToReflectNonCompat

func (x *RequestSetupMetadata) GetDscpToReflectNonCompat() *int32

func (*RequestSetupMetadata) GetInterfaceKind

func (x *RequestSetupMetadata) GetInterfaceKind() InterfaceKind

func (*RequestSetupMetadata) GetInterfaceKindNonCompat

func (x *RequestSetupMetadata) GetInterfaceKindNonCompat() *InterfaceKind

func (*RequestSetupMetadata) GetMarkToReflect

func (x *RequestSetupMetadata) GetMarkToReflect() int32

func (*RequestSetupMetadata) GetMarkToReflectNonCompat

func (x *RequestSetupMetadata) GetMarkToReflectNonCompat() *int32

func (*RequestSetupMetadata) GetMaxVersion

func (x *RequestSetupMetadata) GetMaxVersion() int32

func (*RequestSetupMetadata) GetMaxVersionNonCompat

func (x *RequestSetupMetadata) GetMaxVersionNonCompat() *int32

func (*RequestSetupMetadata) GetMinVersion

func (x *RequestSetupMetadata) GetMinVersion() int32

func (*RequestSetupMetadata) GetMinVersionNonCompat

func (x *RequestSetupMetadata) GetMinVersionNonCompat() *int32

func (*RequestSetupMetadata) GetOpaque

func (x *RequestSetupMetadata) GetOpaque() map[string][]byte

func (*RequestSetupMetadata) GetOpaqueNonCompat

func (x *RequestSetupMetadata) GetOpaqueNonCompat() map[string][]byte

func (*RequestSetupMetadata) GetQosPolicyId

func (x *RequestSetupMetadata) GetQosPolicyId() int32

func (*RequestSetupMetadata) GetQosPolicyIdNonCompat

func (x *RequestSetupMetadata) GetQosPolicyIdNonCompat() *int32

func (*RequestSetupMetadata) GetQosUseCaseId

func (x *RequestSetupMetadata) GetQosUseCaseId() int32

func (*RequestSetupMetadata) GetQosUseCaseIdNonCompat

func (x *RequestSetupMetadata) GetQosUseCaseIdNonCompat() *int32

func (*RequestSetupMetadata) IsSetClientMetadata

func (x *RequestSetupMetadata) IsSetClientMetadata() bool

func (*RequestSetupMetadata) IsSetDscpToReflect

func (x *RequestSetupMetadata) IsSetDscpToReflect() bool

func (*RequestSetupMetadata) IsSetInterfaceKind

func (x *RequestSetupMetadata) IsSetInterfaceKind() bool

func (*RequestSetupMetadata) IsSetMarkToReflect

func (x *RequestSetupMetadata) IsSetMarkToReflect() bool

func (*RequestSetupMetadata) IsSetMaxVersion

func (x *RequestSetupMetadata) IsSetMaxVersion() bool

func (*RequestSetupMetadata) IsSetMinVersion

func (x *RequestSetupMetadata) IsSetMinVersion() bool

func (*RequestSetupMetadata) IsSetOpaque

func (x *RequestSetupMetadata) IsSetOpaque() bool

func (*RequestSetupMetadata) IsSetQosPolicyId

func (x *RequestSetupMetadata) IsSetQosPolicyId() bool

func (*RequestSetupMetadata) IsSetQosUseCaseId

func (x *RequestSetupMetadata) IsSetQosUseCaseId() bool

func (*RequestSetupMetadata) Read

func (x *RequestSetupMetadata) Read(p Format) error

func (*RequestSetupMetadata) SetClientMetadata

func (x *RequestSetupMetadata) SetClientMetadata(value *RocketClientMetadata) *RequestSetupMetadata

func (*RequestSetupMetadata) SetClientMetadataNonCompat

func (x *RequestSetupMetadata) SetClientMetadataNonCompat(value RocketClientMetadata) *RequestSetupMetadata

func (*RequestSetupMetadata) SetDscpToReflect

func (x *RequestSetupMetadata) SetDscpToReflect(value *int32) *RequestSetupMetadata

func (*RequestSetupMetadata) SetDscpToReflectNonCompat

func (x *RequestSetupMetadata) SetDscpToReflectNonCompat(value int32) *RequestSetupMetadata

func (*RequestSetupMetadata) SetInterfaceKind

func (x *RequestSetupMetadata) SetInterfaceKind(value *InterfaceKind) *RequestSetupMetadata

func (*RequestSetupMetadata) SetInterfaceKindNonCompat

func (x *RequestSetupMetadata) SetInterfaceKindNonCompat(value InterfaceKind) *RequestSetupMetadata

func (*RequestSetupMetadata) SetMarkToReflect

func (x *RequestSetupMetadata) SetMarkToReflect(value *int32) *RequestSetupMetadata

func (*RequestSetupMetadata) SetMarkToReflectNonCompat

func (x *RequestSetupMetadata) SetMarkToReflectNonCompat(value int32) *RequestSetupMetadata

func (*RequestSetupMetadata) SetMaxVersion

func (x *RequestSetupMetadata) SetMaxVersion(value *int32) *RequestSetupMetadata

func (*RequestSetupMetadata) SetMaxVersionNonCompat

func (x *RequestSetupMetadata) SetMaxVersionNonCompat(value int32) *RequestSetupMetadata

func (*RequestSetupMetadata) SetMinVersion

func (x *RequestSetupMetadata) SetMinVersion(value *int32) *RequestSetupMetadata

func (*RequestSetupMetadata) SetMinVersionNonCompat

func (x *RequestSetupMetadata) SetMinVersionNonCompat(value int32) *RequestSetupMetadata

func (*RequestSetupMetadata) SetOpaque

func (x *RequestSetupMetadata) SetOpaque(value map[string][]byte) *RequestSetupMetadata

func (*RequestSetupMetadata) SetOpaqueNonCompat

func (x *RequestSetupMetadata) SetOpaqueNonCompat(value map[string][]byte) *RequestSetupMetadata

func (*RequestSetupMetadata) SetQosPolicyId

func (x *RequestSetupMetadata) SetQosPolicyId(value *int32) *RequestSetupMetadata

func (*RequestSetupMetadata) SetQosPolicyIdNonCompat

func (x *RequestSetupMetadata) SetQosPolicyIdNonCompat(value int32) *RequestSetupMetadata

func (*RequestSetupMetadata) SetQosUseCaseId

func (x *RequestSetupMetadata) SetQosUseCaseId(value *int32) *RequestSetupMetadata

func (*RequestSetupMetadata) SetQosUseCaseIdNonCompat

func (x *RequestSetupMetadata) SetQosUseCaseIdNonCompat(value int32) *RequestSetupMetadata

func (*RequestSetupMetadata) String

func (x *RequestSetupMetadata) String() string

func (*RequestSetupMetadata) Write

func (x *RequestSetupMetadata) Write(p Format) error

type ResponseHeaderGetter

type ResponseHeaderGetter interface {
	GetResponseHeader(key string) (string, bool)
	GetResponseHeaders() map[string]string
}

ResponseHeaderGetter is a temporary measure to allow protocols to expose headers received with the response.

type ResponseRpcError

type ResponseRpcError struct {
	NameUTF8 *string                   `thrift:"name_utf8,1,optional" json:"name_utf8,omitempty" db:"name_utf8"`
	WhatUTF8 *string                   `thrift:"what_utf8,2,optional" json:"what_utf8,omitempty" db:"what_utf8"`
	Category *ResponseRpcErrorCategory `thrift:"category,3,optional" json:"category,omitempty" db:"category"`
	Code     *ResponseRpcErrorCode     `thrift:"code,4,optional" json:"code,omitempty" db:"code"`
	Load     *int64                    `thrift:"load,5,optional" json:"load,omitempty" db:"load"`
}

func NewResponseRpcError

func NewResponseRpcError() *ResponseRpcError

func (*ResponseRpcError) GetCategory

func (x *ResponseRpcError) GetCategory() ResponseRpcErrorCategory

func (*ResponseRpcError) GetCategoryNonCompat

func (x *ResponseRpcError) GetCategoryNonCompat() *ResponseRpcErrorCategory

func (*ResponseRpcError) GetCode

func (*ResponseRpcError) GetCodeNonCompat

func (x *ResponseRpcError) GetCodeNonCompat() *ResponseRpcErrorCode

func (*ResponseRpcError) GetLoad

func (x *ResponseRpcError) GetLoad() int64

func (*ResponseRpcError) GetLoadNonCompat

func (x *ResponseRpcError) GetLoadNonCompat() *int64

func (*ResponseRpcError) GetNameUTF8

func (x *ResponseRpcError) GetNameUTF8() string

func (*ResponseRpcError) GetNameUTF8NonCompat

func (x *ResponseRpcError) GetNameUTF8NonCompat() *string

func (*ResponseRpcError) GetWhatUTF8

func (x *ResponseRpcError) GetWhatUTF8() string

func (*ResponseRpcError) GetWhatUTF8NonCompat

func (x *ResponseRpcError) GetWhatUTF8NonCompat() *string

func (*ResponseRpcError) IsSetCategory

func (x *ResponseRpcError) IsSetCategory() bool

func (*ResponseRpcError) IsSetCode

func (x *ResponseRpcError) IsSetCode() bool

func (*ResponseRpcError) IsSetLoad

func (x *ResponseRpcError) IsSetLoad() bool

func (*ResponseRpcError) IsSetNameUTF8

func (x *ResponseRpcError) IsSetNameUTF8() bool

func (*ResponseRpcError) IsSetWhatUTF8

func (x *ResponseRpcError) IsSetWhatUTF8() bool

func (*ResponseRpcError) Read

func (x *ResponseRpcError) Read(p Format) error

func (*ResponseRpcError) SetCategory

func (*ResponseRpcError) SetCategoryNonCompat

func (x *ResponseRpcError) SetCategoryNonCompat(value ResponseRpcErrorCategory) *ResponseRpcError

func (*ResponseRpcError) SetCode

func (*ResponseRpcError) SetCodeNonCompat

func (x *ResponseRpcError) SetCodeNonCompat(value ResponseRpcErrorCode) *ResponseRpcError

func (*ResponseRpcError) SetLoad

func (x *ResponseRpcError) SetLoad(value *int64) *ResponseRpcError

func (*ResponseRpcError) SetLoadNonCompat

func (x *ResponseRpcError) SetLoadNonCompat(value int64) *ResponseRpcError

func (*ResponseRpcError) SetNameUTF8

func (x *ResponseRpcError) SetNameUTF8(value *string) *ResponseRpcError

func (*ResponseRpcError) SetNameUTF8NonCompat

func (x *ResponseRpcError) SetNameUTF8NonCompat(value string) *ResponseRpcError

func (*ResponseRpcError) SetWhatUTF8

func (x *ResponseRpcError) SetWhatUTF8(value *string) *ResponseRpcError

func (*ResponseRpcError) SetWhatUTF8NonCompat

func (x *ResponseRpcError) SetWhatUTF8NonCompat(value string) *ResponseRpcError

func (*ResponseRpcError) String

func (x *ResponseRpcError) String() string

func (*ResponseRpcError) Write

func (x *ResponseRpcError) Write(p Format) error

type ResponseRpcErrorCategory

type ResponseRpcErrorCategory int32
const (
	ResponseRpcErrorCategory_INTERNAL_ERROR  ResponseRpcErrorCategory = 0
	ResponseRpcErrorCategory_INVALID_REQUEST ResponseRpcErrorCategory = 1
	ResponseRpcErrorCategory_LOADSHEDDING    ResponseRpcErrorCategory = 2
	ResponseRpcErrorCategory_SHUTDOWN        ResponseRpcErrorCategory = 3
)

func (ResponseRpcErrorCategory) Ptr

func (ResponseRpcErrorCategory) String

func (x ResponseRpcErrorCategory) String() string

type ResponseRpcErrorCode

type ResponseRpcErrorCode int32
const (
	ResponseRpcErrorCode_UNKNOWN                       ResponseRpcErrorCode = 0
	ResponseRpcErrorCode_OVERLOAD                      ResponseRpcErrorCode = 1
	ResponseRpcErrorCode_TASK_EXPIRED                  ResponseRpcErrorCode = 2
	ResponseRpcErrorCode_QUEUE_OVERLOADED              ResponseRpcErrorCode = 3
	ResponseRpcErrorCode_SHUTDOWN                      ResponseRpcErrorCode = 4
	ResponseRpcErrorCode_INJECTED_FAILURE              ResponseRpcErrorCode = 5
	ResponseRpcErrorCode_REQUEST_PARSING_FAILURE       ResponseRpcErrorCode = 6
	ResponseRpcErrorCode_QUEUE_TIMEOUT                 ResponseRpcErrorCode = 7
	ResponseRpcErrorCode_RESPONSE_TOO_BIG              ResponseRpcErrorCode = 8
	ResponseRpcErrorCode_WRONG_RPC_KIND                ResponseRpcErrorCode = 9
	ResponseRpcErrorCode_UNKNOWN_METHOD                ResponseRpcErrorCode = 10
	ResponseRpcErrorCode_CHECKSUM_MISMATCH             ResponseRpcErrorCode = 11
	ResponseRpcErrorCode_INTERRUPTION                  ResponseRpcErrorCode = 12
	ResponseRpcErrorCode_APP_OVERLOAD                  ResponseRpcErrorCode = 13
	ResponseRpcErrorCode_UNKNOWN_INTERACTION_ID        ResponseRpcErrorCode = 14
	ResponseRpcErrorCode_INTERACTION_CONSTRUCTOR_ERROR ResponseRpcErrorCode = 15
	ResponseRpcErrorCode_UNIMPLEMENTED_METHOD          ResponseRpcErrorCode = 16
	ResponseRpcErrorCode_TENANT_QUOTA_EXCEEDED         ResponseRpcErrorCode = 17
)

func (ResponseRpcErrorCode) Ptr

func (ResponseRpcErrorCode) String

func (x ResponseRpcErrorCode) String() string

type ResponseRpcMetadata

type ResponseRpcMetadata struct {
	OtherMetadata          map[string]string       `thrift:"otherMetadata,3,optional" json:"otherMetadata,omitempty" db:"otherMetadata"`
	Load                   *int64                  `thrift:"load,4,optional" json:"load,omitempty" db:"load"`
	Crc32c                 *int32                  `thrift:"crc32c,5,optional" json:"crc32c,omitempty" db:"crc32c"`
	Compression            *CompressionAlgorithm   `thrift:"compression,6,optional" json:"compression,omitempty" db:"compression"`
	PayloadMetadata        *PayloadMetadata        `thrift:"payloadMetadata,7,optional" json:"payloadMetadata,omitempty" db:"payloadMetadata"`
	ProxiedPayloadMetadata *ProxiedPayloadMetadata `thrift:"proxiedPayloadMetadata,8,optional" json:"proxiedPayloadMetadata,omitempty" db:"proxiedPayloadMetadata"`
	StreamId               *int32                  `thrift:"streamId,9,optional" json:"streamId,omitempty" db:"streamId"`
	QueueMetadata          *QueueMetadata          `thrift:"queueMetadata,10,optional" json:"queueMetadata,omitempty" db:"queueMetadata"`
	FdMetadata             *FdMetadata             `thrift:"fdMetadata,12,optional" json:"fdMetadata,omitempty" db:"fdMetadata"`
	FrameworkMetadata      IOBufPtr                `thrift:"frameworkMetadata,13,optional" json:"frameworkMetadata,omitempty" db:"frameworkMetadata"`
}

func NewResponseRpcMetadata

func NewResponseRpcMetadata() *ResponseRpcMetadata

func (*ResponseRpcMetadata) GetCompression

func (x *ResponseRpcMetadata) GetCompression() CompressionAlgorithm

func (*ResponseRpcMetadata) GetCompressionNonCompat

func (x *ResponseRpcMetadata) GetCompressionNonCompat() *CompressionAlgorithm

func (*ResponseRpcMetadata) GetCrc32c

func (x *ResponseRpcMetadata) GetCrc32c() int32

func (*ResponseRpcMetadata) GetCrc32cNonCompat

func (x *ResponseRpcMetadata) GetCrc32cNonCompat() *int32

func (*ResponseRpcMetadata) GetFdMetadata

func (x *ResponseRpcMetadata) GetFdMetadata() *FdMetadata

func (*ResponseRpcMetadata) GetFdMetadataNonCompat

func (x *ResponseRpcMetadata) GetFdMetadataNonCompat() *FdMetadata

func (*ResponseRpcMetadata) GetFrameworkMetadata

func (x *ResponseRpcMetadata) GetFrameworkMetadata() IOBufPtr

func (*ResponseRpcMetadata) GetFrameworkMetadataNonCompat

func (x *ResponseRpcMetadata) GetFrameworkMetadataNonCompat() IOBufPtr

func (*ResponseRpcMetadata) GetLoad

func (x *ResponseRpcMetadata) GetLoad() int64

func (*ResponseRpcMetadata) GetLoadNonCompat

func (x *ResponseRpcMetadata) GetLoadNonCompat() *int64

func (*ResponseRpcMetadata) GetOtherMetadata

func (x *ResponseRpcMetadata) GetOtherMetadata() map[string]string

func (*ResponseRpcMetadata) GetOtherMetadataNonCompat

func (x *ResponseRpcMetadata) GetOtherMetadataNonCompat() map[string]string

func (*ResponseRpcMetadata) GetPayloadMetadata

func (x *ResponseRpcMetadata) GetPayloadMetadata() *PayloadMetadata

func (*ResponseRpcMetadata) GetPayloadMetadataNonCompat

func (x *ResponseRpcMetadata) GetPayloadMetadataNonCompat() *PayloadMetadata

func (*ResponseRpcMetadata) GetProxiedPayloadMetadata

func (x *ResponseRpcMetadata) GetProxiedPayloadMetadata() *ProxiedPayloadMetadata

func (*ResponseRpcMetadata) GetProxiedPayloadMetadataNonCompat

func (x *ResponseRpcMetadata) GetProxiedPayloadMetadataNonCompat() *ProxiedPayloadMetadata

func (*ResponseRpcMetadata) GetQueueMetadata

func (x *ResponseRpcMetadata) GetQueueMetadata() *QueueMetadata

func (*ResponseRpcMetadata) GetQueueMetadataNonCompat

func (x *ResponseRpcMetadata) GetQueueMetadataNonCompat() *QueueMetadata

func (*ResponseRpcMetadata) GetStreamId

func (x *ResponseRpcMetadata) GetStreamId() int32

func (*ResponseRpcMetadata) GetStreamIdNonCompat

func (x *ResponseRpcMetadata) GetStreamIdNonCompat() *int32

func (*ResponseRpcMetadata) IsSetCompression

func (x *ResponseRpcMetadata) IsSetCompression() bool

func (*ResponseRpcMetadata) IsSetCrc32c

func (x *ResponseRpcMetadata) IsSetCrc32c() bool

func (*ResponseRpcMetadata) IsSetFdMetadata

func (x *ResponseRpcMetadata) IsSetFdMetadata() bool

func (*ResponseRpcMetadata) IsSetFrameworkMetadata

func (x *ResponseRpcMetadata) IsSetFrameworkMetadata() bool

func (*ResponseRpcMetadata) IsSetLoad

func (x *ResponseRpcMetadata) IsSetLoad() bool

func (*ResponseRpcMetadata) IsSetOtherMetadata

func (x *ResponseRpcMetadata) IsSetOtherMetadata() bool

func (*ResponseRpcMetadata) IsSetPayloadMetadata

func (x *ResponseRpcMetadata) IsSetPayloadMetadata() bool

func (*ResponseRpcMetadata) IsSetProxiedPayloadMetadata

func (x *ResponseRpcMetadata) IsSetProxiedPayloadMetadata() bool

func (*ResponseRpcMetadata) IsSetQueueMetadata

func (x *ResponseRpcMetadata) IsSetQueueMetadata() bool

func (*ResponseRpcMetadata) IsSetStreamId

func (x *ResponseRpcMetadata) IsSetStreamId() bool

func (*ResponseRpcMetadata) Read

func (x *ResponseRpcMetadata) Read(p Format) error

func (*ResponseRpcMetadata) SetCompression

func (*ResponseRpcMetadata) SetCompressionNonCompat

func (x *ResponseRpcMetadata) SetCompressionNonCompat(value CompressionAlgorithm) *ResponseRpcMetadata

func (*ResponseRpcMetadata) SetCrc32c

func (x *ResponseRpcMetadata) SetCrc32c(value *int32) *ResponseRpcMetadata

func (*ResponseRpcMetadata) SetCrc32cNonCompat

func (x *ResponseRpcMetadata) SetCrc32cNonCompat(value int32) *ResponseRpcMetadata

func (*ResponseRpcMetadata) SetFdMetadata

func (x *ResponseRpcMetadata) SetFdMetadata(value *FdMetadata) *ResponseRpcMetadata

func (*ResponseRpcMetadata) SetFdMetadataNonCompat

func (x *ResponseRpcMetadata) SetFdMetadataNonCompat(value FdMetadata) *ResponseRpcMetadata

func (*ResponseRpcMetadata) SetFrameworkMetadata

func (x *ResponseRpcMetadata) SetFrameworkMetadata(value IOBufPtr) *ResponseRpcMetadata

func (*ResponseRpcMetadata) SetFrameworkMetadataNonCompat

func (x *ResponseRpcMetadata) SetFrameworkMetadataNonCompat(value IOBufPtr) *ResponseRpcMetadata

func (*ResponseRpcMetadata) SetLoad

func (x *ResponseRpcMetadata) SetLoad(value *int64) *ResponseRpcMetadata

func (*ResponseRpcMetadata) SetLoadNonCompat

func (x *ResponseRpcMetadata) SetLoadNonCompat(value int64) *ResponseRpcMetadata

func (*ResponseRpcMetadata) SetOtherMetadata

func (x *ResponseRpcMetadata) SetOtherMetadata(value map[string]string) *ResponseRpcMetadata

func (*ResponseRpcMetadata) SetOtherMetadataNonCompat

func (x *ResponseRpcMetadata) SetOtherMetadataNonCompat(value map[string]string) *ResponseRpcMetadata

func (*ResponseRpcMetadata) SetPayloadMetadata

func (x *ResponseRpcMetadata) SetPayloadMetadata(value *PayloadMetadata) *ResponseRpcMetadata

func (*ResponseRpcMetadata) SetPayloadMetadataNonCompat

func (x *ResponseRpcMetadata) SetPayloadMetadataNonCompat(value PayloadMetadata) *ResponseRpcMetadata

func (*ResponseRpcMetadata) SetProxiedPayloadMetadata

func (x *ResponseRpcMetadata) SetProxiedPayloadMetadata(value *ProxiedPayloadMetadata) *ResponseRpcMetadata

func (*ResponseRpcMetadata) SetProxiedPayloadMetadataNonCompat

func (x *ResponseRpcMetadata) SetProxiedPayloadMetadataNonCompat(value ProxiedPayloadMetadata) *ResponseRpcMetadata

func (*ResponseRpcMetadata) SetQueueMetadata

func (x *ResponseRpcMetadata) SetQueueMetadata(value *QueueMetadata) *ResponseRpcMetadata

func (*ResponseRpcMetadata) SetQueueMetadataNonCompat

func (x *ResponseRpcMetadata) SetQueueMetadataNonCompat(value QueueMetadata) *ResponseRpcMetadata

func (*ResponseRpcMetadata) SetStreamId

func (x *ResponseRpcMetadata) SetStreamId(value *int32) *ResponseRpcMetadata

func (*ResponseRpcMetadata) SetStreamIdNonCompat

func (x *ResponseRpcMetadata) SetStreamIdNonCompat(value int32) *ResponseRpcMetadata

func (*ResponseRpcMetadata) String

func (x *ResponseRpcMetadata) String() string

func (*ResponseRpcMetadata) Write

func (x *ResponseRpcMetadata) Write(p Format) error

type RichTransport

type RichTransport interface {
	io.ReadWriter
	io.ByteReader
	io.ByteWriter

	Flusher
	ReadSizeProvider
	// contains filtered or unexported methods
}

RichTransport is an "enhanced" transport with extra capabilities. You need to use one of these to construct protocol. Notably, Socket does not implement this interface, and it is always a mistake to use Socket directly in protocol.

func NewRichTransport

func NewRichTransport(trans Transport) RichTransport

Wraps Transport to provide RichTransport interface

type RocketClientMetadata

type RocketClientMetadata struct {
	Agent         *string           `thrift:"agent,1,optional" json:"agent,omitempty" db:"agent"`
	Hostname      *string           `thrift:"hostname,2,optional" json:"hostname,omitempty" db:"hostname"`
	OtherMetadata map[string]string `thrift:"otherMetadata,3,optional" json:"otherMetadata,omitempty" db:"otherMetadata"`
}

func NewRocketClientMetadata

func NewRocketClientMetadata() *RocketClientMetadata

func (*RocketClientMetadata) GetAgent

func (x *RocketClientMetadata) GetAgent() string

func (*RocketClientMetadata) GetAgentNonCompat

func (x *RocketClientMetadata) GetAgentNonCompat() *string

func (*RocketClientMetadata) GetHostname

func (x *RocketClientMetadata) GetHostname() string

func (*RocketClientMetadata) GetHostnameNonCompat

func (x *RocketClientMetadata) GetHostnameNonCompat() *string

func (*RocketClientMetadata) GetOtherMetadata

func (x *RocketClientMetadata) GetOtherMetadata() map[string]string

func (*RocketClientMetadata) GetOtherMetadataNonCompat

func (x *RocketClientMetadata) GetOtherMetadataNonCompat() map[string]string

func (*RocketClientMetadata) IsSetAgent

func (x *RocketClientMetadata) IsSetAgent() bool

func (*RocketClientMetadata) IsSetHostname

func (x *RocketClientMetadata) IsSetHostname() bool

func (*RocketClientMetadata) IsSetOtherMetadata

func (x *RocketClientMetadata) IsSetOtherMetadata() bool

func (*RocketClientMetadata) Read

func (x *RocketClientMetadata) Read(p Format) error

func (*RocketClientMetadata) SetAgent

func (x *RocketClientMetadata) SetAgent(value *string) *RocketClientMetadata

func (*RocketClientMetadata) SetAgentNonCompat

func (x *RocketClientMetadata) SetAgentNonCompat(value string) *RocketClientMetadata

func (*RocketClientMetadata) SetHostname

func (x *RocketClientMetadata) SetHostname(value *string) *RocketClientMetadata

func (*RocketClientMetadata) SetHostnameNonCompat

func (x *RocketClientMetadata) SetHostnameNonCompat(value string) *RocketClientMetadata

func (*RocketClientMetadata) SetOtherMetadata

func (x *RocketClientMetadata) SetOtherMetadata(value map[string]string) *RocketClientMetadata

func (*RocketClientMetadata) SetOtherMetadataNonCompat

func (x *RocketClientMetadata) SetOtherMetadataNonCompat(value map[string]string) *RocketClientMetadata

func (*RocketClientMetadata) String

func (x *RocketClientMetadata) String() string

func (*RocketClientMetadata) Write

func (x *RocketClientMetadata) Write(p Format) error

type RpcKind

type RpcKind int32
const (
	RpcKind_SINGLE_REQUEST_SINGLE_RESPONSE    RpcKind = 0
	RpcKind_SINGLE_REQUEST_NO_RESPONSE        RpcKind = 1
	RpcKind_SINGLE_REQUEST_STREAMING_RESPONSE RpcKind = 4
	RpcKind_SINK                              RpcKind = 6
)

func (RpcKind) Ptr

func (x RpcKind) Ptr() *RpcKind

func (RpcKind) String

func (x RpcKind) String() string

type RpcPriority

type RpcPriority int32
const (
	RpcPriority_HIGH_IMPORTANT RpcPriority = 0
	RpcPriority_HIGH           RpcPriority = 1
	RpcPriority_IMPORTANT      RpcPriority = 2
	RpcPriority_NORMAL         RpcPriority = 3
	RpcPriority_BEST_EFFORT    RpcPriority = 4
	RpcPriority_N_PRIORITIES   RpcPriority = 5
)

func (RpcPriority) Ptr

func (x RpcPriority) Ptr() *RpcPriority

func (RpcPriority) String

func (x RpcPriority) String() string

type SSLServerSocket

type SSLServerSocket struct {
	// contains filtered or unexported fields
}

func NewSSLServerSocket

func NewSSLServerSocket(listenAddr string, cfg *tls.Config) (*SSLServerSocket, error)

func NewSSLServerSocketTimeout

func NewSSLServerSocketTimeout(listenAddr string, cfg *tls.Config, clientTimeout time.Duration) (*SSLServerSocket, error)

func (*SSLServerSocket) Accept

func (p *SSLServerSocket) Accept() (Transport, error)

func (*SSLServerSocket) Addr

func (p *SSLServerSocket) Addr() net.Addr

func (*SSLServerSocket) Close

func (p *SSLServerSocket) Close() error

func (*SSLServerSocket) Interrupt

func (p *SSLServerSocket) Interrupt() error

func (*SSLServerSocket) IsListening

func (p *SSLServerSocket) IsListening() bool

Checks whether the socket is listening.

func (*SSLServerSocket) Listen

func (p *SSLServerSocket) Listen() error

func (*SSLServerSocket) Open

func (p *SSLServerSocket) Open() error

Connects the socket, creating a new socket object if necessary.

type SSLSocket

type SSLSocket struct {
	// contains filtered or unexported fields
}

func NewSSLSocket

func NewSSLSocket(hostPort string, cfg *tls.Config) (*SSLSocket, error)

NewSSLSocket creates a net.Conn-backed Transport, given a host and port and tls Configuration

Example:

trans, err := thrift.NewSSLSocket("localhost:9090", nil)

func NewSSLSocketFromAddrTimeout

func NewSSLSocketFromAddrTimeout(addr net.Addr, cfg *tls.Config, timeout time.Duration) *SSLSocket

Creates a SSLSocket from a net.Addr

func NewSSLSocketFromConnTimeout

func NewSSLSocketFromConnTimeout(conn net.Conn, cfg *tls.Config, timeout time.Duration) *SSLSocket

Creates a SSLSocket from an existing net.Conn

func NewSSLSocketTimeout

func NewSSLSocketTimeout(hostPort string, cfg *tls.Config, timeout time.Duration) (*SSLSocket, error)

NewSSLSocketTimeout creates a net.Conn-backed Transport, given a host and port it also accepts a tls Configuration and a timeout as a time.Duration

func (*SSLSocket) Close

func (p *SSLSocket) Close() error

Closes the socket.

func (*SSLSocket) Conn

func (p *SSLSocket) Conn() net.Conn

Retrieve the underlying net.Conn

func (*SSLSocket) Flush

func (p *SSLSocket) Flush() error

func (*SSLSocket) Interrupt

func (p *SSLSocket) Interrupt() error

func (*SSLSocket) IsOpen

func (p *SSLSocket) IsOpen() bool

Returns true if the connection is open

func (*SSLSocket) Open

func (p *SSLSocket) Open() error

Connects the socket, creating a new socket object if necessary.

func (*SSLSocket) Read

func (p *SSLSocket) Read(buf []byte) (int, error)

func (*SSLSocket) RemainingBytes

func (p *SSLSocket) RemainingBytes() uint64

func (*SSLSocket) SetTimeout

func (p *SSLSocket) SetTimeout(timeout time.Duration) error

Sets the socket timeout

func (*SSLSocket) Write

func (p *SSLSocket) Write(buf []byte) (int, error)

type SerialChannel

type SerialChannel struct {
	// contains filtered or unexported fields
}

SerialChannel is a simple threadsafe channel which allows for a single request-response to occur at once. Head of line blocking can occur with this channel.

func NewSerialChannel

func NewSerialChannel(protocol Protocol) *SerialChannel

NewSerialChannel creates a new serial channel. The protocol should already be open.

func (*SerialChannel) Call

func (c *SerialChannel) Call(ctx context.Context, method string, request IRequest, response IResponse) error

Call will call the given method with the given thrift struct, and read the response into the given response struct. It only allows one outstanding request at once, but is thread-safe.

func (*SerialChannel) Close

func (c *SerialChannel) Close() error

Close closes the client connection

func (*SerialChannel) Oneway

func (c *SerialChannel) Oneway(ctx context.Context, method string, request IRequest) error

Oneway will call the given method with the given thrift struct. It returns immediately when the request is sent. It only allows one outstanding request at once, but is thread-safe.

type Serializer

type Serializer struct {
	Transport *MemoryBuffer
	Protocol  Format
}

A Serializer is used to turn a Struct in to a byte stream

func NewCompactSerializer

func NewCompactSerializer() *Serializer

NewCompactSerializer creates a new serializer using the compact protocol

func NewJSONSerializer

func NewJSONSerializer() *Serializer

NewJSONSerializer creates a new serializer using the JSON protocol

func NewSerializer

func NewSerializer() *Serializer

NewSerializer create a new serializer using the binary protocol

func NewSimpleJSONSerializer

func NewSimpleJSONSerializer() *Serializer

NewSimpleJSONSerializer creates a new serializer using the SimpleJSON protocol

func (*Serializer) Write

func (s *Serializer) Write(msg Struct) (b []byte, err error)

Write writes msg to the serializer and returns it as a byte array

func (*Serializer) WriteString

func (s *Serializer) WriteString(msg Struct) (str string, err error)

WriteString writes msg to the serializer and returns it as a string

type Server

type Server interface {
	ServerTransport() ServerTransport
	// Serve starts the server
	Serve() error
	// ServeContext starts the server, and stops it when the context is cancelled
	ServeContext(ctx context.Context) error
	// Stop stops the server. This is optional on a per-implementation basis. Not
	// all servers are required to be cleanly stoppable.
	Stop() error
}

Server is a thrift server

type ServerOptions

type ServerOptions struct {
	// contains filtered or unexported fields
}

ServerOptions is options needed to run a thrift server

type ServerPushMetadata

type ServerPushMetadata struct {
	SetupResponse     *SetupResponse     `thrift:"setupResponse,1" json:"setupResponse,omitempty" db:"setupResponse"`
	StreamHeadersPush *StreamHeadersPush `thrift:"streamHeadersPush,2" json:"streamHeadersPush,omitempty" db:"streamHeadersPush"`
	DrainCompletePush *DrainCompletePush `thrift:"drainCompletePush,3" json:"drainCompletePush,omitempty" db:"drainCompletePush"`
}

func NewServerPushMetadata

func NewServerPushMetadata() *ServerPushMetadata

func (*ServerPushMetadata) CountSetFieldsServerPushMetadata

func (x *ServerPushMetadata) CountSetFieldsServerPushMetadata() int

func (*ServerPushMetadata) GetDrainCompletePush

func (x *ServerPushMetadata) GetDrainCompletePush() *DrainCompletePush

func (*ServerPushMetadata) GetDrainCompletePushNonCompat

func (x *ServerPushMetadata) GetDrainCompletePushNonCompat() *DrainCompletePush

func (*ServerPushMetadata) GetSetupResponse

func (x *ServerPushMetadata) GetSetupResponse() *SetupResponse

func (*ServerPushMetadata) GetSetupResponseNonCompat

func (x *ServerPushMetadata) GetSetupResponseNonCompat() *SetupResponse

func (*ServerPushMetadata) GetStreamHeadersPush

func (x *ServerPushMetadata) GetStreamHeadersPush() *StreamHeadersPush

func (*ServerPushMetadata) GetStreamHeadersPushNonCompat

func (x *ServerPushMetadata) GetStreamHeadersPushNonCompat() *StreamHeadersPush

func (*ServerPushMetadata) IsSetDrainCompletePush

func (x *ServerPushMetadata) IsSetDrainCompletePush() bool

func (*ServerPushMetadata) IsSetSetupResponse

func (x *ServerPushMetadata) IsSetSetupResponse() bool

func (*ServerPushMetadata) IsSetStreamHeadersPush

func (x *ServerPushMetadata) IsSetStreamHeadersPush() bool

func (*ServerPushMetadata) Read

func (x *ServerPushMetadata) Read(p Format) error

func (*ServerPushMetadata) SetDrainCompletePush

func (x *ServerPushMetadata) SetDrainCompletePush(value *DrainCompletePush) *ServerPushMetadata

func (*ServerPushMetadata) SetDrainCompletePushNonCompat

func (x *ServerPushMetadata) SetDrainCompletePushNonCompat(value DrainCompletePush) *ServerPushMetadata

func (*ServerPushMetadata) SetSetupResponse

func (x *ServerPushMetadata) SetSetupResponse(value *SetupResponse) *ServerPushMetadata

func (*ServerPushMetadata) SetSetupResponseNonCompat

func (x *ServerPushMetadata) SetSetupResponseNonCompat(value SetupResponse) *ServerPushMetadata

func (*ServerPushMetadata) SetStreamHeadersPush

func (x *ServerPushMetadata) SetStreamHeadersPush(value *StreamHeadersPush) *ServerPushMetadata

func (*ServerPushMetadata) SetStreamHeadersPushNonCompat

func (x *ServerPushMetadata) SetStreamHeadersPushNonCompat(value StreamHeadersPush) *ServerPushMetadata

func (*ServerPushMetadata) String

func (x *ServerPushMetadata) String() string

func (*ServerPushMetadata) Write

func (x *ServerPushMetadata) Write(p Format) error

type ServerSocket

type ServerSocket struct {
	// contains filtered or unexported fields
}

func NewServerSocket

func NewServerSocket(listenAddr string) (*ServerSocket, error)

func NewServerSocketTimeout

func NewServerSocketTimeout(listenAddr string, clientTimeout time.Duration) (*ServerSocket, error)

func (*ServerSocket) Accept

func (p *ServerSocket) Accept() (Transport, error)

func (*ServerSocket) Addr

func (p *ServerSocket) Addr() net.Addr

func (*ServerSocket) Close

func (p *ServerSocket) Close() error

func (*ServerSocket) Interrupt

func (p *ServerSocket) Interrupt() error

func (*ServerSocket) IsListening

func (p *ServerSocket) IsListening() bool

Checks whether the socket is listening.

func (*ServerSocket) Listen

func (p *ServerSocket) Listen() error

func (*ServerSocket) Open

func (p *ServerSocket) Open() error

Connects the socket, creating a new socket object if necessary.

type ServerTransport

type ServerTransport interface {
	Listen() error
	Accept() (Transport, error)
	Close() error
	Addr() net.Addr

	// Optional method implementation. This signals to the server transport
	// that it should break out of any accept() or listen() that it is currently
	// blocked on. This method, if implemented, MUST be thread safe, as it may
	// be called from a different thread context than the other ServerTransport
	// methods.
	Interrupt() error
}

ServerTransport is an interface for server transports.

type SetupResponse

type SetupResponse struct {
	Version       *int32 `thrift:"version,1,optional" json:"version,omitempty" db:"version"`
	ZstdSupported *bool  `thrift:"zstdSupported,2,optional" json:"zstdSupported,omitempty" db:"zstdSupported"`
}

func NewSetupResponse

func NewSetupResponse() *SetupResponse

func (*SetupResponse) GetVersion

func (x *SetupResponse) GetVersion() int32

func (*SetupResponse) GetVersionNonCompat

func (x *SetupResponse) GetVersionNonCompat() *int32

func (*SetupResponse) GetZstdSupported

func (x *SetupResponse) GetZstdSupported() bool

func (*SetupResponse) GetZstdSupportedNonCompat

func (x *SetupResponse) GetZstdSupportedNonCompat() *bool

func (*SetupResponse) IsSetVersion

func (x *SetupResponse) IsSetVersion() bool

func (*SetupResponse) IsSetZstdSupported

func (x *SetupResponse) IsSetZstdSupported() bool

func (*SetupResponse) Read

func (x *SetupResponse) Read(p Format) error

func (*SetupResponse) SetVersion

func (x *SetupResponse) SetVersion(value *int32) *SetupResponse

func (*SetupResponse) SetVersionNonCompat

func (x *SetupResponse) SetVersionNonCompat(value int32) *SetupResponse

func (*SetupResponse) SetZstdSupported

func (x *SetupResponse) SetZstdSupported(value *bool) *SetupResponse

func (*SetupResponse) SetZstdSupportedNonCompat

func (x *SetupResponse) SetZstdSupportedNonCompat(value bool) *SetupResponse

func (*SetupResponse) String

func (x *SetupResponse) String() string

func (*SetupResponse) Write

func (x *SetupResponse) Write(p Format) error

type SimpleJSONProtocol

type SimpleJSONProtocol struct {
	// contains filtered or unexported fields
}

JSON protocol implementation for thrift.

This protocol produces/consumes a simple output format suitable for parsing by scripting languages. It should not be confused with the full-featured JSONProtocol.

func NewSimpleJSONProtocol

func NewSimpleJSONProtocol(t Transport) *SimpleJSONProtocol

Constructor

func (*SimpleJSONProtocol) Close

func (p *SimpleJSONProtocol) Close() error

func (*SimpleJSONProtocol) Flush

func (p *SimpleJSONProtocol) Flush() (err error)

func (*SimpleJSONProtocol) OutputBool

func (p *SimpleJSONProtocol) OutputBool(value bool) error

func (*SimpleJSONProtocol) OutputElemListBegin

func (p *SimpleJSONProtocol) OutputElemListBegin(elemType Type, size int) error

func (*SimpleJSONProtocol) OutputF32

func (p *SimpleJSONProtocol) OutputF32(value float32) error

func (*SimpleJSONProtocol) OutputF64

func (p *SimpleJSONProtocol) OutputF64(value float64) error

func (*SimpleJSONProtocol) OutputI64

func (p *SimpleJSONProtocol) OutputI64(value int64) error

func (*SimpleJSONProtocol) OutputListBegin

func (p *SimpleJSONProtocol) OutputListBegin() error

func (*SimpleJSONProtocol) OutputListEnd

func (p *SimpleJSONProtocol) OutputListEnd() error

func (*SimpleJSONProtocol) OutputNull

func (p *SimpleJSONProtocol) OutputNull() error

func (*SimpleJSONProtocol) OutputObjectBegin

func (p *SimpleJSONProtocol) OutputObjectBegin() error

func (*SimpleJSONProtocol) OutputObjectEnd

func (p *SimpleJSONProtocol) OutputObjectEnd() error

func (*SimpleJSONProtocol) OutputPostValue

func (p *SimpleJSONProtocol) OutputPostValue() error

func (*SimpleJSONProtocol) OutputPreValue

func (p *SimpleJSONProtocol) OutputPreValue() error

func (*SimpleJSONProtocol) OutputString

func (p *SimpleJSONProtocol) OutputString(s string) error

func (*SimpleJSONProtocol) OutputStringData

func (p *SimpleJSONProtocol) OutputStringData(s string) error

func (*SimpleJSONProtocol) ParseBase64EncodedBody

func (p *SimpleJSONProtocol) ParseBase64EncodedBody() ([]byte, error)

func (*SimpleJSONProtocol) ParseElemListBegin

func (p *SimpleJSONProtocol) ParseElemListBegin() (elemType Type, size int, e error)

func (*SimpleJSONProtocol) ParseF32

func (p *SimpleJSONProtocol) ParseF32() (float32, bool, error)

func (*SimpleJSONProtocol) ParseF64

func (p *SimpleJSONProtocol) ParseF64() (float64, bool, error)

func (*SimpleJSONProtocol) ParseI64

func (p *SimpleJSONProtocol) ParseI64() (int64, bool, error)

func (*SimpleJSONProtocol) ParseListBegin

func (p *SimpleJSONProtocol) ParseListBegin() (isNull bool, err error)

func (*SimpleJSONProtocol) ParseListEnd

func (p *SimpleJSONProtocol) ParseListEnd() error

func (*SimpleJSONProtocol) ParseObjectEnd

func (p *SimpleJSONProtocol) ParseObjectEnd() error

func (*SimpleJSONProtocol) ParseObjectStart

func (p *SimpleJSONProtocol) ParseObjectStart() (bool, error)

func (*SimpleJSONProtocol) ParsePostValue

func (p *SimpleJSONProtocol) ParsePostValue() error

func (*SimpleJSONProtocol) ParsePreValue

func (p *SimpleJSONProtocol) ParsePreValue() error

func (*SimpleJSONProtocol) ParseQuotedStringBody

func (p *SimpleJSONProtocol) ParseQuotedStringBody() (string, error)

func (*SimpleJSONProtocol) ParseStringBody

func (p *SimpleJSONProtocol) ParseStringBody() (string, error)

func (*SimpleJSONProtocol) ReadBinary

func (p *SimpleJSONProtocol) ReadBinary() ([]byte, error)

func (*SimpleJSONProtocol) ReadBool

func (p *SimpleJSONProtocol) ReadBool() (bool, error)

func (*SimpleJSONProtocol) ReadByte

func (p *SimpleJSONProtocol) ReadByte() (byte, error)

func (*SimpleJSONProtocol) ReadDouble

func (p *SimpleJSONProtocol) ReadDouble() (float64, error)

func (*SimpleJSONProtocol) ReadFieldBegin

func (p *SimpleJSONProtocol) ReadFieldBegin() (string, Type, int16, error)

func (*SimpleJSONProtocol) ReadFieldEnd

func (p *SimpleJSONProtocol) ReadFieldEnd() error

func (*SimpleJSONProtocol) ReadFloat

func (p *SimpleJSONProtocol) ReadFloat() (float32, error)

func (*SimpleJSONProtocol) ReadI16

func (p *SimpleJSONProtocol) ReadI16() (int16, error)

func (*SimpleJSONProtocol) ReadI32

func (p *SimpleJSONProtocol) ReadI32() (int32, error)

func (*SimpleJSONProtocol) ReadI64

func (p *SimpleJSONProtocol) ReadI64() (int64, error)

func (*SimpleJSONProtocol) ReadListBegin

func (p *SimpleJSONProtocol) ReadListBegin() (elemType Type, size int, e error)

func (*SimpleJSONProtocol) ReadListEnd

func (p *SimpleJSONProtocol) ReadListEnd() error

func (*SimpleJSONProtocol) ReadMapBegin

func (p *SimpleJSONProtocol) ReadMapBegin() (keyType Type, valueType Type, size int, e error)

func (*SimpleJSONProtocol) ReadMapEnd

func (p *SimpleJSONProtocol) ReadMapEnd() error

func (*SimpleJSONProtocol) ReadMessageBegin

func (p *SimpleJSONProtocol) ReadMessageBegin() (name string, typeID MessageType, seqID int32, err error)

Reading methods.

func (*SimpleJSONProtocol) ReadMessageEnd

func (p *SimpleJSONProtocol) ReadMessageEnd() error

func (*SimpleJSONProtocol) ReadSetBegin

func (p *SimpleJSONProtocol) ReadSetBegin() (elemType Type, size int, e error)

func (*SimpleJSONProtocol) ReadSetEnd

func (p *SimpleJSONProtocol) ReadSetEnd() error

func (*SimpleJSONProtocol) ReadString

func (p *SimpleJSONProtocol) ReadString() (string, error)

func (*SimpleJSONProtocol) ReadStructBegin

func (p *SimpleJSONProtocol) ReadStructBegin() (name string, err error)

func (*SimpleJSONProtocol) ReadStructEnd

func (p *SimpleJSONProtocol) ReadStructEnd() error

func (*SimpleJSONProtocol) Skip

func (p *SimpleJSONProtocol) Skip(fieldType Type) (err error)

func (*SimpleJSONProtocol) WriteBinary

func (p *SimpleJSONProtocol) WriteBinary(v []byte) error

func (*SimpleJSONProtocol) WriteBool

func (p *SimpleJSONProtocol) WriteBool(b bool) error

func (*SimpleJSONProtocol) WriteByte

func (p *SimpleJSONProtocol) WriteByte(b byte) error

func (*SimpleJSONProtocol) WriteDouble

func (p *SimpleJSONProtocol) WriteDouble(v float64) error

func (*SimpleJSONProtocol) WriteFieldBegin

func (p *SimpleJSONProtocol) WriteFieldBegin(name string, typeID Type, id int16) error

func (*SimpleJSONProtocol) WriteFieldEnd

func (p *SimpleJSONProtocol) WriteFieldEnd() error

func (*SimpleJSONProtocol) WriteFieldStop

func (p *SimpleJSONProtocol) WriteFieldStop() error

func (*SimpleJSONProtocol) WriteFloat

func (p *SimpleJSONProtocol) WriteFloat(v float32) error

func (*SimpleJSONProtocol) WriteI16

func (p *SimpleJSONProtocol) WriteI16(v int16) error

func (*SimpleJSONProtocol) WriteI32

func (p *SimpleJSONProtocol) WriteI32(v int32) error

func (*SimpleJSONProtocol) WriteI64

func (p *SimpleJSONProtocol) WriteI64(v int64) error

func (*SimpleJSONProtocol) WriteListBegin

func (p *SimpleJSONProtocol) WriteListBegin(elemType Type, size int) error

func (*SimpleJSONProtocol) WriteListEnd

func (p *SimpleJSONProtocol) WriteListEnd() error

func (*SimpleJSONProtocol) WriteMapBegin

func (p *SimpleJSONProtocol) WriteMapBegin(keyType Type, valueType Type, size int) error

func (*SimpleJSONProtocol) WriteMapEnd

func (p *SimpleJSONProtocol) WriteMapEnd() error

func (*SimpleJSONProtocol) WriteMessageBegin

func (p *SimpleJSONProtocol) WriteMessageBegin(name string, typeID MessageType, seqID int32) error

func (*SimpleJSONProtocol) WriteMessageEnd

func (p *SimpleJSONProtocol) WriteMessageEnd() error

func (*SimpleJSONProtocol) WriteSetBegin

func (p *SimpleJSONProtocol) WriteSetBegin(elemType Type, size int) error

func (*SimpleJSONProtocol) WriteSetEnd

func (p *SimpleJSONProtocol) WriteSetEnd() error

func (*SimpleJSONProtocol) WriteString

func (p *SimpleJSONProtocol) WriteString(v string) error

func (*SimpleJSONProtocol) WriteStructBegin

func (p *SimpleJSONProtocol) WriteStructBegin(name string) error

func (*SimpleJSONProtocol) WriteStructEnd

func (p *SimpleJSONProtocol) WriteStructEnd() error

type SimpleServer

type SimpleServer struct {
	*ServerOptions
	// contains filtered or unexported fields
}

SimpleServer is a functional but unoptimized server that is easy to understand. In its accept loop, it performs an accept on an underlying socket, wraps the socket in the ServerTransport, and then spins up a gofunc to process requests.

There is one gofunc per active connection that handles all requests on the connection. multiple simultaneous requests over a single connection are not supported, as the per-connection gofunc reads the request, processes it, and writes the response serially

func NewSimpleServer

func NewSimpleServer(processor ProcessorContext, serverTransport ServerTransport, transportType TransportID, options ...func(*ServerOptions)) *SimpleServer

NewSimpleServer creates a new server that only supports Header Transport.

func (*SimpleServer) AcceptLoop

func (p *SimpleServer) AcceptLoop() error

AcceptLoop runs the accept loop to handle requests

func (*SimpleServer) AcceptLoopContext

func (p *SimpleServer) AcceptLoopContext(ctx context.Context) error

AcceptLoopContext is an AcceptLoop that supports contexts. The context is decorated with ConnInfo and passed down to new clients.

func (*SimpleServer) Listen

func (p *SimpleServer) Listen() error

Listen returns the server transport listener

func (*SimpleServer) Serve

func (p *SimpleServer) Serve() error

Serve starts listening on the transport and accepting new connections and blocks until Stop is called or an error occurs.

func (*SimpleServer) ServeContext

func (p *SimpleServer) ServeContext(ctx context.Context) error

ServeContext behaves like Serve but supports cancellation via context.

func (*SimpleServer) ServerTransport

func (p *SimpleServer) ServerTransport() ServerTransport

ServerTransport returns the server transport

func (*SimpleServer) Stop

func (p *SimpleServer) Stop() error

Stop stops the server

type Socket

type Socket interface {
	Transport
	// Opens the socket for communication
	Open() error
}

Socket is a Transport that can be opened and reopened.

func NewSocket

func NewSocket(options ...SocketOption) (Socket, error)

NewSocket creates a net.Conn-backed Transport, given a host and port, or an existing connection.

trans, err := thrift.NewSocket(thrift.SocketAddr("localhost:9090"))

type SocketOption

type SocketOption func(*socket) error

SocketOption is the type used to set options on the socket

func SocketAddr

func SocketAddr(hostPort string) SocketOption

SocketAddr sets the socket address

func SocketConn

func SocketConn(conn net.Conn) SocketOption

SocketConn sets the socket connection

func SocketTimeout

func SocketTimeout(timeout time.Duration) SocketOption

SocketTimeout sets the timeout

type StreamHeadersPush

type StreamHeadersPush struct {
	StreamId              *int32                 `thrift:"streamId,1,optional" json:"streamId,omitempty" db:"streamId"`
	HeadersPayloadContent *HeadersPayloadContent `thrift:"headersPayloadContent,2,optional" json:"headersPayloadContent,omitempty" db:"headersPayloadContent"`
}

func NewStreamHeadersPush

func NewStreamHeadersPush() *StreamHeadersPush

func (*StreamHeadersPush) GetHeadersPayloadContent

func (x *StreamHeadersPush) GetHeadersPayloadContent() *HeadersPayloadContent

func (*StreamHeadersPush) GetHeadersPayloadContentNonCompat

func (x *StreamHeadersPush) GetHeadersPayloadContentNonCompat() *HeadersPayloadContent

func (*StreamHeadersPush) GetStreamId

func (x *StreamHeadersPush) GetStreamId() int32

func (*StreamHeadersPush) GetStreamIdNonCompat

func (x *StreamHeadersPush) GetStreamIdNonCompat() *int32

func (*StreamHeadersPush) IsSetHeadersPayloadContent

func (x *StreamHeadersPush) IsSetHeadersPayloadContent() bool

func (*StreamHeadersPush) IsSetStreamId

func (x *StreamHeadersPush) IsSetStreamId() bool

func (*StreamHeadersPush) Read

func (x *StreamHeadersPush) Read(p Format) error

func (*StreamHeadersPush) SetHeadersPayloadContent

func (x *StreamHeadersPush) SetHeadersPayloadContent(value *HeadersPayloadContent) *StreamHeadersPush

func (*StreamHeadersPush) SetHeadersPayloadContentNonCompat

func (x *StreamHeadersPush) SetHeadersPayloadContentNonCompat(value HeadersPayloadContent) *StreamHeadersPush

func (*StreamHeadersPush) SetStreamId

func (x *StreamHeadersPush) SetStreamId(value *int32) *StreamHeadersPush

func (*StreamHeadersPush) SetStreamIdNonCompat

func (x *StreamHeadersPush) SetStreamIdNonCompat(value int32) *StreamHeadersPush

func (*StreamHeadersPush) String

func (x *StreamHeadersPush) String() string

func (*StreamHeadersPush) Write

func (x *StreamHeadersPush) Write(p Format) error

type StreamPayloadMetadata

type StreamPayloadMetadata struct {
	Compression     *CompressionAlgorithm  `thrift:"compression,1,optional" json:"compression,omitempty" db:"compression"`
	OtherMetadata   map[string]String_4852 `thrift:"otherMetadata,2,optional" json:"otherMetadata,omitempty" db:"otherMetadata"`
	PayloadMetadata *PayloadMetadata       `thrift:"payloadMetadata,3,optional" json:"payloadMetadata,omitempty" db:"payloadMetadata"`
	FdMetadata      *FdMetadata            `thrift:"fdMetadata,5,optional" json:"fdMetadata,omitempty" db:"fdMetadata"`
}

func NewStreamPayloadMetadata

func NewStreamPayloadMetadata() *StreamPayloadMetadata

func (*StreamPayloadMetadata) GetCompression

func (x *StreamPayloadMetadata) GetCompression() CompressionAlgorithm

func (*StreamPayloadMetadata) GetCompressionNonCompat

func (x *StreamPayloadMetadata) GetCompressionNonCompat() *CompressionAlgorithm

func (*StreamPayloadMetadata) GetFdMetadata

func (x *StreamPayloadMetadata) GetFdMetadata() *FdMetadata

func (*StreamPayloadMetadata) GetFdMetadataNonCompat

func (x *StreamPayloadMetadata) GetFdMetadataNonCompat() *FdMetadata

func (*StreamPayloadMetadata) GetOtherMetadata

func (x *StreamPayloadMetadata) GetOtherMetadata() map[string]String_4852

func (*StreamPayloadMetadata) GetOtherMetadataNonCompat

func (x *StreamPayloadMetadata) GetOtherMetadataNonCompat() map[string]String_4852

func (*StreamPayloadMetadata) GetPayloadMetadata

func (x *StreamPayloadMetadata) GetPayloadMetadata() *PayloadMetadata

func (*StreamPayloadMetadata) GetPayloadMetadataNonCompat

func (x *StreamPayloadMetadata) GetPayloadMetadataNonCompat() *PayloadMetadata

func (*StreamPayloadMetadata) IsSetCompression

func (x *StreamPayloadMetadata) IsSetCompression() bool

func (*StreamPayloadMetadata) IsSetFdMetadata

func (x *StreamPayloadMetadata) IsSetFdMetadata() bool

func (*StreamPayloadMetadata) IsSetOtherMetadata

func (x *StreamPayloadMetadata) IsSetOtherMetadata() bool

func (*StreamPayloadMetadata) IsSetPayloadMetadata

func (x *StreamPayloadMetadata) IsSetPayloadMetadata() bool

func (*StreamPayloadMetadata) Read

func (x *StreamPayloadMetadata) Read(p Format) error

func (*StreamPayloadMetadata) SetCompression

func (*StreamPayloadMetadata) SetCompressionNonCompat

func (x *StreamPayloadMetadata) SetCompressionNonCompat(value CompressionAlgorithm) *StreamPayloadMetadata

func (*StreamPayloadMetadata) SetFdMetadata

func (x *StreamPayloadMetadata) SetFdMetadata(value *FdMetadata) *StreamPayloadMetadata

func (*StreamPayloadMetadata) SetFdMetadataNonCompat

func (x *StreamPayloadMetadata) SetFdMetadataNonCompat(value FdMetadata) *StreamPayloadMetadata

func (*StreamPayloadMetadata) SetOtherMetadata

func (x *StreamPayloadMetadata) SetOtherMetadata(value map[string]String_4852) *StreamPayloadMetadata

func (*StreamPayloadMetadata) SetOtherMetadataNonCompat

func (x *StreamPayloadMetadata) SetOtherMetadataNonCompat(value map[string]String_4852) *StreamPayloadMetadata

func (*StreamPayloadMetadata) SetPayloadMetadata

func (x *StreamPayloadMetadata) SetPayloadMetadata(value *PayloadMetadata) *StreamPayloadMetadata

func (*StreamPayloadMetadata) SetPayloadMetadataNonCompat

func (x *StreamPayloadMetadata) SetPayloadMetadataNonCompat(value PayloadMetadata) *StreamPayloadMetadata

func (*StreamPayloadMetadata) String

func (x *StreamPayloadMetadata) String() string

func (*StreamPayloadMetadata) Write

func (x *StreamPayloadMetadata) Write(p Format) error

type StreamRpcError

type StreamRpcError struct {
	NameUTF8 *string             `thrift:"name_utf8,1,optional" json:"name_utf8,omitempty" db:"name_utf8"`
	WhatUTF8 *string             `thrift:"what_utf8,2,optional" json:"what_utf8,omitempty" db:"what_utf8"`
	Code     *StreamRpcErrorCode `thrift:"code,4,optional" json:"code,omitempty" db:"code"`
}

func NewStreamRpcError

func NewStreamRpcError() *StreamRpcError

func (*StreamRpcError) GetCode

func (x *StreamRpcError) GetCode() StreamRpcErrorCode

func (*StreamRpcError) GetCodeNonCompat

func (x *StreamRpcError) GetCodeNonCompat() *StreamRpcErrorCode

func (*StreamRpcError) GetNameUTF8

func (x *StreamRpcError) GetNameUTF8() string

func (*StreamRpcError) GetNameUTF8NonCompat

func (x *StreamRpcError) GetNameUTF8NonCompat() *string

func (*StreamRpcError) GetWhatUTF8

func (x *StreamRpcError) GetWhatUTF8() string

func (*StreamRpcError) GetWhatUTF8NonCompat

func (x *StreamRpcError) GetWhatUTF8NonCompat() *string

func (*StreamRpcError) IsSetCode

func (x *StreamRpcError) IsSetCode() bool

func (*StreamRpcError) IsSetNameUTF8

func (x *StreamRpcError) IsSetNameUTF8() bool

func (*StreamRpcError) IsSetWhatUTF8

func (x *StreamRpcError) IsSetWhatUTF8() bool

func (*StreamRpcError) Read

func (x *StreamRpcError) Read(p Format) error

func (*StreamRpcError) SetCode

func (x *StreamRpcError) SetCode(value *StreamRpcErrorCode) *StreamRpcError

func (*StreamRpcError) SetCodeNonCompat

func (x *StreamRpcError) SetCodeNonCompat(value StreamRpcErrorCode) *StreamRpcError

func (*StreamRpcError) SetNameUTF8

func (x *StreamRpcError) SetNameUTF8(value *string) *StreamRpcError

func (*StreamRpcError) SetNameUTF8NonCompat

func (x *StreamRpcError) SetNameUTF8NonCompat(value string) *StreamRpcError

func (*StreamRpcError) SetWhatUTF8

func (x *StreamRpcError) SetWhatUTF8(value *string) *StreamRpcError

func (*StreamRpcError) SetWhatUTF8NonCompat

func (x *StreamRpcError) SetWhatUTF8NonCompat(value string) *StreamRpcError

func (*StreamRpcError) String

func (x *StreamRpcError) String() string

func (*StreamRpcError) Write

func (x *StreamRpcError) Write(p Format) error

type StreamRpcErrorCode

type StreamRpcErrorCode int32
const (
	StreamRpcErrorCode_UNKNOWN        StreamRpcErrorCode = 0
	StreamRpcErrorCode_CREDIT_TIMEOUT StreamRpcErrorCode = 1
	StreamRpcErrorCode_CHUNK_TIMEOUT  StreamRpcErrorCode = 2
)

func (StreamRpcErrorCode) Ptr

func (StreamRpcErrorCode) String

func (x StreamRpcErrorCode) String() string

type StreamTransport

type StreamTransport struct {
	io.Reader
	io.Writer
	// contains filtered or unexported fields
}

StreamTransport is a Transport made of an io.Reader and/or an io.Writer

func NewStreamTransport

func NewStreamTransport(r io.Reader, w io.Writer) *StreamTransport

func NewStreamTransportLimitedR

func NewStreamTransportLimitedR(r io.Reader, n int) *StreamTransport

func NewStreamTransportR

func NewStreamTransportR(r io.Reader) *StreamTransport

func NewStreamTransportRW

func NewStreamTransportRW(rw io.ReadWriter) *StreamTransport

func NewStreamTransportW

func NewStreamTransportW(w io.Writer) *StreamTransport

func (*StreamTransport) Close

func (p *StreamTransport) Close() error

Closes both the reader and writer streams.

func (*StreamTransport) Flush

func (p *StreamTransport) Flush() error

Flushes the underlying output stream if not null.

func (*StreamTransport) IsOpen

func (p *StreamTransport) IsOpen() bool

func (*StreamTransport) Open

func (p *StreamTransport) Open() error

implicitly opened on creation, can't be reopened once closed

func (*StreamTransport) Read

func (p *StreamTransport) Read(c []byte) (n int, err error)

func (*StreamTransport) ReadByte

func (p *StreamTransport) ReadByte() (c byte, err error)

func (*StreamTransport) RemainingBytes

func (p *StreamTransport) RemainingBytes() (num_bytes uint64)

func (*StreamTransport) Write

func (p *StreamTransport) Write(c []byte) (n int, err error)

func (*StreamTransport) WriteByte

func (p *StreamTransport) WriteByte(c byte) (err error)

func (*StreamTransport) WriteString

func (p *StreamTransport) WriteString(s string) (n int, err error)

type String_4852

type String_4852 = string

func NewString_4852

func NewString_4852() String_4852

func ReadString_4852

func ReadString_4852(p Format) (String_4852, error)

type Struct

type Struct interface {
	Write(p Format) error
	Read(p Format) error
}

Struct is the interface used to encapsulate a message that can be read and written to a protocol

type Summary

type Summary struct {
	// the number of events
	Count uint64
	// the Maximum duration
	Maximum time.Duration
	// the Minimum duration
	Minimum time.Duration
	// the average duration
	Average time.Duration
	// the p99 duration
	P99 time.Duration
	// the p95 duration
	P95 time.Duration
	// the p90 duration
	P90 time.Duration
	// the p99.9 duration
	P999 time.Duration
	// time period analyzed
	Period time.Duration
	// The number of successful events (requires .RecordWithStatus())
	Success uint64
	// The number of failed events (requires .RecordWithStatus())
	Fail uint64
}

Summary describes the duration events that occurred over an interval provided to the .Summarize() method of TimingSeries

func (*Summary) String

func (s *Summary) String() string

type TimingConfig

type TimingConfig struct {
	// How far back to record events.  Longer durations require slightly
	// more computation.  For example, If you are wishing to report 60s
	// summary data, then 120s should be fine.
	History time.Duration
	// Precision of collected data.  tl;dr; Use time.Microsecond.
	//
	// Events consist of a duration which we quantize into units of
	// precision.  Higher (smaller) precisions required we store larger
	// numbers.
	//
	// For this reason, don't use use precision much greater than what
	// you need.  A microsecond should be sufficient in most cases and
	// is almost always safe if you are measuring less than an hour's worth
	// of event data each second.
	Precision time.Duration
	// Most granular interval to record.  1s is recommended.  More granularity
	// gives you finer grained reporting at the cost of marginally increased
	// computation during event recording and summary generation.
	Interval time.Duration
}

TimingConfig is the configuration for a TimingSeries.

type TimingSeries

type TimingSeries struct {
	// contains filtered or unexported fields
}

TimingSeries keeps rolling statistics for duration based events over a period of time. As each event occurs you call .Record() to record the event, and then can request variable length statistics reports via .Summarize()

Usage:

ts := NewTimingSeries(nil)
start := time.Now()
doSomethingThatYouWantToMeasure()
ts.Record(time.Since(start))

summary := ts.Summarize(60 * time.Second)
fmt.Printf("%s\n", summary.String())

func NewTimingSeries

func NewTimingSeries(cfg *TimingConfig) *TimingSeries

NewTimingSeries allocate a new TimingSeries. If cfg is nil, defaults will be used.

func (*TimingSeries) MustSummarize

func (ts *TimingSeries) MustSummarize(period time.Duration) *Summary

MustSummarize returns satistics for the defined period and panics if a period greater than the history of the timing series is specified

func (*TimingSeries) Record

func (ts *TimingSeries) Record(duration time.Duration)

Record is a thread-safe non-blocking call that records an observed duration

func (*TimingSeries) RecordEvent

func (ts *TimingSeries) RecordEvent()

RecordEvent bumps the success counter of the timing series. This is useful when you wish to use timingseries to record simple events with time bucketing

func (*TimingSeries) RecordValue

func (ts *TimingSeries) RecordValue(val int64)

RecordValue records an observed value rather than duration. All other semantics remain the same as Record

func (*TimingSeries) RecordWithStatus

func (ts *TimingSeries) RecordWithStatus(duration time.Duration, status bool)

RecordWithStatus is a thread-safe non-blocking call that records an observed duration AND a success or fail bit. This allows one to use the TimingSeries for both (i.e.) API status metrics and API latency/duration metrics.

func (*TimingSeries) Summarize

func (ts *TimingSeries) Summarize(period time.Duration) (*Summary, error)

Summarize satistics for the defined period

type TransformID

type TransformID uint32

TransformID Numerical ID of transform function

const (
	// TransformNone Default null transform
	TransformNone TransformID = 0
	// TransformZlib Apply zlib compression
	TransformZlib TransformID = 1
	// TransformHMAC Deprecated and no longer supported
	TransformHMAC TransformID = 2
	// TransformSnappy Apply snappy compression
	TransformSnappy TransformID = 3
	// TransformQLZ Deprecated and no longer supported
	TransformQLZ TransformID = 4
	// TransformZstd Apply zstd compression
	TransformZstd TransformID = 5
)

func (TransformID) String

func (c TransformID) String() string

func (TransformID) Untransformer

func (c TransformID) Untransformer() (func(byteReader) (byteReader, error), error)

Untransformer will find a transform function to wrap a reader with to transformed the data.

type Transport

type Transport interface {
	io.ReadWriteCloser
	Flusher
	ReadSizeProvider
}

Transport is an encapsulation of the I/O layer

func NewHTTPClient

func NewHTTPClient(urlstr string) (Transport, error)

func NewHTTPPostClient

func NewHTTPPostClient(urlstr string) (Transport, error)

type TransportException

type TransportException interface {
	Exception
	TypeID() int
	Err() error
}

TransportException is the interface for transport exceptions

func NewTransportException

func NewTransportException(t int, e string) TransportException

NewTransportException creates a new TransportException

func NewTransportExceptionFromError

func NewTransportExceptionFromError(e error) TransportException

NewTransportExceptionFromError creates a TransportException from an error

type TransportID

type TransportID int16

TransportID is the type of the transport, header, rocket, etc.

const (
	// TransportIDUnknown is the default value for TransportID
	TransportIDUnknown TransportID = 0
	// TransportIDHeader is the header transport
	TransportIDHeader TransportID = 1
	// TransportIDRocket is the rocket transport
	TransportIDRocket TransportID = 2
	// TransportIDUpgradeToRocket is the transport that upgrades header to rocket
	TransportIDUpgradeToRocket TransportID = 3
)

type TransportMetadataPush

type TransportMetadataPush struct {
	TransportMetadata map[string]string `thrift:"transportMetadata,1,optional" json:"transportMetadata,omitempty" db:"transportMetadata"`
}

func NewTransportMetadataPush

func NewTransportMetadataPush() *TransportMetadataPush

func (*TransportMetadataPush) GetTransportMetadata

func (x *TransportMetadataPush) GetTransportMetadata() map[string]string

func (*TransportMetadataPush) GetTransportMetadataNonCompat

func (x *TransportMetadataPush) GetTransportMetadataNonCompat() map[string]string

func (*TransportMetadataPush) IsSetTransportMetadata

func (x *TransportMetadataPush) IsSetTransportMetadata() bool

func (*TransportMetadataPush) Read

func (x *TransportMetadataPush) Read(p Format) error

func (*TransportMetadataPush) SetTransportMetadata

func (x *TransportMetadataPush) SetTransportMetadata(value map[string]string) *TransportMetadataPush

func (*TransportMetadataPush) SetTransportMetadataNonCompat

func (x *TransportMetadataPush) SetTransportMetadataNonCompat(value map[string]string) *TransportMetadataPush

func (*TransportMetadataPush) String

func (x *TransportMetadataPush) String() string

func (*TransportMetadataPush) Write

func (x *TransportMetadataPush) Write(p Format) error

type Type

type Type byte

Type constants in the Thrift protocol

func (Type) String

func (p Type) String() string

type WritableException

type WritableException interface {
	WritableStruct
	Exception
}

WritableException is an interface used to encapsulate an exception that can be written to a protocol

type WritableResult

type WritableResult interface {
	WritableStruct
	Exception() WritableException
}

WritableResult is an interface used to encapsulate a result struct that can be written to a protocol

type WritableStruct

type WritableStruct interface {
	Write(p Format) error
}

WritableStruct is an interface used to encapsulate a message that can be written to a protocol

type ZlibCompressionCodecConfig

type ZlibCompressionCodecConfig struct {
}

func NewZlibCompressionCodecConfig

func NewZlibCompressionCodecConfig() *ZlibCompressionCodecConfig

func (*ZlibCompressionCodecConfig) Read

func (*ZlibCompressionCodecConfig) String

func (x *ZlibCompressionCodecConfig) String() string

func (*ZlibCompressionCodecConfig) Write

type ZlibTransport

type ZlibTransport struct {
	// contains filtered or unexported fields
}

ZlibTransport is a Transport implementation that makes use of zlib compression.

func NewZlibTransport

func NewZlibTransport(trans Transport, level int) (*ZlibTransport, error)

NewZlibTransport constructs a new instance of ZlibTransport

func (*ZlibTransport) Close

func (z *ZlibTransport) Close() error

Close closes the reader and writer (flushing any unwritten data) and closes the underlying transport.

func (*ZlibTransport) Flush

func (z *ZlibTransport) Flush() error

Flush flushes the writer and its underlying transport.

func (*ZlibTransport) Read

func (z *ZlibTransport) Read(p []byte) (int, error)

func (*ZlibTransport) RemainingBytes

func (z *ZlibTransport) RemainingBytes() uint64

func (*ZlibTransport) Write

func (z *ZlibTransport) Write(p []byte) (int, error)

type ZstdCompressionCodecConfig

type ZstdCompressionCodecConfig struct {
}

func NewZstdCompressionCodecConfig

func NewZstdCompressionCodecConfig() *ZstdCompressionCodecConfig

func (*ZstdCompressionCodecConfig) Read

func (*ZstdCompressionCodecConfig) String

func (x *ZstdCompressionCodecConfig) String() string

func (*ZstdCompressionCodecConfig) Write

Jump to

Keyboard shortcuts

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