chore: tunnel recorder & slight refactor
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
26
tunnel/stream.go
Normal file
26
tunnel/stream.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package tunnel
|
||||
|
||||
import (
|
||||
"io"
|
||||
"net"
|
||||
)
|
||||
|
||||
var _ Stream = (*streamImpl)(nil)
|
||||
|
||||
type Stream interface {
|
||||
io.ReadWriteCloser
|
||||
Source() string
|
||||
}
|
||||
|
||||
func NewStream(conn net.Conn, source string) Stream {
|
||||
return &streamImpl{conn, source}
|
||||
}
|
||||
|
||||
type streamImpl struct {
|
||||
net.Conn
|
||||
source string
|
||||
}
|
||||
|
||||
func (s *streamImpl) Source() string {
|
||||
return s.source
|
||||
}
|
||||
Reference in New Issue
Block a user