util

package
v1.3.0-rc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2016 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Overview

Package util provides utility functions for the cmd packages.

Index

Constants

View Source
const (
	ProductOrigin           = `Origin`
	ProductOpenShift        = `OpenShift`
	ProductAtomicEnterprise = `Atomic Enterprise`
)

Variables

View Source
var ErrExit = fmt.Errorf("exit directly")

ErrExit is a marker interface for cli commands indicating that the response has been processed

View Source
var ErrorNoDefaultIP = errors.New("no suitable IP address")

ErrorNoDefaultIP is returned when no suitable non-loopback address can be found.

Functions

func AllLocalIP4

func AllLocalIP4() ([]net.IP, error)

AllLocalIP4 returns all the IPv4 addresses that this host can be reached on.

func CertPoolFromFile

func CertPoolFromFile(filename string) (*x509.CertPool, error)

func CertificatesFromFile

func CertificatesFromFile(file string) ([]*x509.Certificate, error)

func CertificatesFromPEM

func CertificatesFromPEM(pemCerts []byte) ([]*x509.Certificate, error)

func DefaultLocalIP4

func DefaultLocalIP4() (net.IP, error)

DefaultLocalIP4 returns an IPv4 address that this host can be reached on. Will return NoDefaultIP if no suitable address can be found.

func DefaultSubCommandRun

func DefaultSubCommandRun(out io.Writer) func(c *cobra.Command, args []string)

func Env

func Env(key string, defaultValue string) string

Env returns an environment variable or a default value if not specified.

func EnvInt

func EnvInt(key string, defaultValue int32, minValue int32) int32

func GetCertificateFunc