Sync is a interface for sync servers
| 28 | |
| 29 | //Sync is a interface for sync servers |
| 30 | type 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 |
| 50 | type Event struct { |
no outgoing calls
no test coverage detected