Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetermineDecoder ¶ added in v0.2.0
func DetermineDecoder(contentType string) (encoding.DecodeRawFunc, error)
DetermineDecoder determines the decoder based on the content type.
Types ¶
type Component ¶ added in v0.4.2
type Component struct {
// contains filtered or unexported fields
}
Component implementation of a async component.
func New ¶ added in v0.4.2
func New(name string, p ProcessorFunc, cf ConsumerFactory, oo ...OptionFunc) (*Component, error)
New returns a new async component. The default behavior is to return a error of failure. Use options to change the default behavior.
type Consumer ¶ added in v0.4.2
type Consumer interface { Consume(context.Context) (<-chan Message, <-chan error, error) Close() error Info() map[string]interface{} }
Consumer interface which every specific consumer has to implement.
type ConsumerFactory ¶ added in v0.7.0
ConsumerFactory interface for creating consumers.
type FailStrategy ¶ added in v0.5.2
type FailStrategy int
FailStrategy type definition.
const ( // NackExitStrategy does not acknowledge the message and exits the application on error. NackExitStrategy FailStrategy = 0 // NackStrategy does not acknowledge the message, leaving it for reprocessing, and continues. NackStrategy FailStrategy = 1 // AckStrategy acknowledges message and continues. AckStrategy FailStrategy = 2 )
func (FailStrategy) String ¶ added in v0.7.1
func (fs FailStrategy) String() string
type Message ¶ added in v0.2.0
type Message interface { Context() context.Context Decode(v interface{}) error Ack() error Nack() error }
Message interface for defining messages that are handled by the async component.
type OptionFunc ¶ added in v0.5.2
OptionFunc definition for configuring the component in a functional way.
func ConsumerRetry ¶ added in v0.7.0
func ConsumerRetry(retries int, retryWait time.Duration) OptionFunc
ConsumerRetry set's the parameters for the retry policy of the consumer.
func FailureStrategy ¶ added in v0.5.2
func FailureStrategy(fs FailStrategy) OptionFunc
FailureStrategy option for setting the strategy of handling failures in the async component.
type ProcessorFunc ¶ added in v0.3.1
ProcessorFunc definition of a async processor.