converge/pkg/testsupport/bitpipe.go

22 lines
549 B
Go

package testsupport
import "git.wamblee.org/converge/pkg/support/ioutils"
type DummyRemoteAddr string
func (r DummyRemoteAddr) Network() string {
return string(r)
}
func (r DummyRemoteAddr) String() string {
return string(r)
}
// A bitpipe is mainly a test utility. It uses byte buffers to perform bi-directional
// communication. The test code can read and write from one side of the bitpipe and the
// code under test reads the other side.
type BitPipe interface {
Front() ioutils.ReadWriteAddrCloser
Back() ioutils.ReadWriteAddrCloser
}