Documentation
¶
Overview ¶
Package einfo provides primitives for searching and processing data in Info files.
Index ¶
- func InfoChecker(loader loaders.Loader, devUUID uuid.UUID, query map[string]string, ...) (err error)
- func InfoLast(loader loaders.Loader, query map[string]string, qhandler QHandlerFunc, ...) error
- func InfoWatch(loader loaders.Loader, query map[string]string, qhandler QHandlerFunc, ...) error
- func ParseZInfoMsg(data []byte) (ZInfoMsg *info.ZInfoMsg, err error)
- func ZInfoFind(im *info.ZInfoMsg, query map[string]string) bool
- func ZInfoPrintFiltered(im *info.ZInfoMsg, query []string) *types.PrintResult
- func ZInfoPrn(im *info.ZInfoMsg, format types.OutputFormat)
- type HandlerFunc
- type InfoCheckerMode
- type QHandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InfoChecker ¶
func InfoChecker(loader loaders.Loader, devUUID uuid.UUID, query map[string]string, handler HandlerFunc, mode InfoCheckerMode, timeout time.Duration) (err error)
InfoChecker checks the information in the regular expression pattern 'query' and processes the info.ZInfoMsg found by the function 'handler' from existing files (mode=InfoExist), new files (mode=InfoNew) or any of them (mode=InfoAny) with timeout (0 for infinite).
func InfoLast ¶
func InfoLast(loader loaders.Loader, query map[string]string, qhandler QHandlerFunc, handler HandlerFunc) error
InfoLast search Info files in the 'filepath' directory according to the 'query' parameters accepted by the 'qhandler' function and subsequent process using the 'handler' function.
func InfoWatch ¶
func InfoWatch(loader loaders.Loader, query map[string]string, qhandler QHandlerFunc, handler HandlerFunc, timeoutSeconds time.Duration) error
InfoWatch monitors the change of Info files in the 'filepath' directory according to the 'query' parameters accepted by the 'qhandler' function and subsequent processing using the 'handler' function with 'timeoutSeconds'.
func ParseZInfoMsg ¶
ParseZInfoMsg unmarshal ZInfoMsg
func ZInfoFind ¶
ZInfoFind finds ZInfoMsg records with 'devid' and ZInfoDevSWF structure fields by reqexps in 'query'
func ZInfoPrintFiltered ¶ added in v1.0.0
func ZInfoPrintFiltered(im *info.ZInfoMsg, query []string) *types.PrintResult
ZInfoPrintFiltered finds ZInfoMsg records by path in 'query'
Types ¶
type HandlerFunc ¶
HandlerFunc must process info.ZInfoMsg and return true to exit or false to continue
func HandleFactory ¶ added in v1.0.0
func HandleFactory(format types.OutputFormat, once bool) HandlerFunc
HandleFactory implements HandlerFunc which prints info in the provided format
type InfoCheckerMode ¶
type InfoCheckerMode int
InfoCheckerMode is InfoExist, InfoNew and InfoAny
const ( InfoExist InfoCheckerMode = -3 // just look to existing files InfoNew InfoCheckerMode = -2 // wait for new files InfoAny InfoCheckerMode = -1 // use both mechanisms )
InfoChecker modes InfoExist, InfoNew and InfoAny.
func InfoTail ¶
func InfoTail(count uint) InfoCheckerMode
InfoTail returns InfoCheckerMode for process only defined count of last messages