// Code generated by counterfeiter. DO NOT EDIT.
package fakes

import (
	"iptables-logger/repository"
	"sync"
)

type ContainerRepo struct {
	GetByIPStub        func(string) (repository.Container, error)
	getByIPMutex       sync.RWMutex
	getByIPArgsForCall []struct {
		arg1 string
	}
	getByIPReturns struct {
		result1 repository.Container
		result2 error
	}
	getByIPReturnsOnCall map[int]struct {
		result1 repository.Container
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *ContainerRepo) GetByIP(arg1 string) (repository.Container, error) {
	fake.getByIPMutex.Lock()
	ret, specificReturn := fake.getByIPReturnsOnCall[len(fake.getByIPArgsForCall)]
	fake.getByIPArgsForCall = append(fake.getByIPArgsForCall, struct {
		arg1 string
	}{arg1})
	fake.recordInvocation("GetByIP", []interface{}{arg1})
	fake.getByIPMutex.Unlock()
	if fake.GetByIPStub != nil {
		return fake.GetByIPStub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fake.getByIPReturns.result1, fake.getByIPReturns.result2
}

func (fake *ContainerRepo) GetByIPCallCount() int {
	fake.getByIPMutex.RLock()
	defer fake.getByIPMutex.RUnlock()
	return len(fake.getByIPArgsForCall)
}

func (fake *ContainerRepo) GetByIPArgsForCall(i int) string {
	fake.getByIPMutex.RLock()
	defer fake.getByIPMutex.RUnlock()
	return fake.getByIPArgsForCall[i].arg1
}

func (fake *ContainerRepo) GetByIPReturns(result1 repository.Container, result2 error) {
	fake.GetByIPStub = nil
	fake.getByIPReturns = struct {
		result1 repository.Container
		result2 error
	}{result1, result2}
}

func (fake *ContainerRepo) GetByIPReturnsOnCall(i int, result1 repository.Container, result2 error) {
	fake.GetByIPStub = nil
	if fake.getByIPReturnsOnCall == nil {
		fake.getByIPReturnsOnCall = make(map[int]struct {
			result1 repository.Container
			result2 error
		})
	}
	fake.getByIPReturnsOnCall[i] = struct {
		result1 repository.Container
		result2 error
	}{result1, result2}
}

func (fake *ContainerRepo) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.getByIPMutex.RLock()
	defer fake.getByIPMutex.RUnlock()
	copiedInvocations := map[string][][]interface{}{}
	for key, value := range fake.invocations {
		copiedInvocations[key] = value
	}
	return copiedInvocations
}

func (fake *ContainerRepo) recordInvocation(key string, args []interface{}) {
	fake.invocationsMutex.Lock()
	defer fake.invocationsMutex.Unlock()
	if fake.invocations == nil {
		fake.invocations = map[string][][]interface{}{}
	}
	if fake.invocations[key] == nil {
		fake.invocations[key] = [][]interface{}{}
	}
	fake.invocations[key] = append(fake.invocations[key], args)
}
