github.com/cloudfoundry-attic/garden-linux@v0.333.2-candidate/network/subnets/fakes/fake_subnet_selector.go (about) 1 // This file was generated by counterfeiter 2 package fakes 3 4 import ( 5 "net" 6 "sync" 7 8 "github.com/cloudfoundry-incubator/garden-linux/network/subnets" 9 ) 10 11 type FakeSubnetSelector struct { 12 SelectSubnetStub func(dynamic *net.IPNet, existing []*net.IPNet) (*net.IPNet, error) 13 selectSubnetMutex sync.RWMutex 14 selectSubnetArgsForCall []struct { 15 dynamic *net.IPNet 16 existing []*net.IPNet 17 } 18 selectSubnetReturns struct { 19 result1 *net.IPNet 20 result2 error 21 } 22 } 23 24 func (fake *FakeSubnetSelector) SelectSubnet(dynamic *net.IPNet, existing []*net.IPNet) (*net.IPNet, error) { 25 fake.selectSubnetMutex.Lock() 26 fake.selectSubnetArgsForCall = append(fake.selectSubnetArgsForCall, struct { 27 dynamic *net.IPNet 28 existing []*net.IPNet 29 }{dynamic, existing}) 30 fake.selectSubnetMutex.Unlock() 31 if fake.SelectSubnetStub != nil { 32 return fake.SelectSubnetStub(dynamic, existing) 33 } else { 34 return fake.selectSubnetReturns.result1, fake.selectSubnetReturns.result2 35 } 36 } 37 38 func (fake *FakeSubnetSelector) SelectSubnetCallCount() int { 39 fake.selectSubnetMutex.RLock() 40 defer fake.selectSubnetMutex.RUnlock() 41 return len(fake.selectSubnetArgsForCall) 42 } 43 44 func (fake *FakeSubnetSelector) SelectSubnetArgsForCall(i int) (*net.IPNet, []*net.IPNet) { 45 fake.selectSubnetMutex.RLock() 46 defer fake.selectSubnetMutex.RUnlock() 47 return fake.selectSubnetArgsForCall[i].dynamic, fake.selectSubnetArgsForCall[i].existing 48 } 49 50 func (fake *FakeSubnetSelector) SelectSubnetReturns(result1 *net.IPNet, result2 error) { 51 fake.SelectSubnetStub = nil 52 fake.selectSubnetReturns = struct { 53 result1 *net.IPNet 54 result2 error 55 }{result1, result2} 56 } 57 58 var _ subnets.SubnetSelector = new(FakeSubnetSelector)