converge/pkg/support/iowrappers/bitpipe.go
Erik Brakkee 3f3635b056 a lot of progress in setting up tests for the communication.
Wrote ChannelReadWriter that simulates a connection inmemory.
This is used by the agentserver test for testing the initialization. The
first test is already working.
2024-09-08 11:16:49 +02:00

20 lines
477 B
Go

package 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() ReadWriteAddrCloser
Back() ReadWriteAddrCloser
}