utils

package
v0.0.0-...-27c8c4e Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Templates embed.FS

Templates directory

Functions

func BinPath

func BinPath() string

BinPath path to bin

func BinaryExists

func BinaryExists(name string) bool

BinaryExists check for the existence of a binary file

func CertDir

func CertDir() string

CertDir certificate directory

func CertutilPath

func CertutilPath() (string, error)

CertutilPath determine the path to the certutil

func CheckUpdates

func CheckUpdates()

CheckUpdates checking for updates every 24 hours

func ChmodR

func ChmodR(path string, mode os.FileMode) error

ChmodR change file permissions recursively

func CleanSlice

func CleanSlice(s []string) []string

CleanSlice delete an empty value in a slice

func ConfigDir

func ConfigDir() string

ConfigDir config directory (~/.config/dl)

func CreateDirectory

func CreateDirectory(path string) error

CreateDirectory recursively create directories

func CreateTemplates

func CreateTemplates(overwrite bool) error

CreateTemplates create docker-compose files

func GetCompose

func GetCompose() (string, string)

GetCompose get link to executable file and arguments

func HomeDir

func HomeDir() (string, error)

HomeDir user home directory

func HumanSize

func HumanSize(size float64) string

HumanSize convert bytes to human friendly format

func IsAptInstall

func IsAptInstall() bool

IsAptInstall checking for install from apt

func IsBinFileExists

func IsBinFileExists() bool

IsBinFileExists checks the existence of a binary

func IsCertPathExists

func IsCertPathExists() bool

IsCertPathExists check if the certificate directory exists

func IsNeedInstall

func IsNeedInstall() bool

IsNeedInstall checking for the existence of a configuration file

func PathExists

func PathExists(path string) bool

PathExists check for the existence of a path

func RemoveFilesInPath

func RemoveFilesInPath(path string)

RemoveFilesInPath deleting files in a directory

func RemovePath

func RemovePath(path string) error

RemovePath recursively remove directories

func TemplateDir

func TemplateDir() string

TemplateDir template directory (~/.config/dl/templates)

func ToAvailablePercent

func ToAvailablePercent(size uint64, total uint64) float64

ToAvailablePercent calculate free percent

func WpdeployCheck

func WpdeployCheck() bool

WpdeployCheck Legacy app check

Types

type Disk

type Disk struct {
	Total uint64
	Used  uint64
	Free  uint64
}

func CheckFreeSpace

func CheckFreeSpace(path string) (d *Disk)

CheckFreeSpace free space of the specified directory

func FreeSpaceHome

func FreeSpaceHome() (d *Disk)

FreeSpaceHome free space in home directory

func (Disk) CalculateSpaceBeforeDeploy

func (d Disk) CalculateSpaceBeforeDeploy(deployFilesSize float64) float64

CalculateSpaceBeforeDeploy calculate free space before deployment

func (Disk) GetFreeSpace

func (d Disk) GetFreeSpace() float64

GetFreeSpace free space

func (Disk) GetPercentFree

func (d Disk) GetPercentFree() float64

GetPercentFree free space percentage

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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