swarm_join.go 309 B

12345678910111213
  1. package client
  2. import (
  3. "github.com/docker/docker/api/types/swarm"
  4. "golang.org/x/net/context"
  5. )
  6. // SwarmJoin joins the swarm.
  7. func (cli *Client) SwarmJoin(ctx context.Context, req swarm.JoinRequest) error {
  8. resp, err := cli.post(ctx, "/swarm/join", nil, req, nil)
  9. ensureReaderClosed(resp)
  10. return err
  11. }