Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Callbacks ¶
type Callbacks interface { // RegisterConnection can be fired as often as requied. // Dispatchers will be started against this connection for all persisted subscriptions that match via the supplied function. // It can be fired multiple times for the same connection ID, to update the subscription list // For a "connect-out" style plugin (MQTT/AMQP/JMS broker), you might fire it at startup (from Init) for each target queue, with a subscription match // For a "connect-in" style plugin (inbound WebSocket connections), you fire it every time the client application connects attaches to a subscription RegisterConnection(connID string, matcher SubscriptionMatcher) error // EphemeralSubscription creates an ephemeral (non-durable) subscription, and associates it with a connection EphemeralSubscription(connID, namespace string, filter *fftypes.SubscriptionFilter, options *fftypes.SubscriptionOptions) error // ConnnectionClosed is a notification that a connection has closed, and all dispatchers should be re-allocated. // Note the plugin must not crash if it receives PublishEvent calls on the connID after the ConnectionClosed event is fired ConnnectionClosed(connID string) // DeliveryResponse responds to a previous event delivery, to either: // - Acknowledge it: the offset for the associated subscription can move forwards // * Note all gaps must fill before the offset can move forwards, so this message might still be redelivered if streaming ahead // * If a message is included in the response, then that will be automatically sent with the correct CID // - Reject it: This resets the associated subscription back to the last committed offset // * Note all message since the last committed offet will be redelivered, so additional messages to be redelivered if streaming ahead DeliveryResponse(connID string, inflight *fftypes.EventDeliveryResponse) }
type Capabilities ¶
type Capabilities struct { // ChangeEvents is whether change events are supported ChangeEvents bool }
type ChangeEventListener ¶
type ChangeEventListener interface { // ChangeEvent delivers a change event - no ack for these ChangeEvent(connID string, ce *fftypes.ChangeEvent) }
ChangeEventListener is an optional interface for delivering database change events, only supported for ephemeral connections
type Plugin ¶
type Plugin interface { fftypes.Named // InitPrefix initializes the set of configuration options that are valid, with defaults. Called on all plugins. InitPrefix(prefix config.Prefix) // Init initializes the plugin, with configuration // Returns the supported featureset of the interface Init(ctx context.Context, prefix config.Prefix, callbacks Callbacks) error // Capabilities returns capabilities - not called until after Init Capabilities() *Capabilities // GetOptionsSchema returns a JSON schema for the transport specific options GetOptionsSchema(context.Context) string // ValidateOptions verifies a set of input options, prior to storage of a new subscription // The plugin can modify the core subscription options, such as overriding whether data is delivered. ValidateOptions(options *fftypes.SubscriptionOptions) error // DeliveryRequest requests delivery of work on a connection, which must later be responded to // Data will only be supplied as non-nil if the subscription is set to include data DeliveryRequest(connID string, sub *fftypes.Subscription, event *fftypes.EventDelivery, data []*fftypes.Data) error }
Plugin is the interface implemented by event interface - Delivery to generic application code - WebSockets, Webhooks, AMQP etc. - Integration of frameworks for coordination of multi-party compute - Hyperledger Avalon, etc.
type PluginAll ¶
type PluginAll interface { Plugin ChangeEventListener }
PluginAll is a combined interface for easy mocking, with all optional features
type SubscriptionMatcher ¶
type SubscriptionMatcher func(fftypes.SubscriptionRef) bool
Click to show internal directories.
Click to hide internal directories.