Documentation
¶
Index ¶
- func CheckIfPathExist(path string) bool
- func CheckIfServiceIsActive(serv string) (bool, error)
- func CleanString(s string) string
- func CreateLogger(filename string) *logger.Logger
- 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 ReadJson(fileName string, data interface{}) error
- func ReadYAML(path string, result interface{}) error
- func RemoveLock(lockdir string) error
- func RestartService(serv string) error
- func StopService(name string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckIfPathExist ¶
func CheckIfServiceIsActive ¶
CheckIfServiceIsActive checks if a service is active or running
func CleanString ¶
func CreateLogger ¶
CreateLogger returns a single instance of a Logger configured to save logs to a rotating file.
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 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 StopService ¶
Types ¶
This section is empty.