converge/pkg/testsupport/bitpipe.go
Erik Brakkee d5a6d70bc4 restructuring test code by introducing a testsupport package
Making it easy 6to start a porof server in tests.
2024-08-20 09:01:46 +02:00

22 lines
558 B
Go

package testsupport
import "git.wamblee.org/converge/pkg/support/iowrappers"
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() iowrappers.ReadWriteAddrCloser
Back() iowrappers.ReadWriteAddrCloser
}