mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 05:11:19 -04:00
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:
parent
d9b076c32e
commit
76732155e7
5 changed files with 15 additions and 28 deletions
|
@ -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{}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue