Files
nebula/commands/writer.go
Matt RichardsonandClaude Fable 5.1 0f767ce529 Add a local control socket and nebula ctl (#1975)
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>
2026-10-21 11:16:00 -04:00

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}
}