sorter

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SortByDependencies

func SortByDependencies(containers []container.Container) ([]container.Container, error)

SortByDependencies will sort the list of containers taking into account any links between containers. Container with no outgoing links will be sorted to the front of the list while containers with links will be sorted after all of their dependencies. This sort order ensures that linked containers can be started in the correct order.

Types

type ByCreated

type ByCreated []container.Container

ByCreated allows a list of Container structs to be sorted by the container's created date.

func (ByCreated) Len

func (c ByCreated) Len() int

func (ByCreated) Less

func (c ByCreated) Less(i, j int) bool

Less will compare two elements (identified by index) in the Container list by created-date.

func (ByCreated) Swap

func (c ByCreated) Swap(i, j int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL