25 lines
955 B
Go
25 lines
955 B
Go
package storage
|
|
|
|
import "context"
|
|
|
|
// noopEventNotifier implements EventNotifier with no side effects.
|
|
type noopEventNotifier struct{}
|
|
|
|
// NewNoopEventNotifier returns a no-op event notifier implementation.
|
|
func NewNoopEventNotifier() EventNotifier {
|
|
return &noopEventNotifier{}
|
|
}
|
|
|
|
func (n *noopEventNotifier) NotifyStored(ctx context.Context, event *StorageEvent) error { return nil }
|
|
func (n *noopEventNotifier) NotifyRetrieved(ctx context.Context, event *StorageEvent) error {
|
|
return nil
|
|
}
|
|
func (n *noopEventNotifier) NotifyUpdated(ctx context.Context, event *StorageEvent) error { return nil }
|
|
func (n *noopEventNotifier) NotifyDeleted(ctx context.Context, event *StorageEvent) error { return nil }
|
|
func (n *noopEventNotifier) Subscribe(ctx context.Context, eventType EventType, handler EventHandler) error {
|
|
return nil
|
|
}
|
|
func (n *noopEventNotifier) Unsubscribe(ctx context.Context, eventType EventType, handler EventHandler) error {
|
|
return nil
|
|
}
|