mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-02 19:20:08 -05:00
* bump dependencies Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * bump reva and add config options Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> --------- Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
36 lines
687 B
Go
36 lines
687 B
Go
// Package source is the interface for sources
|
|
package source
|
|
|
|
import (
|
|
"errors"
|
|
"time"
|
|
)
|
|
|
|
var (
|
|
// ErrWatcherStopped is returned when source watcher has been stopped.
|
|
ErrWatcherStopped = errors.New("watcher stopped")
|
|
)
|
|
|
|
// Source is the source from which config is loaded.
|
|
type Source interface {
|
|
Read() (*ChangeSet, error)
|
|
Write(*ChangeSet) error
|
|
Watch() (Watcher, error)
|
|
String() string
|
|
}
|
|
|
|
// ChangeSet represents a set of changes from a source.
|
|
type ChangeSet struct {
|
|
Timestamp time.Time
|
|
Checksum string
|
|
Format string
|
|
Source string
|
|
Data []byte
|
|
}
|
|
|
|
// Watcher watches a source for changes.
|
|
type Watcher interface {
|
|
Next() (*ChangeSet, error)
|
|
Stop() error
|
|
}
|