Documentation
¶
Index ¶
- type Bag
- type Broker
- type Channel
- type Channels
- type Config
- type Dequeue
- type Enqueue
- type Event
- type EventKind
- type EventType
- type EvtDeqCh
- type EvtEnqCh
- type Msg
- type MsgDeqCh
- type MsgEnqCh
- type Option
- func WithHookCommit(hook func()) Option
- func WithNetworkTimeout(t time.Duration) Option
- func WithPolicyAtLeastOnce(n int) Option
- func WithPolicyAtMostOnce(n int) Option
- func WithPollFrequency(t time.Duration) Option
- func WithRetry(backoff Retry) Option
- func WithRetryConstant(t time.Duration, n int) Option
- func WithRetryExponential(t time.Duration, n int, f float64) Option
- func WithRetryLinear(t time.Duration, n int) Option
- func WithRetryNo() Option
- func WithService(service any) Option
- func WithSource(agent string) Option
- func WithStdErr(stderr chan<- error) Option
- func WithTimeToFlight(t time.Duration) Option
- type Policy
- type Retry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bag ¶ added in v0.4.0
Bag is an abstract container for octet stream. Bag is used by the transport to abstract message on the wire.
type Channel ¶ added in v0.9.0
type Channel interface {
Sync()
Close()
}
Channel is abstract concept of channel(s)
type Channels ¶ added in v0.9.0
Channels
func NewChannels ¶ added in v0.9.0
func NewChannels() *Channels
type Config ¶
type Config struct {
// Instance of AWS Service, ...
Service any
// Source is a direct performer of the event.
// A software service that emits action to the stream.
Source string
// Quality of Service Policy
Policy Policy
// Queue capacity
EnqueueCapacity int
DequeueCapacity int
// Retry Policy for service calls
Backoff Retry
// Standard Error I/O channel
StdErr chan<- error
// Frequency to poll broker api
PollFrequency time.Duration
// Time To Flight is a time required by the client to acknowledge the message
TimeToFlight time.Duration
// Timeout for any network operations
NetworkTimeout time.Duration
// Commit hook (executed after each loop iteration)
HookCommit func()
}
type Event ¶ added in v0.5.0
type Event[T any] struct { // // Unique identity for event // It is automatically defined by the library upon the transmission ID string `json:"@id,omitempty"` // // Canonical IRI that defines a type of action. // It is automatically defined by the library upon the transmission Type curie.IRI `json:"@type,omitempty"` // // Direct performer of the event, a software service that emits action to the stream. Agent curie.IRI `json:"agent,omitempty"` // // Indirect participants, a user who initiated an event. Participant curie.IRI `json:"participant,omitempty"` // // ISO8601 timestamps when action has been created // It is automatically defined by the library upon the transmission Created string `json:"created,omitempty"` // // The digest of received event (used internally to ack processing) Digest string `json:"-"` // // The object upon which the event is carried out. Object T `json:"object,omitempty"` }
Event defines immutable fact(s) placed into the queueing system. Event resembles the concept of Action as it is defined by schema.org.
> An action performed by a direct agent and indirect participants upon a direct object.
This type supports development of event-driven solutions that treat data as a collection of immutable facts, which are queried and processed in real-time. These applications processes logical log of events, each event defines a change to current state of the object, i.e. which attributes were inserted, updated or deleted (a kind of diff). The event identifies the object that was changed together with using unique identifier.
type EvtDeqCh ¶ added in v0.9.0
type EvtDeqCh[T any, E EventKind[T]] struct { Msg chan *E // channel to recv message Ack chan *E // channel to send acknowledgement }
msgRecv is the pair of channel, exposed by the queue to clients to recv messages
type EvtEnqCh ¶ added in v0.9.0
type EvtEnqCh[T any, E EventKind[T]] struct { Msg chan *E // channel to send message out Err chan *E // channel to recv failed messages Busy sync.Mutex }
EvtEnqCh is the pair of channel, exposed by the queue to clients to send messages
type Msg ¶
Msg is a generic envelop type for incoming messages. It contains both decoded object and its digest used to acknowledge message.
type MsgDeqCh ¶ added in v0.9.0
type MsgDeqCh[T any] struct { Msg chan *Msg[T] // channel to recv message Ack chan *Msg[T] // channel to send acknowledgement }
msgRecv is the pair of channel, exposed by the queue to clients to recv messages
func NewMsgDeqCh ¶ added in v0.9.0
type MsgEnqCh ¶ added in v0.9.0
type MsgEnqCh[T any] struct { Msg chan T // channel to send message out Err chan T // channel to recv failed messages Busy sync.Mutex }
MsgEnqCh is the pair of channel, exposed by the queue for enqueuing the messages
func NewMsgEnqCh ¶ added in v0.9.0
type Option ¶ added in v0.9.0
type Option func(conf *Config)
Configuration option for queueing broker
func WithHookCommit ¶ added in v0.11.0
func WithHookCommit(hook func()) Option
func WithNetworkTimeout ¶ added in v0.9.0
Timeout for Network I/O
func WithPolicyAtLeastOnce ¶ added in v0.9.0
AtLeastOnce policy ensures delivery of the message to broker
The policy only impacts behavior of Golang channels created by the broker
func WithPolicyAtMostOnce ¶ added in v0.9.0
AtMostOnce is best effort policy, where a message is published without any formal acknowledgement of receipt, and it isn't replayed.
The policy only impacts behavior of Golang channels created by the broker
func WithPollFrequency ¶ added in v0.9.0
Frequency to poll broker api
func WithRetryConstant ¶ added in v0.9.0
Retry operation for N times, with T wait time in between
func WithRetryExponential ¶ added in v0.9.0
Retry operation for N times, with exponential increments by T on each step
func WithRetryLinear ¶ added in v0.9.0
Retry operation for N times, with linear increments by T on each step
func WithService ¶ added in v0.9.0
Configure AWS Service for broker instance
func WithSource ¶ added in v0.9.0
Source is a direct performer of the event. A software service that emits action to the stream.
func WithStdErr ¶ added in v0.9.0
Configure Channel for global errors
func WithTimeToFlight ¶ added in v0.9.0
Time To Flight for message from broker API to consumer
Directories
¶
| Path | Synopsis |
|---|---|
|
broker
|
|
|
embedded
module
|
|
|
eventddb
module
|
|
|
websocket
module
|
|
|
examples
|
|
|
bytes/dequeue
command
|
|
|
bytes/enqueue
command
|
|
|
eventbridge/dequeue
command
|
|
|
eventbridge/enqueue
command
|
|
|
eventbridge/serverless
command
|
|
|
events/dequeue
command
|
|
|
events/enqueue
command
|
|
|
events3/dequeue
command
|
|
|
events3/serverless
command
|
|
|
eventsqs/dequeue
command
|
|
|
eventsqs/enqueue
command
|
|
|
eventsqs/serverless
command
|
|
|
sqs/dequeue
command
|
|
|
sqs/enqueue
command
|
|
|
internal
|
|
|
qtest
module
|
|