Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongoWatcher ¶
type MongoWatcher struct {
// contains filtered or unexported fields
}
Watcher represents a listener of database changes.
func NewMongoWatcher ¶
func NewMongoWatcher(db *mongo.Database, dbName string, handler WatcherFunc, logger *zap.Logger) *MongoWatcher
NewWatcher creates a new database event watcher.
type RedisSubscriber ¶
type RedisSubscriber struct {
// contains filtered or unexported fields
}
RedisSubscriber is a redis subscriber.
func NewRedisSubscriber ¶
func NewRedisSubscriber(ctx context.Context, redisClient *redis.Client, prefix, channel string, handler WatcherFunc, log *zap.Logger) (*RedisSubscriber, error)
NewRedisSubscriber create a new redis subscriber.
type WatcherFunc ¶
type WatcherFunc func(*Event)
WatcherFunc is a function to send database changes.
Click to show internal directories.
Click to hide internal directories.