// Code generated by moq; DO NOT EDIT.
// github.com/matryer/moq

package agent

import (
	"sync"
)

// Ensure, that RegistryMock does implement Registry.
// If this is not the case, regenerate this file with moq.
var _ Registry = &RegistryMock{}

// RegistryMock is a mock implementation of Registry.
//
//	func TestSomethingThatUsesRegistry(t *testing.T) {
//
//		// make and configure a mocked Registry
//		mockedRegistry := &RegistryMock{
//			AddFunc: func(entry Entry) error {
//				panic("mock out the Add method")
//			},
//			EvictByContainerIDFunc: func(containerID string) error {
//				panic("mock out the EvictByContainerID method")
//			},
//			LookupByContainerIDFunc: func(containerID string) (*Entry, error) {
//				panic("mock out the LookupByContainerID method")
//			},
//			SnapshotFunc: func() ([]Entry, error) {
//				panic("mock out the Snapshot method")
//			},
//		}
//
//		// use mockedRegistry in code that requires Registry
//		// and then make assertions.
//
//	}
type RegistryMock struct {
	// AddFunc mocks the Add method.
	AddFunc func(entry Entry) error

	// EvictByContainerIDFunc mocks the EvictByContainerID method.
	EvictByContainerIDFunc func(containerID string) error

	// LookupByContainerIDFunc mocks the LookupByContainerID method.
	LookupByContainerIDFunc func(containerID string) (*Entry, error)

	// SnapshotFunc mocks the Snapshot method.
	SnapshotFunc func() ([]Entry, error)

	// calls tracks calls to the methods.
	calls struct {
		// Add holds details about calls to the Add method.
		Add []struct {
			// Entry is the entry argument value.
			Entry Entry
		}
		// EvictByContainerID holds details about calls to the EvictByContainerID method.
		EvictByContainerID []struct {
			// ContainerID is the containerID argument value.
			ContainerID string
		}
		// LookupByContainerID holds details about calls to the LookupByContainerID method.
		LookupByContainerID []struct {
			// ContainerID is the containerID argument value.
			ContainerID string
		}
		// Snapshot holds details about calls to the Snapshot method.
		Snapshot []struct {
		}
	}
	lockAdd                 sync.RWMutex
	lockEvictByContainerID  sync.RWMutex
	lockLookupByContainerID sync.RWMutex
	lockSnapshot            sync.RWMutex
}

// Add calls AddFunc.
func (mock *RegistryMock) Add(entry Entry) error {
	if mock.AddFunc == nil {
		panic("RegistryMock.AddFunc: method is nil but Registry.Add was just called")
	}
	callInfo := struct {
		Entry Entry
	}{
		Entry: entry,
	}
	mock.lockAdd.Lock()
	mock.calls.Add = append(mock.calls.Add, callInfo)
	mock.lockAdd.Unlock()
	return mock.AddFunc(entry)
}

// AddCalls gets all the calls that were made to Add.
// Check the length with:
//
//	len(mockedRegistry.AddCalls())
func (mock *RegistryMock) AddCalls() []struct {
	Entry Entry
} {
	var calls []struct {
		Entry Entry
	}
	mock.lockAdd.RLock()
	calls = mock.calls.Add
	mock.lockAdd.RUnlock()
	return calls
}

// EvictByContainerID calls EvictByContainerIDFunc.
func (mock *RegistryMock) EvictByContainerID(containerID string) error {
	if mock.EvictByContainerIDFunc == nil {
		panic("RegistryMock.EvictByContainerIDFunc: method is nil but Registry.EvictByContainerID was just called")
	}
	callInfo := struct {
		ContainerID string
	}{
		ContainerID: containerID,
	}
	mock.lockEvictByContainerID.Lock()
	mock.calls.EvictByContainerID = append(mock.calls.EvictByContainerID, callInfo)
	mock.lockEvictByContainerID.Unlock()
	return mock.EvictByContainerIDFunc(containerID)
}

// EvictByContainerIDCalls gets all the calls that were made to EvictByContainerID.
// Check the length with:
//
//	len(mockedRegistry.EvictByContainerIDCalls())
func (mock *RegistryMock) EvictByContainerIDCalls() []struct {
	ContainerID string
} {
	var calls []struct {
		ContainerID string
	}
	mock.lockEvictByContainerID.RLock()
	calls = mock.calls.EvictByContainerID
	mock.lockEvictByContainerID.RUnlock()
	return calls
}

// LookupByContainerID calls LookupByContainerIDFunc.
func (mock *RegistryMock) LookupByContainerID(containerID string) (*Entry, error) {
	if mock.LookupByContainerIDFunc == nil {
		panic("RegistryMock.LookupByContainerIDFunc: method is nil but Registry.LookupByContainerID was just called")
	}
	callInfo := struct {
		ContainerID string
	}{
		ContainerID: containerID,
	}
	mock.lockLookupByContainerID.Lock()
	mock.calls.LookupByContainerID = append(mock.calls.LookupByContainerID, callInfo)
	mock.lockLookupByContainerID.Unlock()
	return mock.LookupByContainerIDFunc(containerID)
}

// LookupByContainerIDCalls gets all the calls that were made to LookupByContainerID.
// Check the length with:
//
//	len(mockedRegistry.LookupByContainerIDCalls())
func (mock *RegistryMock) LookupByContainerIDCalls() []struct {
	ContainerID string
} {
	var calls []struct {
		ContainerID string
	}
	mock.lockLookupByContainerID.RLock()
	calls = mock.calls.LookupByContainerID
	mock.lockLookupByContainerID.RUnlock()
	return calls
}

// Snapshot calls SnapshotFunc.
func (mock *RegistryMock) Snapshot() ([]Entry, error) {
	if mock.SnapshotFunc == nil {
		panic("RegistryMock.SnapshotFunc: method is nil but Registry.Snapshot was just called")
	}
	callInfo := struct {
	}{}
	mock.lockSnapshot.Lock()
	mock.calls.Snapshot = append(mock.calls.Snapshot, callInfo)
	mock.lockSnapshot.Unlock()
	return mock.SnapshotFunc()
}

// SnapshotCalls gets all the calls that were made to Snapshot.
// Check the length with:
//
//	len(mockedRegistry.SnapshotCalls())
func (mock *RegistryMock) SnapshotCalls() []struct {
} {
	var calls []struct {
	}
	mock.lockSnapshot.RLock()
	calls = mock.calls.Snapshot
	mock.lockSnapshot.RUnlock()
	return calls
}
