github.com/mmatczuk/gohan@v0.0.0-20170206152520-30e45d9bdb69/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 string) error {
    36  	return nil
    37  }
    38  
    39  func (sync *Sync) Fetch(path string) (*sync.Node, error) {
    40  	return nil, nil
    41  }
    42  
    43  //HasLock checks is current process has lock
    44  func (sync *Sync) HasLock(path string) bool {
    45  	return false
    46  }
    47  
    48  //Lock get lock for path
    49  func (sync *Sync) Lock(path string, block bool) error {
    50  	return nil
    51  }
    52  
    53  //Unlock unlocks paths
    54  func (sync *Sync) Unlock(path string) error {
    55  	return nil
    56  }
    57  
    58  //Watch keep watch update under the path
    59  func (sync *Sync) Watch(path string, responseChan chan *sync.Event, stopChan chan bool, revision int64) error {
    60  	return nil
    61  }
    62  
    63  func (sync *Sync) Close() {
    64  
    65  }