github.com/geofffranks/garden-linux@v0.0.0-20160715111146-26c893169cfa/network/iptables/fakes/fake_chain.go (about) 1 // This file was generated by counterfeiter 2 package fakes 3 4 import ( 5 "net" 6 "sync" 7 8 "code.cloudfoundry.org/garden" 9 "code.cloudfoundry.org/garden-linux/network/iptables" 10 ) 11 12 type FakeChain struct { 13 SetupStub func(logPrefix string) error 14 setupMutex sync.RWMutex 15 setupArgsForCall []struct { 16 logPrefix string 17 } 18 setupReturns struct { 19 result1 error 20 } 21 TearDownStub func() error 22 tearDownMutex sync.RWMutex 23 tearDownArgsForCall []struct{} 24 tearDownReturns struct { 25 result1 error 26 } 27 AppendRuleStub func(source string, destination string, jump iptables.Action) error 28 appendRuleMutex sync.RWMutex 29 appendRuleArgsForCall []struct { 30 source string 31 destination string 32 jump iptables.Action 33 } 34 appendRuleReturns struct { 35 result1 error 36 } 37 DeleteRuleStub func(source string, destination string, jump iptables.Action) error 38 deleteRuleMutex sync.RWMutex 39 deleteRuleArgsForCall []struct { 40 source string 41 destination string 42 jump iptables.Action 43 } 44 deleteRuleReturns struct { 45 result1 error 46 } 47 AppendNatRuleStub func(source string, destination string, jump iptables.Action, to net.IP) error 48 appendNatRuleMutex sync.RWMutex 49 appendNatRuleArgsForCall []struct { 50 source string 51 destination string 52 jump iptables.Action 53 to net.IP 54 } 55 appendNatRuleReturns struct { 56 result1 error 57 } 58 DeleteNatRuleStub func(source string, destination string, jump iptables.Action, to net.IP) error 59 deleteNatRuleMutex sync.RWMutex 60 deleteNatRuleArgsForCall []struct { 61 source string 62 destination string 63 jump iptables.Action 64 to net.IP 65 } 66 deleteNatRuleReturns struct { 67 result1 error 68 } 69 PrependFilterRuleStub func(rule garden.NetOutRule) error 70 prependFilterRuleMutex sync.RWMutex 71 prependFilterRuleArgsForCall []struct { 72 rule garden.NetOutRule 73 } 74 prependFilterRuleReturns struct { 75 result1 error 76 } 77 } 78 79 func (fake *FakeChain) Setup(logPrefix string) error { 80 fake.setupMutex.Lock() 81 fake.setupArgsForCall = append(fake.setupArgsForCall, struct { 82 logPrefix string 83 }{logPrefix}) 84 fake.setupMutex.Unlock() 85 if fake.SetupStub != nil { 86 return fake.SetupStub(logPrefix) 87 } else { 88 return fake.setupReturns.result1 89 } 90 } 91 92 func (fake *FakeChain) SetupCallCount() int { 93 fake.setupMutex.RLock() 94 defer fake.setupMutex.RUnlock() 95 return len(fake.setupArgsForCall) 96 } 97 98 func (fake *FakeChain) SetupArgsForCall(i int) string { 99 fake.setupMutex.RLock() 100 defer fake.setupMutex.RUnlock() 101 return fake.setupArgsForCall[i].logPrefix 102 } 103 104 func (fake *FakeChain) SetupReturns(result1 error) { 105 fake.SetupStub = nil 106 fake.setupReturns = struct { 107 result1 error 108 }{result1} 109 } 110 111 func (fake *FakeChain) TearDown() error { 112 fake.tearDownMutex.Lock() 113 fake.tearDownArgsForCall = append(fake.tearDownArgsForCall, struct{}{}) 114 fake.tearDownMutex.Unlock() 115 if fake.TearDownStub != nil { 116 return fake.TearDownStub() 117 } else { 118 return fake.tearDownReturns.result1 119 } 120 } 121 122 func (fake *FakeChain) TearDownCallCount() int { 123 fake.tearDownMutex.RLock() 124 defer fake.tearDownMutex.RUnlock() 125 return len(fake.tearDownArgsForCall) 126 } 127 128 func (fake *FakeChain) TearDownReturns(result1 error) { 129 fake.TearDownStub = nil 130 fake.tearDownReturns = struct { 131 result1 error 132 }{result1} 133 } 134 135 func (fake *FakeChain) AppendRule(source string, destination string, jump iptables.Action) error { 136 fake.appendRuleMutex.Lock() 137 fake.appendRuleArgsForCall = append(fake.appendRuleArgsForCall, struct { 138 source string 139 destination string 140 jump iptables.Action 141 }{source, destination, jump}) 142 fake.appendRuleMutex.Unlock() 143 if fake.AppendRuleStub != nil { 144 return fake.AppendRuleStub(source, destination, jump) 145 } else { 146 return fake.appendRuleReturns.result1 147 } 148 } 149 150 func (fake *FakeChain) AppendRuleCallCount() int { 151 fake.appendRuleMutex.RLock() 152 defer fake.appendRuleMutex.RUnlock() 153 return len(fake.appendRuleArgsForCall) 154 } 155 156 func (fake *FakeChain) AppendRuleArgsForCall(i int) (string, string, iptables.Action) { 157 fake.appendRuleMutex.RLock() 158 defer fake.appendRuleMutex.RUnlock() 159 return fake.appendRuleArgsForCall[i].source, fake.appendRuleArgsForCall[i].destination, fake.appendRuleArgsForCall[i].jump 160 } 161 162 func (fake *FakeChain) AppendRuleReturns(result1 error) { 163 fake.AppendRuleStub = nil 164 fake.appendRuleReturns = struct { 165 result1 error 166 }{result1} 167 } 168 169 func (fake *FakeChain) DeleteRule(source string, destination string, jump iptables.Action) error { 170 fake.deleteRuleMutex.Lock() 171 fake.deleteRuleArgsForCall = append(fake.deleteRuleArgsForCall, struct { 172 source string 173 destination string 174 jump iptables.Action 175 }{source, destination, jump}) 176 fake.deleteRuleMutex.Unlock() 177 if fake.DeleteRuleStub != nil { 178 return fake.DeleteRuleStub(source, destination, jump) 179 } else { 180 return fake.deleteRuleReturns.result1 181 } 182 } 183 184 func (fake *FakeChain) DeleteRuleCallCount() int { 185 fake.deleteRuleMutex.RLock() 186 defer fake.deleteRuleMutex.RUnlock() 187 return len(fake.deleteRuleArgsForCall) 188 } 189 190 func (fake *FakeChain) DeleteRuleArgsForCall(i int) (string, string, iptables.Action) { 191 fake.deleteRuleMutex.RLock() 192 defer fake.deleteRuleMutex.RUnlock() 193 return fake.deleteRuleArgsForCall[i].source, fake.deleteRuleArgsForCall[i].destination, fake.deleteRuleArgsForCall[i].jump 194 } 195 196 func (fake *FakeChain) DeleteRuleReturns(result1 error) { 197 fake.DeleteRuleStub = nil 198 fake.deleteRuleReturns = struct { 199 result1 error 200 }{result1} 201 } 202 203 func (fake *FakeChain) AppendNatRule(source string, destination string, jump iptables.Action, to net.IP) error { 204 fake.appendNatRuleMutex.Lock() 205 fake.appendNatRuleArgsForCall = append(fake.appendNatRuleArgsForCall, struct { 206 source string 207 destination string 208 jump iptables.Action 209 to net.IP 210 }{source, destination, jump, to}) 211 fake.appendNatRuleMutex.Unlock() 212 if fake.AppendNatRuleStub != nil { 213 return fake.AppendNatRuleStub(source, destination, jump, to) 214 } else { 215 return fake.appendNatRuleReturns.result1 216 } 217 } 218 219 func (fake *FakeChain) AppendNatRuleCallCount() int { 220 fake.appendNatRuleMutex.RLock() 221 defer fake.appendNatRuleMutex.RUnlock() 222 return len(fake.appendNatRuleArgsForCall) 223 } 224 225 func (fake *FakeChain) AppendNatRuleArgsForCall(i int) (string, string, iptables.Action, net.IP) { 226 fake.appendNatRuleMutex.RLock() 227 defer fake.appendNatRuleMutex.RUnlock() 228 return fake.appendNatRuleArgsForCall[i].source, fake.appendNatRuleArgsForCall[i].destination, fake.appendNatRuleArgsForCall[i].jump, fake.appendNatRuleArgsForCall[i].to 229 } 230 231 func (fake *FakeChain) AppendNatRuleReturns(result1 error) { 232 fake.AppendNatRuleStub = nil 233 fake.appendNatRuleReturns = struct { 234 result1 error 235 }{result1} 236 } 237 238 func (fake *FakeChain) DeleteNatRule(source string, destination string, jump iptables.Action, to net.IP) error { 239 fake.deleteNatRuleMutex.Lock() 240 fake.deleteNatRuleArgsForCall = append(fake.deleteNatRuleArgsForCall, struct { 241 source string 242 destination string 243 jump iptables.Action 244 to net.IP 245 }{source, destination, jump, to}) 246 fake.deleteNatRuleMutex.Unlock() 247 if fake.DeleteNatRuleStub != nil { 248 return fake.DeleteNatRuleStub(source, destination, jump, to) 249 } else { 250 return fake.deleteNatRuleReturns.result1 251 } 252 } 253 254 func (fake *FakeChain) DeleteNatRuleCallCount() int { 255 fake.deleteNatRuleMutex.RLock() 256 defer fake.deleteNatRuleMutex.RUnlock() 257 return len(fake.deleteNatRuleArgsForCall) 258 } 259 260 func (fake *FakeChain) DeleteNatRuleArgsForCall(i int) (string, string, iptables.Action, net.IP) { 261 fake.deleteNatRuleMutex.RLock() 262 defer fake.deleteNatRuleMutex.RUnlock() 263 return fake.deleteNatRuleArgsForCall[i].source, fake.deleteNatRuleArgsForCall[i].destination, fake.deleteNatRuleArgsForCall[i].jump, fake.deleteNatRuleArgsForCall[i].to 264 } 265 266 func (fake *FakeChain) DeleteNatRuleReturns(result1 error) { 267 fake.DeleteNatRuleStub = nil 268 fake.deleteNatRuleReturns = struct { 269 result1 error 270 }{result1} 271 } 272 273 func (fake *FakeChain) PrependFilterRule(rule garden.NetOutRule) error { 274 fake.prependFilterRuleMutex.Lock() 275 fake.prependFilterRuleArgsForCall = append(fake.prependFilterRuleArgsForCall, struct { 276 rule garden.NetOutRule 277 }{rule}) 278 fake.prependFilterRuleMutex.Unlock() 279 if fake.PrependFilterRuleStub != nil { 280 return fake.PrependFilterRuleStub(rule) 281 } else { 282 return fake.prependFilterRuleReturns.result1 283 } 284 } 285 286 func (fake *FakeChain) PrependFilterRuleCallCount() int { 287 fake.prependFilterRuleMutex.RLock() 288 defer fake.prependFilterRuleMutex.RUnlock() 289 return len(fake.prependFilterRuleArgsForCall) 290 } 291 292 func (fake *FakeChain) PrependFilterRuleArgsForCall(i int) garden.NetOutRule { 293 fake.prependFilterRuleMutex.RLock() 294 defer fake.prependFilterRuleMutex.RUnlock() 295 return fake.prependFilterRuleArgsForCall[i].rule 296 } 297 298 func (fake *FakeChain) PrependFilterRuleReturns(result1 error) { 299 fake.PrependFilterRuleStub = nil 300 fake.prependFilterRuleReturns = struct { 301 result1 error 302 }{result1} 303 } 304 305 var _ iptables.Chain = new(FakeChain)