MCPcopy
hub / github.com/purpleidea/mgmt / ReadFileWaitFunc

Struct ReadFileWaitFunc

lang/core/os/readfilewait.go:63–73  ·  view source on GitHub ↗

ReadFileWaitFunc is a function that reads the full contents from a local file. If the file contents change or the file path changes, a new string will be sent. This is different from the normal readfile in that if will not error if the file doesn't exist. If the file is not found, it returns the emp

Source from the content-addressed store, hash-verified

61// string. If the file re-appears, it returns those new contents. This function
62// will eventually be deprecated when the function graph error system is stable.
63type ReadFileWaitFunc struct {
64 interfaces.Textarea
65
66 init *interfaces.Init
67
68 recWatcher *recwatch.RecWatcher
69 events chan error // internal events
70
71 input chan string // stream of inputs
72 filename *string // the active filename
73}
74
75// String returns a simple name for this function. This is needed so this struct
76// can satisfy the pgraph.Vertex interface.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected