Documentation ¶
Index ¶
- Constants
- func FileMove(path string, ok bool)
- func FileWatch(callback func(string) bool)
- func GetConfig(key string) (interface{}, error)
- func GetLogLvLID(name string) (uint8, bool)
- func GlimsOutput(FileName string, SampleList []SampleStruct) bool
- func Logging(msg string, lvl uint8)
- func SetConfig(key string, value interface{}) error
- type SampleStruct
Constants ¶
const ( DEBUG = uint8(0) INFO = uint8(1) WARNING = uint8(2) ERROR = uint8(3) CRITICAL = uint8(4) )
Constants for log levels
Variables ¶
This section is empty.
Functions ¶
func FileMove ¶
FileMove moves a file from the given path to a processed or error directory based on the status flag (ok).
func FileWatch ¶
FileWatch continuously watches the directory specified in config.glimsDir for new file creation events. When a new file is detected, it waits for 1 second before executing the provided callback function with the file path as an argument. If the callback returns true, the file is moved to the processed directory; otherwise, it is moved to the error directory. Logging is performed for critical errors during the process.
func GetConfig ¶
GetConfig retrieves the configuration value associated with the given key. Available keys are: 'glimsDir', 'importDir', 'processedDir', 'errorDir', 'logDir', 'logLvl'. Returns the configuration value and a nil error if the key is found, otherwise returns nil and an error indicating that the key is unknown.
func GetLogLvLID ¶
GetLogLvLID returns the ID of the log level associated with the given name, along with a boolean indicating existence.
func GlimsOutput ¶
func GlimsOutput(FileName string, SampleList []SampleStruct) bool
GlimsOutput processes a list of samples and outputs them to a CSV file with the provided filename according to the FlowG standard.