cli

package
v0.0.1-alpha-old Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2023 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ASSETS_MYKUBE_DIR = ".mykube"

Directories

View Source
var ASSETS_MYKUBE_VM_DIR = ""
View Source
var DIRECTORIES_UTIL = [3]string{}
View Source
var LIBVIRT_MYKUBE_DIR = "/var/lib/libvirt/images/mykube"
View Source
var LIBVIRT_MYKUBE_UTIL_BASE_IMAGE_PATH = LIBVIRT_MYKUBE_UTIL_DIR + "/" + "Base-image.qcow2"
View Source
var LIBVIRT_MYKUBE_UTIL_BASE_IMAGE_URL = "https://drive.google.com/uc?export=download&confirm=t&id=1x727Dbkze9gAXH_E6m-UfQddhIuFt-63"

Utils TODO: REPLACE BASE IMAGE URL AND EXTRACT TAR FILE var LIBVIRT_MYKUBE_UTIL_BASE_IMAGE_URL = "https://github.com/guyst16/mykube/raw/Feat/Refactor_Golang/image-assets/Base-image.qcow2?download="

View Source
var LIBVIRT_MYKUBE_UTIL_CLOUDCONFIG_ISO_PATH = LIBVIRT_MYKUBE_UTIL_DIR + "/" + "cidata.iso"
View Source
var LIBVIRT_MYKUBE_UTIL_DIR = LIBVIRT_MYKUBE_DIR + "/" + "util"
View Source
var LIBVIRT_MYKUBE_VM_BASE_IMAGE_PATH = ""
View Source
var LIBVIRT_MYKUBE_VM_CLOUDCONFIG_PATH = ""
View Source
var LIBVIRT_MYKUBE_VM_DIR = ""
View Source
var LIBVIRT_MYKUBE_VM_METADATA_PATH = ""
View Source
var OS_IMAGE_SHA256SUM = "cafd46df34c9dacb981391e339e00ae582bdcd5d42441bd2708ab54cc5ee856e"

Validate

View Source
var QEMU_GID = 107
View Source
var QEMU_UID = 107

Functions

func Cli

func Cli()

TODO: Handle all err inside the helpers functions

func CopyFile

func CopyFile(src string, dest string) (err error)

func CreateISO

func CreateISO(filesListFullPath []string, outputISOPath string)

Create new cidata ISO file

func DownloadFile

func DownloadFile(filepath string, url string) (err error)

Download files to specific destination

func GetVM

func GetVM(vmName string) (vm *libvirt.Domain, err error)

Return vm details

func ValidateOSImage

func ValidateOSImage(filePath string, validSHA256sum string) (err error)

Validate the given image file, else return an error

Types

type WriteCounter

type WriteCounter struct {
	Total uint64
}

Progress bar type and functions

func (WriteCounter) PrintProgress

func (wc WriteCounter) PrintProgress()

func (*WriteCounter) Write

func (wc *WriteCounter) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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