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

Struct SystemFunc

lang/core/os/system.go:73–88  ·  view source on GitHub ↗

SystemFunc runs a string as a shell command, then produces each line from stdout. If the input string changes, then the commands are executed one after the other and the concatenation of their outputs is produced line by line. Note that in the likely case in which the process emits several lines on

Source from the content-addressed store, hash-verified

71// coordination. If you are using this for an intermediate value, or a
72// non-declarative system, then it's likely you are using this wrong.
73type SystemFunc struct {
74 interfaces.Textarea
75
76 init *interfaces.Init
77 cancel context.CancelFunc
78
79 input chan string // stream of inputs
80
81 last *string // the active command
82 output *string // the last output
83
84 values chan string
85
86 count int
87 mutex *sync.Mutex
88}
89
90// String returns a simple name for this function. This is needed so this struct
91// can satisfy the pgraph.Vertex interface.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected