github.com/cloudfoundry-attic/garden-linux@v0.333.2-candidate/linux_container/fake_network_statisticser/fake_network_statisticser.go (about) 1 // This file was generated by counterfeiter 2 package fake_network_statisticser 3 4 import ( 5 "sync" 6 7 "github.com/cloudfoundry-incubator/garden" 8 "github.com/cloudfoundry-incubator/garden-linux/linux_container" 9 ) 10 11 type FakeNetworkStatisticser struct { 12 StatisticsStub func() (stats garden.ContainerNetworkStat, err error) 13 statisticsMutex sync.RWMutex 14 statisticsArgsForCall []struct{} 15 statisticsReturns struct { 16 result1 garden.ContainerNetworkStat 17 result2 error 18 } 19 } 20 21 func (fake *FakeNetworkStatisticser) Statistics() (stats garden.ContainerNetworkStat, err error) { 22 fake.statisticsMutex.Lock() 23 fake.statisticsArgsForCall = append(fake.statisticsArgsForCall, struct{}{}) 24 fake.statisticsMutex.Unlock() 25 if fake.StatisticsStub != nil { 26 return fake.StatisticsStub() 27 } else { 28 return fake.statisticsReturns.result1, fake.statisticsReturns.result2 29 } 30 } 31 32 func (fake *FakeNetworkStatisticser) StatisticsCallCount() int { 33 fake.statisticsMutex.RLock() 34 defer fake.statisticsMutex.RUnlock() 35 return len(fake.statisticsArgsForCall) 36 } 37 38 func (fake *FakeNetworkStatisticser) StatisticsReturns(result1 garden.ContainerNetworkStat, result2 error) { 39 fake.StatisticsStub = nil 40 fake.statisticsReturns = struct { 41 result1 garden.ContainerNetworkStat 42 result2 error 43 }{result1, result2} 44 } 45 46 var _ linux_container.NetworkStatisticser = new(FakeNetworkStatisticser)