response

package
v3.57.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2021 License: MIT Imports: 1 Imported by: 7

Documentation

Overview

Package response contains implementations of types.Response.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoAck = errors.New("message failed to reach a target destination")
)

Errors for response types.

Functions

This section is empty.

Types

type Ack

type Ack struct{}

Ack is a response type that indicates the message has reached a destination and can be acknowledged upstream.

func NewAck

func NewAck() Ack

NewAck returns an Ack response type.

func (Ack) Error

func (a Ack) Error() error

Error returns the underlying error.

func (Ack) SkipAck

func (a Ack) SkipAck() bool

SkipAck indicates whether a successful message should be acknowledged.

type Error

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

Error is a response type that wraps an error, this error will be interpreted as a failed message signal if the error is non-nil, a nil error indicates the message has successfully ended up somewhere and can be acknowledged upstream.

func NewError

func NewError(err error) Error

NewError returns a response that wraps an error (nil error signals successful receipt).

func (Error) Error

func (o Error) Error() error

Error returns the underlying error.

func (Error) SkipAck

func (o Error) SkipAck() bool

SkipAck indicates whether a successful message should be acknowledged. TODO: V4 Remove this once batch processor is removed.

type Noack

type Noack struct{}

Noack is a response type that indicates the message has failed to reach a destination.

func NewNoack

func NewNoack() Noack

NewNoack returns a Nack response type.

func (Noack) Error

func (a Noack) Error() error

Error returns the underlying error.

func (Noack) SkipAck

func (a Noack) SkipAck() bool

SkipAck indicates whether a successful message should be acknowledged.

type Unack

type Unack struct{}

Unack is a response type that indicates the message has reached a destination but should not yet be acknowledged, if possible. Some input types will be able to continue sending messages, and once an acknowledgement has been received will propagate the acknowledgement for all unacknowledged messages.

It is considered correct for certain inputs to acknowledge based on an Unack response if they are locked in a request/response loop. For example, the HTTP input might return a 200 code from this response.

TODO: V4 Remove this once batch processor is removed.

func NewUnack

func NewUnack() Unack

NewUnack returns an Unack response type.

func (Unack) Error

func (u Unack) Error() error

Error returns the underlying error.

func (Unack) SkipAck

func (u Unack) SkipAck() bool

SkipAck indicates whether a successful message should be acknowledged.

Jump to

Keyboard shortcuts

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