converge/pkg/testsupport/bitpipe.go
Erik Brakkee 7d25f39f5b test for connecting clients and bidirectional communication to agent.
Required lots of rework since the GOBChannel appeared to be reading
ahead of the data it actually needed. Now using more low-level IO
to send the clientId over to the agent instead.
2024-08-22 16:16:02 +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
}