Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶ added in v0.17.0
type Event struct { // Type specifies the event type. Type coal.Event // ID is the ID of the changed resource. ID coal.ID // Model is the changed model. // // Note: The model is unavailable for deleted events unless soft delete // has been enabled. Model coal.Model // Stream is the stream this event originated from. Stream *Stream }
Event describes an event.
type Map ¶ added in v0.17.0
type Map map[string]interface{}
Map holds custom data for a subscription.
type Stream ¶ added in v0.17.0
type Stream struct { // Model defines the model this stream is associated with. Model coal.Model // Store defines the store to use for opening the stream. Store *coal.Store // Validator is the callback used to validate subscriptions on the stream. Validator func(*Subscription) error // Selector is the callback used to decide which events are forwarded to // a subscription. Selector func(*Event, *Subscription) bool // SoftDelete can be set to true to support soft deleted documents. SoftDelete bool // contains filtered or unexported fields }
Stream describes a single model stream and how clients can subscribe to it.
type Subscription ¶ added in v0.17.0
type Subscription struct { // Context is the original context of the request. Context *fire.Context // Data is the user-defined data bag. Data Map // Stream is the subscribed stream. Stream *Stream }
Subscription is a single subscription to a stream by a client.
type Watcher ¶ added in v0.17.0
type Watcher struct {
// contains filtered or unexported fields
}
Watcher will watch multiple collections and serve watch requests by clients.
func NewWatcher ¶ added in v0.17.0
NewWatcher creates and returns a new watcher.
func (*Watcher) Action ¶ added in v0.17.0
Action returns an action that should be registered in the group under the "watch" name.
Click to show internal directories.
Click to hide internal directories.