Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

New method to list containers (with missing parameters) #110

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gdevillele
Copy link

I left the existing "client.ListContainers" method but created a "client. client.ListContainersWithOptions" method.
It does the same thing, but allows 3 additional parameters to be provided : "limit", "since" and "before".
The goal is to have the same options than in the docker CLI.

}

// ListContainersWithOptions behaves like ListContainers but allowing additionnal options
func (client *DockerClient) ListContainersWithOptions(all, size bool, limit, since, before, filters string) ([]Container, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these options would be nicer as a struct, something like:

type ListContainerOptions struct {
    All, Size bool
    Limit, Since, Before, Filters string
}

@donhcd
Copy link
Collaborator

donhcd commented Jul 17, 2015

can you also add the new method to the interface in interface.go and to the mock in mockclient/mock.go?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants