Documentation ¶
Index ¶
- Constants
- func DeleteFile(filepath string) error
- func FormatMemory(input int) string
- func FormatUptime(startTime, currentTime int64) string
- func GetFile(filepath string) (*os.File, error)
- func GetTableWriter() *tablewriter.Table
- func PadString(str string, totalSize int) string
- func SafeReadTomlFile(filename string, v interface{}) error
- func SafeWriteTomlFile(v interface{}, filename string) error
- func WriteFile(filepath string, b []byte) error
- type FileMutex
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func DeleteFile ¶
DeleteFile will delete filepath permanently. Returns an error in case there's any.
func FormatUptime ¶
FormatUptime will figure out current proc uptime
func GetFile ¶
GetFile will open filepath. Returns a tuple with a file and an error in case there's any.
func GetTableWriter ¶ added in v0.2.1
func GetTableWriter() *tablewriter.Table
GetTableWriter will return instance of tablewriter
func PadString ¶
PadString will add totalSize spaces evenly to the right and left side of str. Returns str after applying the pad.
func SafeReadTomlFile ¶
SafeReadTomlFile will try to acquire a lock on the file and then read its content afterwards. Returns an error in case there's any.
func SafeWriteTomlFile ¶
SafeWriteTomlFile will try to acquire a lock on the file and then write to it. Returns an error in case there's any.
Types ¶
type FileMutex ¶
type FileMutex struct {
// contains filtered or unexported fields
}
FileMutex is a wrapper used to create lock on files.
func MakeFileMutex ¶
MakeFileMutex will create a FileMutex intance. Returns a FileMutex instance.