mirror of
https://github.com/slackhq/nebula.git
synced 2025-11-22 16:34:25 +01:00
Public Release
This commit is contained in:
32
sshd/writer.go
Normal file
32
sshd/writer.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package sshd
|
||||
|
||||
import "io"
|
||||
|
||||
type StringWriter interface {
|
||||
WriteLine(string) error
|
||||
Write(string) error
|
||||
WriteBytes([]byte) error
|
||||
GetWriter() io.Writer
|
||||
}
|
||||
|
||||
type stringWriter struct {
|
||||
w io.Writer
|
||||
}
|
||||
|
||||
func (w *stringWriter) WriteLine(s string) error {
|
||||
return w.Write(s + "\n")
|
||||
}
|
||||
|
||||
func (w *stringWriter) Write(s string) error {
|
||||
_, err := w.w.Write([]byte(s))
|
||||
return err
|
||||
}
|
||||
|
||||
func (w *stringWriter) WriteBytes(b []byte) error {
|
||||
_, err := w.w.Write(b)
|
||||
return err
|
||||
}
|
||||
|
||||
func (w *stringWriter) GetWriter() io.Writer {
|
||||
return w.w
|
||||
}
|
||||
Reference in New Issue
Block a user