einfo

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package einfo provides primitives for searching and processing data in Info files.

Index

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

func ParseZInfoMsg(data []byte) (ZInfoMsg *info.ZInfoMsg, err error)

ParseZInfoMsg unmarshal ZInfoMsg

func ZInfoFind

func ZInfoFind(im *info.ZInfoMsg, query map[string]string) bool

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'

func ZInfoPrn

func ZInfoPrn(im *info.ZInfoMsg, format types.OutputFormat)

ZInfoPrn print data from ZInfoMsg structure

Types

type HandlerFunc

type HandlerFunc func(im *info.ZInfoMsg) bool

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

type QHandlerFunc

type QHandlerFunc func(im *info.ZInfoMsg, query map[string]string) bool

QHandlerFunc must process info.ZInfoMsg with query parameters and return true to exit or false to continue

Jump to

Keyboard shortcuts

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