Documentation ¶
Index ¶
- func ConvertStreamingError(method string, err error) error
- func IsCanceled(err error) bool
- func NewClientStreamWrapper(method string, stream grpc.ClientStream) grpc.ClientStream
- func NewGRPCStatusFromStreamingError(e *StreamingError) *status.Status
- type StreamingClientStatus
- type StreamingCode
- type StreamingError
- func AsStreamingError(err error) *StreamingError
- func New(code streamingpb.StreamingCode, format string, args ...interface{}) *StreamingError
- func NewChannelFenced(channel string) *StreamingError
- func NewChannelNotExist(channel string) *StreamingError
- func NewIgnoreOperation(format string, args ...interface{}) *StreamingError
- func NewInner(format string, args ...interface{}) *StreamingError
- func NewInvaildArgument(format string, args ...interface{}) *StreamingError
- func NewInvalidRequestSeq(format string, args ...interface{}) *StreamingError
- func NewInvalidTransactionState(operation string, expectState message.TxnState, currentState message.TxnState) *StreamingError
- func NewOnShutdownError(format string, args ...interface{}) *StreamingError
- func NewTransactionExpired(format string, args ...interface{}) *StreamingError
- func NewUnknownError(format string, args ...interface{}) *StreamingError
- func NewUnmatchedChannelTerm(channel string, expectedTerm int64, currentTerm int64) *StreamingError
- func NewUnrecoverableError(format string, args ...interface{}) *StreamingError
- func (e *StreamingError) AsPBError() *streamingpb.StreamingError
- func (e *StreamingError) Error() string
- func (e *StreamingError) IsSkippedOperation() bool
- func (e *StreamingError) IsTxnUnavilable() bool
- func (e *StreamingError) IsUnrecoverable() bool
- func (e *StreamingError) IsWrongStreamingNode() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertStreamingError ¶
ConvertStreamingError convert error to StreamingStatus. Used in client side.
func IsCanceled ¶
Check if the error is canceled. Used in client side.
func NewClientStreamWrapper ¶
func NewClientStreamWrapper(method string, stream grpc.ClientStream) grpc.ClientStream
NewClientStreamWrapper returns a grpc.ClientStream that wraps the given stream.
func NewGRPCStatusFromStreamingError ¶
func NewGRPCStatusFromStreamingError(e *StreamingError) *status.Status
NewGRPCStatusFromStreamingError converts StreamingError to grpc status. Should be called at server-side.
Types ¶
type StreamingClientStatus ¶
StreamingClientStatus is a wrapper of grpc status. Should be used in client side.
func (*StreamingClientStatus) Error ¶
func (s *StreamingClientStatus) Error() string
Error implements StreamingStatus as error.
func (*StreamingClientStatus) GRPCStatus ¶
func (s *StreamingClientStatus) GRPCStatus() *status.Status
For converting with status.Status. !!! DO NOT Delete this method. IsCanceled function use it.
func (*StreamingClientStatus) TryIntoStreamingError ¶
func (s *StreamingClientStatus) TryIntoStreamingError() *StreamingError
TryIntoStreamingError try to convert StreamingStatus to StreamingError.
type StreamingCode ¶
type StreamingCode streamingpb.StreamingCode
StreamingError is the error type for streaming internal module. Should be used at logic layer.
type StreamingError ¶
type StreamingError streamingpb.StreamingError
StreamingError is the error type for streaming internal module. Should be used at logic layer.
func AsStreamingError ¶
func AsStreamingError(err error) *StreamingError
As implements StreamingError as error.
func New ¶
func New(code streamingpb.StreamingCode, format string, args ...interface{}) *StreamingError
New creates a new StreamingError with the given code and cause.
func NewChannelFenced ¶
func NewChannelFenced(channel string) *StreamingError
NewChannelFenced creates a new StreamingError with code STREAMING_CODE_CHANNEL_FENCED. TODO: Unused by now, add it after enable wal fence.
func NewChannelNotExist ¶
func NewChannelNotExist(channel string) *StreamingError
NewChannelNotExist creates a new StreamingError with code STREAMING_CODE_CHANNEL_NOT_EXIST.
func NewIgnoreOperation ¶
func NewIgnoreOperation(format string, args ...interface{}) *StreamingError
NewIgnoreOperation creates a new StreamingError with code STREAMING_CODE_IGNORED_OPERATION.
func NewInner ¶
func NewInner(format string, args ...interface{}) *StreamingError
NewInner creates a new StreamingError with code STREAMING_CODE_INNER.
func NewInvaildArgument ¶
func NewInvaildArgument(format string, args ...interface{}) *StreamingError
NewInvaildArgument creates a new StreamingError with code STREAMING_CODE_INVAILD_ARGUMENT.
func NewInvalidRequestSeq ¶
func NewInvalidRequestSeq(format string, args ...interface{}) *StreamingError
NewInvalidRequestSeq creates a new StreamingError with code STREAMING_CODE_INVALID_REQUEST_SEQ.
func NewInvalidTransactionState ¶
func NewInvalidTransactionState(operation string, expectState message.TxnState, currentState message.TxnState) *StreamingError
NewInvalidTransactionState creates a new StreamingError with code STREAMING_CODE_INVALID_TRANSACTION_STATE.
func NewOnShutdownError ¶
func NewOnShutdownError(format string, args ...interface{}) *StreamingError
NewOnShutdownError creates a new StreamingError with code STREAMING_CODE_ON_SHUTDOWN.
func NewTransactionExpired ¶
func NewTransactionExpired(format string, args ...interface{}) *StreamingError
NewTransactionExpired creates a new StreamingError with code STREAMING_CODE_TRANSACTION_EXPIRED.
func NewUnknownError ¶
func NewUnknownError(format string, args ...interface{}) *StreamingError
NewUnknownError creates a new StreamingError with code STREAMING_CODE_UNKNOWN.
func NewUnmatchedChannelTerm ¶
func NewUnmatchedChannelTerm(channel string, expectedTerm int64, currentTerm int64) *StreamingError
NewUnmatchedChannelTerm creates a new StreamingError with code StreamingCode_STREAMING_CODE_UNMATCHED_CHANNEL_TERM.
func NewUnrecoverableError ¶
func NewUnrecoverableError(format string, args ...interface{}) *StreamingError
NewUnrecoverableError creates a new StreamingError with code STREAMING_CODE_UNRECOVERABLE.
func (*StreamingError) AsPBError ¶
func (e *StreamingError) AsPBError() *streamingpb.StreamingError
AsPBError convert StreamingError to streamingpb.StreamingError.
func (*StreamingError) Error ¶
func (e *StreamingError) Error() string
Error implements StreamingError as error.
func (*StreamingError) IsSkippedOperation ¶
func (e *StreamingError) IsSkippedOperation() bool
IsSkippedOperation returns true if the operation is ignored or skipped.
func (*StreamingError) IsTxnUnavilable ¶
func (e *StreamingError) IsTxnUnavilable() bool
IsTxnUnavilable returns true if the transaction is unavailable.
func (*StreamingError) IsUnrecoverable ¶
func (e *StreamingError) IsUnrecoverable() bool
IsUnrecoverable returns true if the error is unrecoverable. Stop resuming retry and report to user.
func (*StreamingError) IsWrongStreamingNode ¶
func (e *StreamingError) IsWrongStreamingNode() bool
IsWrongStreamingNode returns true if the error is caused by wrong streamingnode. Client for producing and consuming should report these error to coord and block until new assignment term coming.