github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/util/configv3/defaults.go (about)

     1  package configv3
     2  
     3  import "time"
     4  
     5  const (
     6  	// CurrentConfigVersion is the version field for the main config file
     7  	CurrentConfigVersion = 3
     8  
     9  	// DefaultDialTimeout is the default timeout for the dail.
    10  	DefaultDialTimeout = 6 * time.Second
    11  
    12  	// DefaultNOAARetryCount is the default number of request retries.
    13  	DefaultNOAARetryCount = 5
    14  
    15  	// DefaultOverallPollingTimeout is the default maximum time that the CLI will
    16  	// poll a job running on the Cloud Controller. By default it's infinite,
    17  	// which is represented by MaxInt64.
    18  	DefaultOverallPollingTimeout = time.Duration(1 << 62)
    19  	// Developer Note: Due to bugs in using MaxInt64 during comparison, the above
    20  	// was chosen as a replacement.
    21  
    22  	// DefaultPollingInterval is the time between consecutive polls of a status.
    23  	DefaultPollingInterval = 3 * time.Second
    24  
    25  	// DefaultStagingTimeout is the default timeout for application staging.
    26  	DefaultStagingTimeout = 15 * time.Minute
    27  
    28  	// DefaultStartupTimeout is the default timeout for application starting.
    29  	DefaultStartupTimeout = 5 * time.Minute
    30  
    31  	// DefaultTarget is the default CFConfig value for Target.
    32  	DefaultTarget = ""
    33  
    34  	// DefaultSSHOAuthClient is the default oauth client ID for SSHing into an
    35  	// application/process container
    36  	DefaultSSHOAuthClient = "ssh-proxy"
    37  
    38  	// DefaultUAADisableKeepAlives is the default value that the UAA client will
    39  	// use for Transport.DisableKeepAlives. UAA connections should always be
    40  	// closed after every request because UAA communication is infrequent.
    41  	DefaultUAADisableKeepAlives = true
    42  
    43  	// DefaultUAAOAuthClient is the default client ID for the CLI when
    44  	// communicating with the UAA.
    45  	DefaultUAAOAuthClient = "cf"
    46  
    47  	// DefaultUAAOAuthClientSecret is the default client secret for the CLI when
    48  	// communicating with the UAA.
    49  	DefaultUAAOAuthClientSecret = ""
    50  
    51  	// DefaultRetryCount is the default number of request retries.
    52  	DefaultRetryCount = 2
    53  )
    54  
    55  // NOAARequestRetryCount returns the number of request retries.
    56  func (*Config) NOAARequestRetryCount() int {
    57  	return DefaultNOAARetryCount
    58  }
    59  
    60  // PollingInterval returns the time between polls.
    61  func (config *Config) PollingInterval() time.Duration {
    62  	return DefaultPollingInterval
    63  }
    64  
    65  // RequestRetryCount returns the number of request retries.
    66  func (*Config) RequestRetryCount() int {
    67  	return DefaultRetryCount
    68  }
    69  
    70  // UAADisableKeepAlives returns true when TCP connections should not be reused
    71  // for UAA.
    72  func (*Config) UAADisableKeepAlives() bool {
    73  	return DefaultUAADisableKeepAlives
    74  }