github.com/rita33cool1/iot-system-gateway@v0.0.0-20200911033302-e65bde238cc5/docker-engine/internal/test/daemon/ops.go (about)

     1  package daemon
     2  
     3  import "github.com/docker/docker/internal/test/environment"
     4  
     5  // WithExperimental sets the daemon in experimental mode
     6  func WithExperimental(d *Daemon) {
     7  	d.experimental = true
     8  }
     9  
    10  // WithDockerdBinary sets the dockerd binary to the specified one
    11  func WithDockerdBinary(dockerdBinary string) func(*Daemon) {
    12  	return func(d *Daemon) {
    13  		d.dockerdBinary = dockerdBinary
    14  	}
    15  }
    16  
    17  // WithSwarmPort sets the swarm port to use for swarm mode
    18  func WithSwarmPort(port int) func(*Daemon) {
    19  	return func(d *Daemon) {
    20  		d.SwarmPort = port
    21  	}
    22  }
    23  
    24  // WithSwarmListenAddr sets the swarm listen addr to use for swarm mode
    25  func WithSwarmListenAddr(listenAddr string) func(*Daemon) {
    26  	return func(d *Daemon) {
    27  		d.swarmListenAddr = listenAddr
    28  	}
    29  }
    30  
    31  // WithEnvironment sets options from internal/test/environment.Execution struct
    32  func WithEnvironment(e environment.Execution) func(*Daemon) {
    33  	return func(d *Daemon) {
    34  		if e.DaemonInfo.ExperimentalBuild {
    35  			d.experimental = true
    36  		}
    37  	}
    38  }