github.com/pf-qiu/concourse/v6@v6.7.3-0.20201207032516-1f455d73275f/atc/api/containerserver/containerserverfakes/fake_intercept_timeout_factory.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package containerserverfakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"github.com/pf-qiu/concourse/v6/atc/api/containerserver"
     8  )
     9  
    10  type FakeInterceptTimeoutFactory struct {
    11  	NewInterceptTimeoutStub        func() containerserver.InterceptTimeout
    12  	newInterceptTimeoutMutex       sync.RWMutex
    13  	newInterceptTimeoutArgsForCall []struct {
    14  	}
    15  	newInterceptTimeoutReturns struct {
    16  		result1 containerserver.InterceptTimeout
    17  	}
    18  	newInterceptTimeoutReturnsOnCall map[int]struct {
    19  		result1 containerserver.InterceptTimeout
    20  	}
    21  	invocations      map[string][][]interface{}
    22  	invocationsMutex sync.RWMutex
    23  }
    24  
    25  func (fake *FakeInterceptTimeoutFactory) NewInterceptTimeout() containerserver.InterceptTimeout {
    26  	fake.newInterceptTimeoutMutex.Lock()
    27  	ret, specificReturn := fake.newInterceptTimeoutReturnsOnCall[len(fake.newInterceptTimeoutArgsForCall)]
    28  	fake.newInterceptTimeoutArgsForCall = append(fake.newInterceptTimeoutArgsForCall, struct {
    29  	}{})
    30  	fake.recordInvocation("NewInterceptTimeout", []interface{}{})
    31  	fake.newInterceptTimeoutMutex.Unlock()
    32  	if fake.NewInterceptTimeoutStub != nil {
    33  		return fake.NewInterceptTimeoutStub()
    34  	}
    35  	if specificReturn {
    36  		return ret.result1
    37  	}
    38  	fakeReturns := fake.newInterceptTimeoutReturns
    39  	return fakeReturns.result1
    40  }
    41  
    42  func (fake *FakeInterceptTimeoutFactory) NewInterceptTimeoutCallCount() int {
    43  	fake.newInterceptTimeoutMutex.RLock()
    44  	defer fake.newInterceptTimeoutMutex.RUnlock()
    45  	return len(fake.newInterceptTimeoutArgsForCall)
    46  }
    47  
    48  func (fake *FakeInterceptTimeoutFactory) NewInterceptTimeoutCalls(stub func() containerserver.InterceptTimeout) {
    49  	fake.newInterceptTimeoutMutex.Lock()
    50  	defer fake.newInterceptTimeoutMutex.Unlock()
    51  	fake.NewInterceptTimeoutStub = stub
    52  }
    53  
    54  func (fake *FakeInterceptTimeoutFactory) NewInterceptTimeoutReturns(result1 containerserver.InterceptTimeout) {
    55  	fake.newInterceptTimeoutMutex.Lock()
    56  	defer fake.newInterceptTimeoutMutex.Unlock()
    57  	fake.NewInterceptTimeoutStub = nil
    58  	fake.newInterceptTimeoutReturns = struct {
    59  		result1 containerserver.InterceptTimeout
    60  	}{result1}
    61  }
    62  
    63  func (fake *FakeInterceptTimeoutFactory) NewInterceptTimeoutReturnsOnCall(i int, result1 containerserver.InterceptTimeout) {
    64  	fake.newInterceptTimeoutMutex.Lock()
    65  	defer fake.newInterceptTimeoutMutex.Unlock()
    66  	fake.NewInterceptTimeoutStub = nil
    67  	if fake.newInterceptTimeoutReturnsOnCall == nil {
    68  		fake.newInterceptTimeoutReturnsOnCall = make(map[int]struct {
    69  			result1 containerserver.InterceptTimeout
    70  		})
    71  	}
    72  	fake.newInterceptTimeoutReturnsOnCall[i] = struct {
    73  		result1 containerserver.InterceptTimeout
    74  	}{result1}
    75  }
    76  
    77  func (fake *FakeInterceptTimeoutFactory) Invocations() map[string][][]interface{} {
    78  	fake.invocationsMutex.RLock()
    79  	defer fake.invocationsMutex.RUnlock()
    80  	fake.newInterceptTimeoutMutex.RLock()
    81  	defer fake.newInterceptTimeoutMutex.RUnlock()
    82  	copiedInvocations := map[string][][]interface{}{}
    83  	for key, value := range fake.invocations {
    84  		copiedInvocations[key] = value
    85  	}
    86  	return copiedInvocations
    87  }
    88  
    89  func (fake *FakeInterceptTimeoutFactory) recordInvocation(key string, args []interface{}) {
    90  	fake.invocationsMutex.Lock()
    91  	defer fake.invocationsMutex.Unlock()
    92  	if fake.invocations == nil {
    93  		fake.invocations = map[string][][]interface{}{}
    94  	}
    95  	if fake.invocations[key] == nil {
    96  		fake.invocations[key] = [][]interface{}{}
    97  	}
    98  	fake.invocations[key] = append(fake.invocations[key], args)
    99  }
   100  
   101  var _ containerserver.InterceptTimeoutFactory = new(FakeInterceptTimeoutFactory)