package
1.4.11
Repository: https://github.com/hyperledger/firefly-common.git
Documentation: pkg.go.dev

# README

Event streams

This package provides a utility for exposing an event stream over WebSockets and Webhooks.

  • Connectivity:
    • WebSockets support for inbound connections
    • Webhooks support for outbound connections
  • Reliability:
    • Workload managed mode: at-least-once delivery
    • Broadcast mode: at-most-once delivery
    • Batching for performance
    • Checkpointing for the at-least-once delivery assurance
  • Convenience for packaging into apps:
    • Plug-in persistence (including allowing you multiple streams with CRUD.Scoped())
    • Out-of-the-box CRUD on event streams, using DB backed storage
    • Server-side topicFilter event filtering (regular expression)
  • Semi-opinionated:
    • How batches are spelled
    • How WebSocket flow control payloads are spelled (start,ack,nack,batch)
  • Flexibility:
    • Bring your own message payload (note topic and sequenceId always added)
    • Bring your own configuration type (must implement DB Scan & Value functions)

Example

A simple in-memory command line pub/sub example is provided:

# Functions

Optional function to generate config directly from YAML configuration using the config package.
Due to how arrays work currently in the config system, this can only be initialized in one section for the whole process.
No description provided by the author
NewGenericEventStreamPersistence is a helper that builds persistence with no extra config Users of this package can use this in cases where they do not have any additional configuration that needs to be persisted, and are happy using dbsql.ResourceBase for IDs.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
on user-supplied context, prior to inserting to DB.
while initializing for startup (so all defaults should be resolved).
No description provided by the author

# Variables

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
not persisted.
not persisted.
not persisted.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
This is a base object, and set of filters, that you can use if: - You are happy exposing all the built-in types of consumer (webhooks/websockets) - You do not need to extend the configuration in any way - You are happy using UUIDs for your IDs per dbsql.ResourceBase semantics A pre-built persistence library is provided, and sample migrations, that work with this structure.
No description provided by the author
No description provided by the author

# Interfaces

Let's us check that the config serializes.
No description provided by the author
DispatcherFactory is the interface to plug in a custom dispatcher, for example to provide local in-process processing of events (in addition to remote WebSocket/Webhook consumption).
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Runtime is the required implementation extension for the EventStream common utility Generics: - ConfigType is the Configuration Type - the custom extensions to the configuration schema - DataType is the Data Type - the payload type that will be delivered to the application.

# Type aliases

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author