Documentation ¶
Overview ¶
Package einfo provides primitives for searching and processing data in Info files.
Index ¶
- func HandleAll(im *info.ZInfoMsg, ds []*ZInfoMsgInterface) bool
- func HandleFirst(im *info.ZInfoMsg, ds []*ZInfoMsgInterface) bool
- func InfoChecker(loader loaders.Loader, devUUID uuid.UUID, query map[string]string, ...) (err error)
- func InfoFind(im *info.ZInfoMsg, query map[string]string) int
- func InfoLast(loader loaders.Loader, query map[string]string, qhandler QHandlerFunc, ...) error
- func InfoPrn(im *info.ZInfoMsg)
- func InfoWatch(loader loaders.Loader, query map[string]string, qhandler QHandlerFunc, ...) error
- func ParseZInfoMsg(data []byte) (ZInfoMsg *info.ZInfoMsg, err error)
- func ZInfoPrint(im *info.ZInfoMsg, query []string) *types.PrintResult
- func ZInfoPrn(im *info.ZInfoMsg, ds []*ZInfoMsgInterface)
- type HandlerFunc
- type InfoCheckerMode
- type QHandlerFunc
- type ZInfoMsgInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleAll ¶
func HandleAll(im *info.ZInfoMsg, ds []*ZInfoMsgInterface) bool
HandleAll runs for all Info's selected by InfoWatch
func HandleFirst ¶
func HandleFirst(im *info.ZInfoMsg, ds []*ZInfoMsgInterface) bool
HandleFirst runs once and interrupts the workflow of InfoWatch
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 InfoFind ¶
InfoFind find ZInfoMsg records by reqexps in 'query' corresponded to devId and ZInfoDevSW structure.
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 ZInfoPrint ¶
func ZInfoPrint(im *info.ZInfoMsg, query []string) *types.PrintResult
ZInfoPrint finds ZInfoMsg records by path in 'query'
func ZInfoPrn ¶
func ZInfoPrn(im *info.ZInfoMsg, ds []*ZInfoMsgInterface)
ZInfoPrn print data from ZInfoMsg structure
Types ¶
type HandlerFunc ¶
type HandlerFunc func(im *info.ZInfoMsg, ds []*ZInfoMsgInterface) bool
HandlerFunc must process info.ZInfoMsg and return true to exit or false to continue
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
type QHandlerFunc ¶
type QHandlerFunc func(im *info.ZInfoMsg, query map[string]string) []*ZInfoMsgInterface
QHandlerFunc must process info.ZInfoMsg with query parameters and return true to exit or false to continue
type ZInfoMsgInterface ¶
type ZInfoMsgInterface interface{}
ZInfoMsgInterface is an interface to pass between handlers