Documentation ¶
Index ¶
- func CheckIfPathExist(path string) bool
- func CheckIfServiceIsInstalled(serv string) (bool, error)
- func CleanString(s string) string
- func CreateLogger(filename string) *logger.Logger
- func CreatePathIfNotExist(path string) error
- func DetectLinuxFamily() (string, error)
- func DoReq[response any](url string, data []byte, method string, headers map[string]string, ...) (response, int, error)
- func DownloadFile(url string, fileName string) error
- func Execute(c string, dir string, arg ...string) error
- func ExecuteWithResult(c string, dir string, arg ...string) (string, bool)
- func GetCurrentTime() string
- func GetMyPath() (string, error)
- func IncrementReconnectDelay(delay time.Duration, maxReconnectDelay time.Duration) time.Duration
- func IsPortOpen(ip, port string) bool
- func IsProcessRunning(processName string) (bool, error)
- func LoadTLSCredentials(crtName string) (*tls.Config, error)
- func ReadJson(fileName string, data interface{}) error
- func ReadYAML(path string, result interface{}) error
- func RemoveLock(lockdir string) error
- func SetLock(lockdir string) error
- func StopProcess(processName string) error
- func StopService(name string) error
- func UninstallService(name string) error
- func Unzip(zipFile, destPath string) error
- func WriteJSON(path string, data interface{}) error
- type BeautyLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckIfPathExist ¶
func CheckIfServiceIsInstalled ¶
CheckIfServiceIsInstalled checks if a service is installed
func CleanString ¶
func CreateLogger ¶
CreateLogger returns a single instance of a Logger configured to save logs to a rotating file.
func CreatePathIfNotExist ¶
CreatePathIfNotExist creates a specific path if not exist
func DetectLinuxFamily ¶
func DownloadFile ¶
DownloadFile downloads a file from a URL and saves it to disk. Returns an error on failure.
func GetCurrentTime ¶
func GetCurrentTime() string
func GetMyPath ¶
GetMyPath returns the directory path where the currently running executable is located. Returns a string representing the directory path, and an error if any error occurs during the process.
func IncrementReconnectDelay ¶
func IsPortOpen ¶
func IsProcessRunning ¶
IsProcessRunning checks if a process is active
func ReadJson ¶
ReadJson reads the json data from the specified file URL and unmarshal it into the provided result interface{}. Returns an error if any error occurs during the process.
func ReadYAML ¶
ReadYAML reads the YAML data from the specified file URL and deserializes it into the provided result interface{}. Returns an error if any error occurs during the process.
func RemoveLock ¶
func StopProcess ¶
StopProcess checks if a process is active, if so it stops it
func StopService ¶
func UninstallService ¶
Types ¶
type BeautyLogger ¶
type BeautyLogger struct { }
func GetBeautyLogger ¶
func GetBeautyLogger() *BeautyLogger
func (*BeautyLogger) PrintBanner ¶
func (b *BeautyLogger) PrintBanner()
func (*BeautyLogger) WriteError ¶
func (b *BeautyLogger) WriteError(msg string, err error)
func (*BeautyLogger) WriteSimpleMessage ¶
func (b *BeautyLogger) WriteSimpleMessage(msg string)
func (*BeautyLogger) WriteSuccessfull ¶
func (b *BeautyLogger) WriteSuccessfull(msg string)