github.com/flavio/docker@v0.1.3-0.20170117145210-f63d1a6eec47/client/swarm_leave.go (about) 1 package client 2 3 import ( 4 "net/url" 5 6 "golang.org/x/net/context" 7 ) 8 9 // SwarmLeave leaves the swarm. 10 func (cli *Client) SwarmLeave(ctx context.Context, force bool) error { 11 query := url.Values{} 12 if force { 13 query.Set("force", "1") 14 } 15 resp, err := cli.post(ctx, "/swarm/leave", query, nil, nil) 16 ensureReaderClosed(resp) 17 return err 18 }