github.com/jbking/gohan@v0.0.0-20151217002006-b41ccf1c2a96/sync/noop/noop.go (about) 1 // Copyright (C) 2015 NTT Innovation Institute, Inc. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 12 // implied. 13 // See the License for the specific language governing permissions and 14 // limitations under the License. 15 16 package noop 17 18 import "github.com/cloudwan/gohan/sync" 19 20 //Sync is struct for noop 21 type Sync struct { 22 } 23 24 //NewSync creates noop sync instance 25 func NewSync() *Sync { 26 return &Sync{} 27 } 28 29 //Update sync update sync 30 func (sync *Sync) Update(path, json string) error { 31 return nil 32 } 33 34 //Delete sync update sync 35 func (sync *Sync) Delete(path, json string) error { 36 return nil 37 } 38 39 //HasLock checks is current process has lock 40 func (sync *Sync) HasLock(path string) bool { 41 return false 42 } 43 44 //Lock get lock for path 45 func (sync *Sync) Lock(path string, block bool) error { 46 return nil 47 } 48 49 //Unlock unlocks paths 50 func (sync *Sync) Unlock(path string) error { 51 return nil 52 } 53 54 //Watch keep watch update under the path 55 func (sync *Sync) Watch(path string, responseChan chan *sync.Event, stopChan chan bool) error { 56 return nil 57 }