mirror of https://github.com/docker/docs.git
21 lines
349 B
Go
21 lines
349 B
Go
package api
|
|
|
|
import (
|
|
"github.com/samalba/dockerclient"
|
|
)
|
|
|
|
// ContainerSorter is exported
|
|
type ContainerSorter []*dockerclient.Container
|
|
|
|
func (s ContainerSorter) Len() int {
|
|
return len(s)
|
|
}
|
|
|
|
func (s ContainerSorter) Swap(i, j int) {
|
|
s[i], s[j] = s[j], s[i]
|
|
}
|
|
|
|
func (s ContainerSorter) Less(i, j int) bool {
|
|
return s[i].Created < s[j].Created
|
|
}
|