util

package
v0.0.0-...-80cfa99 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2017 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIServerPort             = 8443
	DefaultLocalkubeDirectory = "/var/lib/localkube"
	DefaultCertPath           = DefaultLocalkubeDirectory + "/certs/"
	DefaultKubeConfigPath     = DefaultLocalkubeDirectory + "/kubeconfig"
	DefaultServiceClusterIP   = "10.0.0.1"
	DefaultDNSDomain          = "cluster.local"
	DefaultDNSIP              = "10.0.0.10"
	DefaultInsecureRegistry   = "10.0.0.0/24"
)

These constants are used by both minikube and localkube

Variables

This section is empty.

Functions

func CanReadFile

func CanReadFile(path string) bool

If the file represented by path exists and readable, return true otherwise return false.

func ChownR

func ChownR(path string, uid, gid int) error

func FindAndSet

func FindAndSet(path string, c interface{}, value string) error

FindAndSet sets the nested value.

func GenerateCACert

func GenerateCACert(certPath, keyPath string, name string) error

func GenerateSignedCert

func GenerateSignedCert(certPath, keyPath string, ips []net.IP, alternateDNS []string, signerCertPath, signerKeyPath string) error

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 GetAlternateDNS

func GetAlternateDNS(domain string) []string

func GetLocalkubeDownloadURL

func GetLocalkubeDownloadURL(versionOrURL string, filename string) (string, error)

func IsDirectory

func IsDirectory(path string) (bool, error)

func MaybeChownDirRecursiveToMinikubeUser

func MaybeChownDirRecursiveToMinikubeUser(dir string) error

func Pad

func Pad(str string) string

func ParseSHAFromURL

func ParseSHAFromURL(url string) (string, error)

func Retry

func Retry(attempts int, callback func() error) (err error)

func RetryAfter

func RetryAfter(attempts int, callback func() error, d time.Duration) (err error)

func Until

func Until(fn func() error, w io.Writer, name string, sleep time.Duration, done <-chan struct{})

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.

Types

type DefaultDownloader

type DefaultDownloader struct{}

func (DefaultDownloader) CacheMinikubeISOFromURL

func (f DefaultDownloader) CacheMinikubeISOFromURL(isoURL string) error

func (DefaultDownloader) GetISOCacheFilepath

func (f DefaultDownloader) GetISOCacheFilepath(isoURL string) string

func (DefaultDownloader) GetISOFileURI

func (f DefaultDownloader) GetISOFileURI(isoURL string) string

func (DefaultDownloader) IsMinikubeISOCached

func (f DefaultDownloader) IsMinikubeISOCached(isoURL string) bool

func (DefaultDownloader) ShouldCacheMinikubeISO

func (f DefaultDownloader) ShouldCacheMinikubeISO(isoURL string) bool

type ExtraOption

type ExtraOption struct {
	Component string
	Key       string
	Value     string
}

func (*ExtraOption) String

func (e *ExtraOption) String() string

type ExtraOptionSlice

type ExtraOptionSlice []ExtraOption

func (*ExtraOptionSlice) Set

func (es *ExtraOptionSlice) Set(value string) error

func (*ExtraOptionSlice) String

func (es *ExtraOptionSlice) String() string

func (*ExtraOptionSlice) Type

func (es *ExtraOptionSlice) Type() string

type ISODownloader

type ISODownloader interface {
	GetISOFileURI(isoURL string) string
	CacheMinikubeISOFromURL(isoURL string) error
}

type MultiError

type MultiError struct {
	Errors []error
}

func (*MultiError) Collect

func (m *MultiError) Collect(err error)

func (MultiError) ToError

func (m MultiError) ToError() error

type RetriableError

type RetriableError struct {
	Err error
}

func (RetriableError) Error

func (r RetriableError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL