mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-14 22:20:12 +01:00
Refactor Client interface
This commit is contained in:
parent
cc1efc20e2
commit
a8dec129f5
6 changed files with 164 additions and 162 deletions
|
|
@ -11,27 +11,27 @@ type MockClient struct {
|
|||
mock.Mock
|
||||
}
|
||||
|
||||
func (m *MockClient) ListContainers(cf container.ContainerFilter) ([]container.Container, error) {
|
||||
func (m *MockClient) ListContainers(cf container.Filter) ([]container.Container, error) {
|
||||
args := m.Called(cf)
|
||||
return args.Get(0).([]container.Container), args.Error(1)
|
||||
}
|
||||
|
||||
func (m *MockClient) RefreshImage(c *container.Container) error {
|
||||
args := m.Called(c)
|
||||
return args.Error(0)
|
||||
}
|
||||
|
||||
func (m *MockClient) Stop(c container.Container, timeout time.Duration) error {
|
||||
func (m *MockClient) StopContainer(c container.Container, timeout time.Duration) error {
|
||||
args := m.Called(c, timeout)
|
||||
return args.Error(0)
|
||||
}
|
||||
|
||||
func (m *MockClient) Start(c container.Container) error {
|
||||
func (m *MockClient) StartContainer(c container.Container) error {
|
||||
args := m.Called(c)
|
||||
return args.Error(0)
|
||||
}
|
||||
|
||||
func (m *MockClient) Rename(c container.Container, name string) error {
|
||||
func (m *MockClient) RenameContainer(c container.Container, name string) error {
|
||||
args := m.Called(c, name)
|
||||
return args.Error(0)
|
||||
}
|
||||
|
||||
func (m *MockClient) IsContainerStale(c container.Container) (bool, error) {
|
||||
args := m.Called(c)
|
||||
return args.Bool(0), args.Error(1)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue