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

import (
	"lib/datastore"
	"sync"
)

type Datastore struct {
	AddStub        func(handle, ip string, metadata map[string]interface{}) error
	addMutex       sync.RWMutex
	addArgsForCall []struct {
		handle   string
		ip       string
		metadata map[string]interface{}
	}
	addReturns struct {
		result1 error
	}
	addReturnsOnCall map[int]struct {
		result1 error
	}
	DeleteStub        func(handle string) (datastore.Container, error)
	deleteMutex       sync.RWMutex
	deleteArgsForCall []struct {
		handle string
	}
	deleteReturns struct {
		result1 datastore.Container
		result2 error
	}
	deleteReturnsOnCall map[int]struct {
		result1 datastore.Container
		result2 error
	}
	ReadAllStub        func() (map[string]datastore.Container, error)
	readAllMutex       sync.RWMutex
	readAllArgsForCall []struct{}
	readAllReturns     struct {
		result1 map[string]datastore.Container
		result2 error
	}
	readAllReturnsOnCall map[int]struct {
		result1 map[string]datastore.Container
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *Datastore) Add(handle string, ip string, metadata map[string]interface{}) error {
	fake.addMutex.Lock()
	ret, specificReturn := fake.addReturnsOnCall[len(fake.addArgsForCall)]
	fake.addArgsForCall = append(fake.addArgsForCall, struct {
		handle   string
		ip       string
		metadata map[string]interface{}
	}{handle, ip, metadata})
	fake.recordInvocation("Add", []interface{}{handle, ip, metadata})
	fake.addMutex.Unlock()
	if fake.AddStub != nil {
		return fake.AddStub(handle, ip, metadata)
	}
	if specificReturn {
		return ret.result1
	}
	return fake.addReturns.result1
}

func (fake *Datastore) AddCallCount() int {
	fake.addMutex.RLock()
	defer fake.addMutex.RUnlock()
	return len(fake.addArgsForCall)
}

func (fake *Datastore) AddArgsForCall(i int) (string, string, map[string]interface{}) {
	fake.addMutex.RLock()
	defer fake.addMutex.RUnlock()
	return fake.addArgsForCall[i].handle, fake.addArgsForCall[i].ip, fake.addArgsForCall[i].metadata
}

func (fake *Datastore) AddReturns(result1 error) {
	fake.AddStub = nil
	fake.addReturns = struct {
		result1 error
	}{result1}
}

func (fake *Datastore) AddReturnsOnCall(i int, result1 error) {
	fake.AddStub = nil
	if fake.addReturnsOnCall == nil {
		fake.addReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.addReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *Datastore) Delete(handle string) (datastore.Container, error) {
	fake.deleteMutex.Lock()
	ret, specificReturn := fake.deleteReturnsOnCall[len(fake.deleteArgsForCall)]
	fake.deleteArgsForCall = append(fake.deleteArgsForCall, struct {
		handle string
	}{handle})
	fake.recordInvocation("Delete", []interface{}{handle})
	fake.deleteMutex.Unlock()
	if fake.DeleteStub != nil {
		return fake.DeleteStub(handle)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fake.deleteReturns.result1, fake.deleteReturns.result2
}

func (fake *Datastore) DeleteCallCount() int {
	fake.deleteMutex.RLock()
	defer fake.deleteMutex.RUnlock()
	return len(fake.deleteArgsForCall)
}

func (fake *Datastore) DeleteArgsForCall(i int) string {
	fake.deleteMutex.RLock()
	defer fake.deleteMutex.RUnlock()
	return fake.deleteArgsForCall[i].handle
}

func (fake *Datastore) DeleteReturns(result1 datastore.Container, result2 error) {
	fake.DeleteStub = nil
	fake.deleteReturns = struct {
		result1 datastore.Container
		result2 error
	}{result1, result2}
}

func (fake *Datastore) DeleteReturnsOnCall(i int, result1 datastore.Container, result2 error) {
	fake.DeleteStub = nil
	if fake.deleteReturnsOnCall == nil {
		fake.deleteReturnsOnCall = make(map[int]struct {
			result1 datastore.Container
			result2 error
		})
	}
	fake.deleteReturnsOnCall[i] = struct {
		result1 datastore.Container
		result2 error
	}{result1, result2}
}

func (fake *Datastore) ReadAll() (map[string]datastore.Container, error) {
	fake.readAllMutex.Lock()
	ret, specificReturn := fake.readAllReturnsOnCall[len(fake.readAllArgsForCall)]
	fake.readAllArgsForCall = append(fake.readAllArgsForCall, struct{}{})
	fake.recordInvocation("ReadAll", []interface{}{})
	fake.readAllMutex.Unlock()
	if fake.ReadAllStub != nil {
		return fake.ReadAllStub()
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fake.readAllReturns.result1, fake.readAllReturns.result2
}

func (fake *Datastore) ReadAllCallCount() int {
	fake.readAllMutex.RLock()
	defer fake.readAllMutex.RUnlock()
	return len(fake.readAllArgsForCall)
}

func (fake *Datastore) ReadAllReturns(result1 map[string]datastore.Container, result2 error) {
	fake.ReadAllStub = nil
	fake.readAllReturns = struct {
		result1 map[string]datastore.Container
		result2 error
	}{result1, result2}
}

func (fake *Datastore) ReadAllReturnsOnCall(i int, result1 map[string]datastore.Container, result2 error) {
	fake.ReadAllStub = nil
	if fake.readAllReturnsOnCall == nil {
		fake.readAllReturnsOnCall = make(map[int]struct {
			result1 map[string]datastore.Container
			result2 error
		})
	}
	fake.readAllReturnsOnCall[i] = struct {
		result1 map[string]datastore.Container
		result2 error
	}{result1, result2}
}

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

func (fake *Datastore) 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)
}

var _ datastore.Datastore = new(Datastore)
