MCPcopy Create free account
hub / github.com/cloudwan/gohan / Sync

Interface Sync

sync/sync.go:30–47  ·  view source on GitHub ↗

Sync is a interface for sync servers

Source from the content-addressed store, hash-verified

28
29//Sync is a interface for sync servers
30type Sync interface {
31 HasLock(path string) bool
32 Lock(path string, block bool) (notifyLost chan struct{}, err error)
33 Unlock(path string) error
34 Fetch(path string) (*Node, error)
35 Update(path, json string) error
36 Delete(path string, prefix bool) error
37 // Watch monitors changes on path and emits Events to responseChan.
38 // Close stopChan to cancel.
39 // You can specify the revision to start watching,
40 // give RevisionCurrent when you want to start from the current revision.
41 // Returns an error when gets any error including connection failures.
42 Watch(path string, responseChan chan *Event, stopChan chan bool, revision int64) error
43 //WatchContext keep watch update under the path until context is canceled.
44 WatchContext(ctx context.Context, path string, revision int64) <-chan *Event
45 GetProcessID() string
46 Close()
47}
48
49//Event is a struct for Watch response
50type Event struct {

Callers 76

TestLockUnblockingFunction · 0.65
TestLockBlockingFunction · 0.65
GetFunction · 0.65
ClearFunction · 0.65
withinLockedMigrationFunction · 0.65
cli_test.goFile · 0.65
RunMethod · 0.65
processSyncWatchMethod · 0.65
startCRONProcessFunction · 0.65
RunMethod · 0.65
GetFunction · 0.65
ClearFunction · 0.65

Implementers 5

Syncsync/etcd/etcd.go
MockSyncsync/mocks/sync_mock.go
MockSyncMockRecordersync/mocks/sync_mock.go
Syncsync/noop/noop.go
Syncsync/etcdv3/etcd.go

Calls

no outgoing calls

Tested by

no test coverage detected