fix pipeline #365

Merged
vtolstov merged 14 commits from :atolstikhin-v3 into v3 2024-12-06 19:05:28 +03:00
Showing only changes of commit e0f3418e80 - Show all commits

View File

@ -6,6 +6,14 @@ import (
"errors" "errors"
) )
type EventType int
const (
EventTypeUnknown = iota
EventTypeConnect
EventTypeDisconnect
)
var ( var (
// ErrNotFound is returned when a key doesn't exist // ErrNotFound is returned when a key doesn't exist
ErrNotFound = errors.New("not found") ErrNotFound = errors.New("not found")
@ -17,6 +25,11 @@ var (
DefaultSeparator = "/" DefaultSeparator = "/"
) )
type Event interface {
Error() error
Type() EventType
}
// Store is a data storage interface // Store is a data storage interface
type Store interface { type Store interface {
Name() string Name() string
@ -41,3 +54,12 @@ type Store interface {
// String returns the name of the implementation. // String returns the name of the implementation.
String() string String() string
} }
type Watcher interface {
// Next is a blocking call
Next() (Event, error)
// Stop stops the watcher
Stop()
}
func Watch(context.Context) (Watcher, error)