mcnutils

package
v0.16.4 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AUFSBugB2DVersions = map[string]string{
		"v1.9.1": "https://github.com/docker/docker/issues/18180",
	}
)
View Source
var (
	GithubAPIToken string
)

Functions

func CopyFile

func CopyFile(src, dst string) error

func GenerateRandomID

func GenerateRandomID() string

GenerateRandomID returns an unique id

func GetHomeDir

func GetHomeDir() string

GetHomeDir returns the home directory TODO: Having this here just strikes me as dangerous, but some of the drivers depend on it ;_;

func GetUsername

func GetUsername() string

func MakeDiskImage added in v0.5.5

func MakeDiskImage(publicSSHKeyPath string) (*bytes.Buffer, error)

MakeDiskImage makes a boot2docker VM disk image. See https://github.com/boot2docker/boot2docker/blob/master/rootfs/rootfs/etc/rc.d/automount

func TruncateID

func TruncateID(id string) string

TruncateID returns a shorten id 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 WaitFor

func WaitFor(f func() bool) error

func WaitForSpecific

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

func WaitForSpecificOrError

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(storePath string) *B2dUtils

func (*B2dUtils) CopyIsoToMachineDir

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

func (*B2dUtils) DownloadISO

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

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

func (*B2dUtils) DownloadISOFromURL

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

func (*B2dUtils) DownloadLatestBoot2Docker

func (b *B2dUtils) DownloadLatestBoot2Docker(apiURL string) error

func (*B2dUtils) UpdateISOCache added in v0.5.5

func (b *B2dUtils) UpdateISOCache(isoURL string) error

type MultiError added in v0.8.0

type MultiError struct {
	Errs []error
}

func (MultiError) Error added in v0.8.0

func (e MultiError) Error() string

type ReaderWithProgress added in v0.5.1

type ReaderWithProgress struct {
	io.ReadCloser
	// contains filtered or unexported fields
}

func (*ReaderWithProgress) Close added in v0.5.1

func (r *ReaderWithProgress) Close() error

func (*ReaderWithProgress) Read added in v0.5.1

func (r *ReaderWithProgress) Read(p []byte) (int, error)

Jump to

Keyboard shortcuts

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