util

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigFile = "/etc/gdg.cfg"
	DataDir    = "/var/log/gdg-data/"
)

Constants for file/direction locations following FHS 3.0 Specification

Variables

This section is empty.

Functions

func Check

func Check(e error)

Check error

func Contains added in v0.9.2

func Contains(a []string, x string) bool

Contains tells whether a contains x.

func CreateDir

func CreateDir(dirName string) (err error)

CreateDir function

func CreateFile

func CreateFile(fileName string) (err error)

CreateFile function

func CreateHeader

func CreateHeader() string

CreateHeader will create date header for .dat files

func CurrentDatFile

func CurrentDatFile(utility string) string

CurrentDatFile function

func DStateCount

func DStateCount() int64

DStateCount will return the number of processes in D state

func DirSizeMB

func DirSizeMB(dir string) (sizeMB float64, err error)

DirSizeMB gets the size of the datadir

func GetConfigKeyValue

func GetConfigKeyValue(key string, section string) (value string, err error)

GetConfigKeyValue gets the configuration file key value

func GetShortHostname

func GetShortHostname() string

GetShortHostname function

func GetStatus

func GetStatus(progName string, ver string)

GetStatus will get the current status in config

func Gzipit added in v0.9.2

func Gzipit(source, target string) error

Compress (.gz) a file and delete

func RangeDate added in v0.9.2

func RangeDate(start, end time.Time) func() time.Time

rangeDate returns a date range function over start date to end date inclusive. After the end of the range, the range function returns a zero date, date.IsZero() is true.

func SetConfigKey

func SetConfigKey(key string, value string, section string) (err error)

SetConfigKey sets the configuration file key value

Types

This section is empty.

Jump to

Keyboard shortcuts

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