utils

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2015 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(src, dst string) error

func DumpVal added in v0.2.0

func DumpVal(vals ...interface{})

func GenerateCACertificate

func GenerateCACertificate(certFile, keyFile, org string, bits int) error

GenerateCACertificate generates a new certificate authority from the specified org and bit size and stores the resulting certificate and key file in the arguments.

func GenerateCert

func GenerateCert(hosts []string, certFile, keyFile, caFile, caKeyFile, org string, bits int) error

GenerateCert generates a new certificate signed using the provided certificate authority files and stores the result in the certificate file and key provided. The provided host names are set to the appropriate certificate fields.

func GenerateRandomID added in v0.3.0

func GenerateRandomID() string

GenerateRandomID returns an unique id

func GetBaseDir

func GetBaseDir() string

func GetDockerDir

func GetDockerDir() string

func GetHomeDir

func GetHomeDir() string

func GetMachineCacheDir

func GetMachineCacheDir() string

func GetMachineCertDir

func GetMachineCertDir() string

func GetMachineDir

func GetMachineDir() string

func GetUsername

func GetUsername() string

func TruncateID added in v0.3.0

func TruncateID(id string) string

Following two functions are from github.com/docker/docker/utils module. It was way overkill to include the whole module, so we just have these bits that we're using here.

func ValidateCertificate added in v0.2.0

func ValidateCertificate(addr, caCertPath, serverCertPath, serverKeyPath string) (bool, error)

func WaitFor added in v0.2.0

func WaitFor(f func() bool) error

func WaitForDocker added in v0.2.0

func WaitForDocker(ip string, daemonPort int) error

func WaitForSpecific added in v0.2.0

func WaitForSpecific(f func() bool, maxAttempts int, waitInterval time.Duration) error

func WaitForSpecificOrError added in v0.3.0

func WaitForSpecificOrError(f func() (bool, error), maxAttempts int, waitInterval time.Duration) error

Types

type B2dUtils

type B2dUtils struct {
	// contains filtered or unexported fields
}

func NewB2dUtils

func NewB2dUtils(githubApiBaseUrl, githubBaseUrl string) *B2dUtils

func (*B2dUtils) CopyIsoToMachineDir added in v0.2.0

func (b *B2dUtils) CopyIsoToMachineDir(isoURL, machineName string) error

func (*B2dUtils) DownloadISO

func (b *B2dUtils) DownloadISO(dir, file, isoUrl string) error

Download boot2docker ISO image for the given tag and save it at dest.

func (*B2dUtils) DownloadISOFromURL added in v0.3.0

func (b *B2dUtils) DownloadISOFromURL(latestReleaseUrl string) error

func (*B2dUtils) DownloadLatestBoot2Docker added in v0.2.0

func (b *B2dUtils) DownloadLatestBoot2Docker() error

func (*B2dUtils) GetLatestBoot2DockerReleaseURL

func (b *B2dUtils) GetLatestBoot2DockerReleaseURL() (string, error)

Get the latest boot2docker release tag name (e.g. "v0.6.0"). FIXME: find or create some other way to get the "latest release" of boot2docker since the GitHub API has a pretty low rate limit on API requests

Jump to

Keyboard shortcuts

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