mirror of
https://github.com/slackhq/nebula.git
synced 2026-11-15 16:46:52 +01:00
Add support for accessing the previously ssh-only debug commands via `nebula ctl <command>.` - unix socket (named pipe on windows) for communication - sockets scoped to the user + an optional group - in cmd/nebula and cmd/nebula-service, but not nebula.Main Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
24 lines
744 B
Go
24 lines
744 B
Go
package commands
|
|
|
|
import "io"
|
|
|
|
// Output is where a command line surface's text goes.
|
|
//
|
|
// Out and Err are distinct so a command's primary output can stay machine readable on
|
|
// a surface that separates the two. The ssh surface points both at the same channel and
|
|
// sees a single merged stream. The local
|
|
// control socket does not use one at all: it invokes by named parameter and carries the
|
|
// returned value, so there is no stream for a command to write to.
|
|
type Output struct {
|
|
// Out receives what a command produces.
|
|
Out io.Writer
|
|
|
|
// Err receives usage text, refusals and errors.
|
|
Err io.Writer
|
|
}
|
|
|
|
// MergedOutput sends output and errors to the same writer.
|
|
func MergedOutput(w io.Writer) Output {
|
|
return Output{Out: w, Err: w}
|
|
}
|