f.DurationVar(&cfg.IdleConnTimeout,prefix+"idle-conn-timeout",90*time.Second,"The time an idle connection will remain idle before closing.")
f.DurationVar(&cfg.ResponseHeaderTimeout,prefix+"response-header-timeout",2*time.Minute,"The amount of time the client will wait for a servers response headers.")
f.BoolVar(&cfg.InsecureSkipVerify,prefix+"insecure-skip-verify",false,"If the client connects via HTTPS and this option is enabled, the client will accept any certificate and hostname.")
f.DurationVar(&cfg.IdleConnTimeout,prefix+"http.idle-conn-timeout",90*time.Second,"The time an idle connection will remain idle before closing.")
f.DurationVar(&cfg.ResponseHeaderTimeout,prefix+"http.response-header-timeout",2*time.Minute,"The amount of time the client will wait for a servers response headers.")
f.BoolVar(&cfg.InsecureSkipVerify,prefix+"http.insecure-skip-verify",false,"If the client connects via HTTPS and this option is enabled, the client will accept any certificate and hostname.")
f.DurationVar(&cfg.TLSHandshakeTimeout,prefix+"tls-handshake-timeout",10*time.Second,"Maximum time to wait for a TLS handshake. 0 means no limit.")
f.DurationVar(&cfg.ExpectContinueTimeout,prefix+"expect-continue-timeout",1*time.Second,"The time to wait for a server's first response headers after fully writing the request headers if the request has an Expect header. 0 to send the request body immediately.")
f.IntVar(&cfg.MaxIdleConns,prefix+"max-idle-connections",100,"Maximum number of idle (keep-alive) connections across all hosts. 0 means no limit.")
f.IntVar(&cfg.MaxIdleConnsPerHost,prefix+"max-idle-connections-per-host",100,"Maximum number of idle (keep-alive) connections to keep per-host. If 0, a built-in default value is used.")
f.IntVar(&cfg.MaxConnsPerHost,prefix+"max-connections-per-host",0,"Maximum number of connections per host. 0 means no limit.")
f.StringVar(&cfg.CAFile,prefix+"ca-file","","Path to the trusted CA file that signed the SSL certificate of the object storage endpoint.")
cfg.TLSConfig.RegisterFlagsWithPrefix(prefix,f)
}
// RegisterFlagsWithPrefix registers the flags for s3 storage with the provided prefix.
f.StringVar(&cfg.CAPath,prefix+"http.tls-ca-path","","Path to the CA certificates to validate server certificate against. If not set, the host's root CA certificates are used.")
f.StringVar(&cfg.CertPath,prefix+"http.tls-cert-path","","Path to the client certificate, which will be used for authenticating with the server. Also requires the key path to be configured.")
f.StringVar(&cfg.KeyPath,prefix+"http.tls-key-path","","Path to the key for the client certificate. Also requires the client certificate to be configured.")
f.StringVar(&cfg.ServerName,prefix+"http.tls-server-name","","Override the expected name on the server certificate.")
f.DurationVar(&cfg.IdleConnTimeout,prefix+"s3.http.idle-conn-timeout",90*time.Second,"The time an idle connection will remain idle before closing.")
f.DurationVar(&cfg.ResponseHeaderTimeout,prefix+"s3.http.response-header-timeout",2*time.Minute,"The amount of time the client will wait for a servers response headers.")
f.BoolVar(&cfg.InsecureSkipVerify,prefix+"s3.http.insecure-skip-verify",false,"If the client connects to S3 via HTTPS and this option is enabled, the client will accept any certificate and hostname.")
f.DurationVar(&cfg.TLSHandshakeTimeout,prefix+"s3.tls-handshake-timeout",10*time.Second,"Maximum time to wait for a TLS handshake. 0 means no limit.")
f.DurationVar(&cfg.ExpectContinueTimeout,prefix+"s3.expect-continue-timeout",1*time.Second,"The time to wait for a server's first response headers after fully writing the request headers if the request has an Expect header. 0 to send the request body immediately.")
f.IntVar(&cfg.MaxIdleConns,prefix+"s3.max-idle-connections",100,"Maximum number of idle (keep-alive) connections across all hosts. 0 means no limit.")
f.IntVar(&cfg.MaxIdleConnsPerHost,prefix+"s3.max-idle-connections-per-host",100,"Maximum number of idle (keep-alive) connections to keep per-host. If 0, a built-in default value is used.")
f.IntVar(&cfg.MaxConnsPerHost,prefix+"s3.max-connections-per-host",0,"Maximum number of connections per host. 0 means no limit.")
cfg.TLSConfig.RegisterFlagsWithPrefix(prefix,f)
}
// RegisterFlagsWithPrefix registers the flags for s3 storage with the provided prefix.
f.StringVar(&cfg.CAPath,prefix+"s3.http.tls-ca-path","","Path to the CA certificates to validate server certificate against. If not set, the host's root CA certificates are used.")
f.StringVar(&cfg.CertPath,prefix+"s3.http.tls-cert-path","","Path to the client certificate, which will be used for authenticating with the server. Also requires the key path to be configured.")
f.StringVar(&cfg.KeyPath,prefix+"s3.http.tls-key-path","","Path to the key for the client certificate. Also requires the client certificate to be configured.")
f.StringVar(&cfg.ServerName,prefix+"s3.http.tls-server-name","","Override the expected name on the server certificate.")
}
// Config holds the config options for an S3 backend
f.StringVar(&cfg.STSEndpoint,prefix+"s3.sts-endpoint","","Accessing S3 resources using temporary, secure credentials provided by AWS Security Token Service.")
f.IntVar(&cfg.MaxRetries,prefix+"s3.max-retries",10,"The maximum number of retries for S3 requests that are retryable. Default is 10, set this to 1 to disable retries.")
f.IntVar(&cfg.MaxRetries,prefix+"swift.max-retries",3,"Max retries on requests error.")
f.DurationVar(&cfg.ConnectTimeout,prefix+"swift.connect-timeout",10*time.Second,"Time after which a connection attempt is aborted.")
f.DurationVar(&cfg.RequestTimeout,prefix+"swift.request-timeout",5*time.Second,"Time after which an idle request is aborted. The timeout watchdog is reset each time some data is received, so the timeout triggers after X time no data is received on a request.")
f.IntVar(&cfg.AuthVersion,prefix+"swift.auth-version",0,"OpenStack Swift authentication API version. 0 to autodetect.")
f.StringVar(&cfg.AuthURL,prefix+"swift.auth-url","","OpenStack Swift authentication URL")
f.BoolVar(&cfg.Internal,prefix+"swift.internal",false,"Set this to true to use the internal OpenStack Swift endpoint URL")
f.StringVar(&cfg.Username,prefix+"swift.username","","OpenStack Swift username.")
f.StringVar(&cfg.UserDomainName,prefix+"swift.user-domain-name","","OpenStack Swift user's domain name.")
f.StringVar(&cfg.UserDomainID,prefix+"swift.user-domain-id","","OpenStack Swift user's domain ID.")
f.StringVar(&cfg.UserID,prefix+"swift.user-id","","OpenStack Swift user ID.")
f.Var(&cfg.Password,prefix+"swift.password","OpenStack Swift API key.")
f.StringVar(&cfg.DomainID,prefix+"swift.domain-id","","OpenStack Swift user's domain ID.")
f.StringVar(&cfg.DomainName,prefix+"swift.domain-name","","OpenStack Swift user's domain name.")
f.StringVar(&cfg.ProjectID,prefix+"swift.project-id","","OpenStack Swift project ID (v2,v3 auth only).")
f.StringVar(&cfg.ProjectName,prefix+"swift.project-name","","OpenStack Swift project name (v2,v3 auth only).")
f.StringVar(&cfg.ProjectDomainID,prefix+"swift.project-domain-id","","ID of the OpenStack Swift project's domain (v3 auth only), only needed if it differs the from user domain.")
f.StringVar(&cfg.ProjectDomainName,prefix+"swift.project-domain-name","","Name of the OpenStack Swift project's domain (v3 auth only), only needed if it differs from the user domain.")
f.StringVar(&cfg.RegionName,prefix+"swift.region-name","","OpenStack Swift Region to use (v2,v3 auth only).")
f.StringVar(&cfg.ContainerName,prefix+"swift.container-name","","Name of the OpenStack Swift container to put chunks in.")
f.IntVar(&cfg.MaxRetries,prefix+"swift.max-retries",3,"Max retries on requests error.")
f.DurationVar(&cfg.ConnectTimeout,prefix+"swift.connect-timeout",10*time.Second,"Time after which a connection attempt is aborted.")
f.DurationVar(&cfg.RequestTimeout,prefix+"swift.request-timeout",5*time.Second,"Time after which an idle request is aborted. The timeout watchdog is reset each time some data is received, so the timeout triggers after X time no data is received on a request.")
f.StringVar(&cfg.HTTP.TLSConfig.CAPath,prefix+"swift.http.tls-ca-path","","Path to the CA certificates to validate server certificate against. If not set, the host's root CA certificates are used.")
}
// NewSwiftObjectClient makes a new chunk.Client that writes chunks to OpenStack Swift.