github.com/ablease/cli@v6.37.1-0.20180613014814-3adbb7d7fb19+incompatible/cf/api/logs/logsfakes/fake_loggable.go (about)

     1  // This file was generated by counterfeiter
     2  package logsfakes
     3  
     4  import (
     5  	"sync"
     6  	"time"
     7  
     8  	"code.cloudfoundry.org/cli/cf/api/logs"
     9  )
    10  
    11  type FakeLoggable struct {
    12  	ToLogStub        func(loc *time.Location) string
    13  	toLogMutex       sync.RWMutex
    14  	toLogArgsForCall []struct {
    15  		loc *time.Location
    16  	}
    17  	toLogReturns struct {
    18  		result1 string
    19  	}
    20  	ToSimpleLogStub        func() string
    21  	toSimpleLogMutex       sync.RWMutex
    22  	toSimpleLogArgsForCall []struct{}
    23  	toSimpleLogReturns     struct {
    24  		result1 string
    25  	}
    26  	GetSourceNameStub        func() string
    27  	getSourceNameMutex       sync.RWMutex
    28  	getSourceNameArgsForCall []struct{}
    29  	getSourceNameReturns     struct {
    30  		result1 string
    31  	}
    32  	invocations      map[string][][]interface{}
    33  	invocationsMutex sync.RWMutex
    34  }
    35  
    36  func (fake *FakeLoggable) ToLog(loc *time.Location) string {
    37  	fake.toLogMutex.Lock()
    38  	fake.toLogArgsForCall = append(fake.toLogArgsForCall, struct {
    39  		loc *time.Location
    40  	}{loc})
    41  	fake.recordInvocation("ToLog", []interface{}{loc})
    42  	fake.toLogMutex.Unlock()
    43  	if fake.ToLogStub != nil {
    44  		return fake.ToLogStub(loc)
    45  	} else {
    46  		return fake.toLogReturns.result1
    47  	}
    48  }
    49  
    50  func (fake *FakeLoggable) ToLogCallCount() int {
    51  	fake.toLogMutex.RLock()
    52  	defer fake.toLogMutex.RUnlock()
    53  	return len(fake.toLogArgsForCall)
    54  }
    55  
    56  func (fake *FakeLoggable) ToLogArgsForCall(i int) *time.Location {
    57  	fake.toLogMutex.RLock()
    58  	defer fake.toLogMutex.RUnlock()
    59  	return fake.toLogArgsForCall[i].loc
    60  }
    61  
    62  func (fake *FakeLoggable) ToLogReturns(result1 string) {
    63  	fake.ToLogStub = nil
    64  	fake.toLogReturns = struct {
    65  		result1 string
    66  	}{result1}
    67  }
    68  
    69  func (fake *FakeLoggable) ToSimpleLog() string {
    70  	fake.toSimpleLogMutex.Lock()
    71  	fake.toSimpleLogArgsForCall = append(fake.toSimpleLogArgsForCall, struct{}{})
    72  	fake.recordInvocation("ToSimpleLog", []interface{}{})
    73  	fake.toSimpleLogMutex.Unlock()
    74  	if fake.ToSimpleLogStub != nil {
    75  		return fake.ToSimpleLogStub()
    76  	} else {
    77  		return fake.toSimpleLogReturns.result1
    78  	}
    79  }
    80  
    81  func (fake *FakeLoggable) ToSimpleLogCallCount() int {
    82  	fake.toSimpleLogMutex.RLock()
    83  	defer fake.toSimpleLogMutex.RUnlock()
    84  	return len(fake.toSimpleLogArgsForCall)
    85  }
    86  
    87  func (fake *FakeLoggable) ToSimpleLogReturns(result1 string) {
    88  	fake.ToSimpleLogStub = nil
    89  	fake.toSimpleLogReturns = struct {
    90  		result1 string
    91  	}{result1}
    92  }
    93  
    94  func (fake *FakeLoggable) GetSourceName() string {
    95  	fake.getSourceNameMutex.Lock()
    96  	fake.getSourceNameArgsForCall = append(fake.getSourceNameArgsForCall, struct{}{})
    97  	fake.recordInvocation("GetSourceName", []interface{}{})
    98  	fake.getSourceNameMutex.Unlock()
    99  	if fake.GetSourceNameStub != nil {
   100  		return fake.GetSourceNameStub()
   101  	} else {
   102  		return fake.getSourceNameReturns.result1
   103  	}
   104  }
   105  
   106  func (fake *FakeLoggable) GetSourceNameCallCount() int {
   107  	fake.getSourceNameMutex.RLock()
   108  	defer fake.getSourceNameMutex.RUnlock()
   109  	return len(fake.getSourceNameArgsForCall)
   110  }
   111  
   112  func (fake *FakeLoggable) GetSourceNameReturns(result1 string) {
   113  	fake.GetSourceNameStub = nil
   114  	fake.getSourceNameReturns = struct {
   115  		result1 string
   116  	}{result1}
   117  }
   118  
   119  func (fake *FakeLoggable) Invocations() map[string][][]interface{} {
   120  	fake.invocationsMutex.RLock()
   121  	defer fake.invocationsMutex.RUnlock()
   122  	fake.toLogMutex.RLock()
   123  	defer fake.toLogMutex.RUnlock()
   124  	fake.toSimpleLogMutex.RLock()
   125  	defer fake.toSimpleLogMutex.RUnlock()
   126  	fake.getSourceNameMutex.RLock()
   127  	defer fake.getSourceNameMutex.RUnlock()
   128  	return fake.invocations
   129  }
   130  
   131  func (fake *FakeLoggable) recordInvocation(key string, args []interface{}) {
   132  	fake.invocationsMutex.Lock()
   133  	defer fake.invocationsMutex.Unlock()
   134  	if fake.invocations == nil {
   135  		fake.invocations = map[string][][]interface{}{}
   136  	}
   137  	if fake.invocations[key] == nil {
   138  		fake.invocations[key] = [][]interface{}{}
   139  	}
   140  	fake.invocations[key] = append(fake.invocations[key], args)
   141  }
   142  
   143  var _ logs.Loggable = new(FakeLoggable)