github.com/juju/juju@v0.0.0-20240430160146-1752b71fcf00/migration/dialopts.go (about) 1 // Copyright 2016 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package migration 5 6 import ( 7 "time" 8 9 "github.com/juju/juju/api" 10 ) 11 12 // ControllerDialOpts returns dial parameters suitable for connecting 13 // from the source controller to the target controller during model 14 // migrations. 15 // Except for the inclusion of RetryDelay the options mirror what is used 16 // by the APICaller for logins. 17 func ControllerDialOpts() api.DialOpts { 18 return api.DialOpts{ 19 DialTimeout: 3 * time.Second, 20 DialAddressInterval: 200 * time.Millisecond, 21 Timeout: time.Minute, 22 RetryDelay: 100 * time.Millisecond, 23 } 24 }