github.com/pf-qiu/concourse/v6@v6.7.3-0.20201207032516-1f455d73275f/atc/db/dbfakes/fake_destroying_volume.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package dbfakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"github.com/pf-qiu/concourse/v6/atc/db"
     8  )
     9  
    10  type FakeDestroyingVolume struct {
    11  	DestroyStub        func() (bool, error)
    12  	destroyMutex       sync.RWMutex
    13  	destroyArgsForCall []struct {
    14  	}
    15  	destroyReturns struct {
    16  		result1 bool
    17  		result2 error
    18  	}
    19  	destroyReturnsOnCall map[int]struct {
    20  		result1 bool
    21  		result2 error
    22  	}
    23  	HandleStub        func() string
    24  	handleMutex       sync.RWMutex
    25  	handleArgsForCall []struct {
    26  	}
    27  	handleReturns struct {
    28  		result1 string
    29  	}
    30  	handleReturnsOnCall map[int]struct {
    31  		result1 string
    32  	}
    33  	WorkerNameStub        func() string
    34  	workerNameMutex       sync.RWMutex
    35  	workerNameArgsForCall []struct {
    36  	}
    37  	workerNameReturns struct {
    38  		result1 string
    39  	}
    40  	workerNameReturnsOnCall map[int]struct {
    41  		result1 string
    42  	}
    43  	invocations      map[string][][]interface{}
    44  	invocationsMutex sync.RWMutex
    45  }
    46  
    47  func (fake *FakeDestroyingVolume) Destroy() (bool, error) {
    48  	fake.destroyMutex.Lock()
    49  	ret, specificReturn := fake.destroyReturnsOnCall[len(fake.destroyArgsForCall)]
    50  	fake.destroyArgsForCall = append(fake.destroyArgsForCall, struct {
    51  	}{})
    52  	fake.recordInvocation("Destroy", []interface{}{})
    53  	fake.destroyMutex.Unlock()
    54  	if fake.DestroyStub != nil {
    55  		return fake.DestroyStub()
    56  	}
    57  	if specificReturn {
    58  		return ret.result1, ret.result2
    59  	}
    60  	fakeReturns := fake.destroyReturns
    61  	return fakeReturns.result1, fakeReturns.result2
    62  }
    63  
    64  func (fake *FakeDestroyingVolume) DestroyCallCount() int {
    65  	fake.destroyMutex.RLock()
    66  	defer fake.destroyMutex.RUnlock()
    67  	return len(fake.destroyArgsForCall)
    68  }
    69  
    70  func (fake *FakeDestroyingVolume) DestroyCalls(stub func() (bool, error)) {
    71  	fake.destroyMutex.Lock()
    72  	defer fake.destroyMutex.Unlock()
    73  	fake.DestroyStub = stub
    74  }
    75  
    76  func (fake *FakeDestroyingVolume) DestroyReturns(result1 bool, result2 error) {
    77  	fake.destroyMutex.Lock()
    78  	defer fake.destroyMutex.Unlock()
    79  	fake.DestroyStub = nil
    80  	fake.destroyReturns = struct {
    81  		result1 bool
    82  		result2 error
    83  	}{result1, result2}
    84  }
    85  
    86  func (fake *FakeDestroyingVolume) DestroyReturnsOnCall(i int, result1 bool, result2 error) {
    87  	fake.destroyMutex.Lock()
    88  	defer fake.destroyMutex.Unlock()
    89  	fake.DestroyStub = nil
    90  	if fake.destroyReturnsOnCall == nil {
    91  		fake.destroyReturnsOnCall = make(map[int]struct {
    92  			result1 bool
    93  			result2 error
    94  		})
    95  	}
    96  	fake.destroyReturnsOnCall[i] = struct {
    97  		result1 bool
    98  		result2 error
    99  	}{result1, result2}
   100  }
   101  
   102  func (fake *FakeDestroyingVolume) Handle() string {
   103  	fake.handleMutex.Lock()
   104  	ret, specificReturn := fake.handleReturnsOnCall[len(fake.handleArgsForCall)]
   105  	fake.handleArgsForCall = append(fake.handleArgsForCall, struct {
   106  	}{})
   107  	fake.recordInvocation("Handle", []interface{}{})
   108  	fake.handleMutex.Unlock()
   109  	if fake.HandleStub != nil {
   110  		return fake.HandleStub()
   111  	}
   112  	if specificReturn {
   113  		return ret.result1
   114  	}
   115  	fakeReturns := fake.handleReturns
   116  	return fakeReturns.result1
   117  }
   118  
   119  func (fake *FakeDestroyingVolume) HandleCallCount() int {
   120  	fake.handleMutex.RLock()
   121  	defer fake.handleMutex.RUnlock()
   122  	return len(fake.handleArgsForCall)
   123  }
   124  
   125  func (fake *FakeDestroyingVolume) HandleCalls(stub func() string) {
   126  	fake.handleMutex.Lock()
   127  	defer fake.handleMutex.Unlock()
   128  	fake.HandleStub = stub
   129  }
   130  
   131  func (fake *FakeDestroyingVolume) HandleReturns(result1 string) {
   132  	fake.handleMutex.Lock()
   133  	defer fake.handleMutex.Unlock()
   134  	fake.HandleStub = nil
   135  	fake.handleReturns = struct {
   136  		result1 string
   137  	}{result1}
   138  }
   139  
   140  func (fake *FakeDestroyingVolume) HandleReturnsOnCall(i int, result1 string) {
   141  	fake.handleMutex.Lock()
   142  	defer fake.handleMutex.Unlock()
   143  	fake.HandleStub = nil
   144  	if fake.handleReturnsOnCall == nil {
   145  		fake.handleReturnsOnCall = make(map[int]struct {
   146  			result1 string
   147  		})
   148  	}
   149  	fake.handleReturnsOnCall[i] = struct {
   150  		result1 string
   151  	}{result1}
   152  }
   153  
   154  func (fake *FakeDestroyingVolume) WorkerName() string {
   155  	fake.workerNameMutex.Lock()
   156  	ret, specificReturn := fake.workerNameReturnsOnCall[len(fake.workerNameArgsForCall)]
   157  	fake.workerNameArgsForCall = append(fake.workerNameArgsForCall, struct {
   158  	}{})
   159  	fake.recordInvocation("WorkerName", []interface{}{})
   160  	fake.workerNameMutex.Unlock()
   161  	if fake.WorkerNameStub != nil {
   162  		return fake.WorkerNameStub()
   163  	}
   164  	if specificReturn {
   165  		return ret.result1
   166  	}
   167  	fakeReturns := fake.workerNameReturns
   168  	return fakeReturns.result1
   169  }
   170  
   171  func (fake *FakeDestroyingVolume) WorkerNameCallCount() int {
   172  	fake.workerNameMutex.RLock()
   173  	defer fake.workerNameMutex.RUnlock()
   174  	return len(fake.workerNameArgsForCall)
   175  }
   176  
   177  func (fake *FakeDestroyingVolume) WorkerNameCalls(stub func() string) {
   178  	fake.workerNameMutex.Lock()
   179  	defer fake.workerNameMutex.Unlock()
   180  	fake.WorkerNameStub = stub
   181  }
   182  
   183  func (fake *FakeDestroyingVolume) WorkerNameReturns(result1 string) {
   184  	fake.workerNameMutex.Lock()
   185  	defer fake.workerNameMutex.Unlock()
   186  	fake.WorkerNameStub = nil
   187  	fake.workerNameReturns = struct {
   188  		result1 string
   189  	}{result1}
   190  }
   191  
   192  func (fake *FakeDestroyingVolume) WorkerNameReturnsOnCall(i int, result1 string) {
   193  	fake.workerNameMutex.Lock()
   194  	defer fake.workerNameMutex.Unlock()
   195  	fake.WorkerNameStub = nil
   196  	if fake.workerNameReturnsOnCall == nil {
   197  		fake.workerNameReturnsOnCall = make(map[int]struct {
   198  			result1 string
   199  		})
   200  	}
   201  	fake.workerNameReturnsOnCall[i] = struct {
   202  		result1 string
   203  	}{result1}
   204  }
   205  
   206  func (fake *FakeDestroyingVolume) Invocations() map[string][][]interface{} {
   207  	fake.invocationsMutex.RLock()
   208  	defer fake.invocationsMutex.RUnlock()
   209  	fake.destroyMutex.RLock()
   210  	defer fake.destroyMutex.RUnlock()
   211  	fake.handleMutex.RLock()
   212  	defer fake.handleMutex.RUnlock()
   213  	fake.workerNameMutex.RLock()
   214  	defer fake.workerNameMutex.RUnlock()
   215  	copiedInvocations := map[string][][]interface{}{}
   216  	for key, value := range fake.invocations {
   217  		copiedInvocations[key] = value
   218  	}
   219  	return copiedInvocations
   220  }
   221  
   222  func (fake *FakeDestroyingVolume) recordInvocation(key string, args []interface{}) {
   223  	fake.invocationsMutex.Lock()
   224  	defer fake.invocationsMutex.Unlock()
   225  	if fake.invocations == nil {
   226  		fake.invocations = map[string][][]interface{}{}
   227  	}
   228  	if fake.invocations[key] == nil {
   229  		fake.invocations[key] = [][]interface{}{}
   230  	}
   231  	fake.invocations[key] = append(fake.invocations[key], args)
   232  }
   233  
   234  var _ db.DestroyingVolume = new(FakeDestroyingVolume)