mcnutils

package
v0.0.0-...-a50f796 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

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

MakeDiskImage makes a boot2podman VM disk image. See https://github.com/boot2podman/boot2podman/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 B2pUtils

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

func NewB2pUtils

func NewB2pUtils(storePath string) *B2pUtils

func (*B2pUtils) CopyIsoToMachineDir

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

func (*B2pUtils) DownloadISO

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

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

func (*B2pUtils) DownloadISOFromURL

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

func (*B2pUtils) DownloadLatestBoot2Podman

func (b *B2pUtils) DownloadLatestBoot2Podman(apiURL string) error

func (*B2pUtils) UpdateISOCache

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

type MultiError

type MultiError struct {
	Errs []error
}

func (MultiError) Error

func (e MultiError) Error() string

type ReaderWithProgress

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

func (*ReaderWithProgress) Close

func (r *ReaderWithProgress) Close() error

func (*ReaderWithProgress) Read

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