All checks were successful
continuous-integration/drone/push Build is passing
27 lines
342 B
Go
27 lines
342 B
Go
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
|
|
}
|