nvwa/service/docker_swarm.go

20 lines
390 B
Go
Raw Permalink Normal View History

2018-08-29 17:58:41 +00:00
package service
import (
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/api/types/swarm"
)
func (d *docker) NodeList() []swarm.Node {
var (
ctx = d.context
options = types.NodeListOptions{Filters: filters.NewArgs()}
)
nodes, err := d.client.NodeList(ctx, options)
if err != nil {
panic(err)
}
return nodes
}