Remove Snowflake interface, use *WebRTCPeer directly.

The other interfaces in client/lib/interfaces.go exist for the purpose
of running tests, but not Snowflake. Existing code would not have worked
with other types anyway, because it does unchecked .(*WebRTCPeer)
conversions.
This commit is contained in:
David Fifield 2020-04-24 14:21:08 -06:00
parent d9b076c32e
commit 76732155e7
5 changed files with 15 additions and 28 deletions

View file

@ -9,16 +9,9 @@ type Connector interface {
Connect() error
}
// Interface for a single remote WebRTC peer.
// In the Client context, "Snowflake" refers to the remote browser proxy.
type Snowflake interface {
io.ReadWriteCloser
Connector
}
// Interface for catching Snowflakes. (aka the remote dialer)
type Tongue interface {
Catch() (Snowflake, error)
Catch() (*WebRTCPeer, error)
}
// Interface for collecting some number of Snowflakes, for passing along
@ -26,10 +19,10 @@ type Tongue interface {
type SnowflakeCollector interface {
// Add a Snowflake to the collection.
// Implementation should decide how to connect and maintain the webRTCConn.
Collect() (Snowflake, error)
Collect() (*WebRTCPeer, error)
// Remove and return the most available Snowflake from the collection.
Pop() Snowflake
Pop() *WebRTCPeer
// Signal when the collector has stopped collecting.
Melted() <-chan struct{}