Documentation ¶
Index ¶
- Constants
- func CanReadFile(path string) bool
- func DecryptText(cryptoText string) (string, error)
- func EncryptText(text string) (string, error)
- func EscapeSingleQuote(s string) string
- func GenerateSelfSignedCert(certPath, keyPath string, ips []net.IP, alternateDNS []string) error
- func HomeDir() string
- func Pad(str string) string
- func ReadInputFromStdin(fieldlabel string) string
- func ReadPasswordFromStdin(fieldlabel string) string
- func Retry(attempts int, callback func() error) (err error)
- func RetryAfter(attempts int, callback func() error, d time.Duration) (err error)
- func Until(fn func() error, w io.Writer, name string, sleep time.Duration, ...)
- func ValidateProxyURL(proxyUrl string) error
- func VersionOrdinal(version string) string
- type MultiError
- type ProxyConfig
- type RealRunner
- type Runner
Constants ¶
const OpenShiftRegistryIp = "172.30.1.1"
Variables ¶
This section is empty.
Functions ¶
func CanReadFile ¶
If the file represented by path exists and readable, return true otherwise return false.
func DecryptText ¶ added in v1.0.0
Decrypt from base64 to decrypted string
func EncryptText ¶ added in v1.0.0
Encrypt string to base64 crypto using AES
func EscapeSingleQuote ¶ added in v1.1.0
func GenerateSelfSignedCert ¶
You may also specify additional subject alt names (either ip or dns names) for the certificate The certificate will be created with file mode 0644. The key will be created with file mode 0600. If the certificate or key files already exist, they will be overwritten. Any parent directories of the certPath or keyPath will be created as needed with file mode 0755.
func HomeDir ¶ added in v1.0.0
func HomeDir() string
HomeDir returns the home directory for the current user
func ReadInputFromStdin ¶ added in v1.0.0
func ReadPasswordFromStdin ¶ added in v1.0.0
func Until ¶
Until endlessly loops the provided function until a message is received on the done channel. The function will wait the duration provided in sleep between function calls. Errors will be sent on provider Writer.
func ValidateProxyURL ¶ added in v1.1.0
validateProxyURL validates that the specified proxyURL is valid
func VersionOrdinal ¶ added in v1.0.0
Types ¶
type MultiError ¶ added in v0.3.5
type MultiError struct {
Errors []error
}
func (*MultiError) Collect ¶ added in v0.3.5
func (m *MultiError) Collect(err error)
func (MultiError) ToError ¶ added in v0.3.5
func (m MultiError) ToError() error
type ProxyConfig ¶ added in v1.1.0
type ProxyConfig struct {
// contains filtered or unexported fields
}
ProxyConfig keeps the proxy configuration for the current environment
func NewProxyConfig ¶ added in v1.1.0
func NewProxyConfig(httpProxy string, httpsProxy string, noProxy string) (*ProxyConfig, error)
NewProxyConfig creates a proxy configuration with the specified parameters. If a empty string is passed the corresponding environment variable is checked.
func (*ProxyConfig) AddNoProxy ¶ added in v1.1.0
func (p *ProxyConfig) AddNoProxy(host string)
AddNoProxy appends the specified host to the list of no proxied hosts.
func (*ProxyConfig) ApplyToEnvironment ¶ added in v1.1.0
func (p *ProxyConfig) ApplyToEnvironment()
Sets the current config as environment variables in the current process.
func (*ProxyConfig) HttpProxy ¶ added in v1.1.0
func (p *ProxyConfig) HttpProxy() string
HttpProxy returns the configured value for the HTTP proxy. The empty string is returned in case HTTP proxy is not set.
func (*ProxyConfig) HttpsProxy ¶ added in v1.1.0
func (p *ProxyConfig) HttpsProxy() string
HttpsProxy returns the configured value for the HTTPS proxy. The empty string is returned in case HTTPS proxy is not set.
func (*ProxyConfig) IsEnabled ¶ added in v1.1.0
func (p *ProxyConfig) IsEnabled() bool
Enabled returns true if at least one proxy (HTTP or HTTPS) is configured. Returns false otherwise.
func (*ProxyConfig) NoProxy ¶ added in v1.1.0
func (p *ProxyConfig) NoProxy() string
NoProxy returns a comma separated list of hosts for which proxies should not be applied.
func (*ProxyConfig) ProxyConfig ¶ added in v1.1.0
func (p *ProxyConfig) ProxyConfig() []string
ProxyConfig returns a the proxy configuration as a slice, one element for each of the potential settings HTTP_PROXY, HTTPS_PROXY and NO_PROXY. If proxies are not enabled an empty slice is returned.
type RealRunner ¶ added in v1.0.0
type RealRunner struct{}