refactor transport callbacks as interface (#2423)

* refactor transport callbacks as interface

* test
This commit is contained in:
Paul Wells
2024-01-28 21:35:25 -08:00
committed by GitHub
parent efbc985c82
commit 0be241eed8
8 changed files with 928 additions and 418 deletions
+26
View File
@@ -0,0 +1,26 @@
package transport
import "fmt"
type NegotiationState int
const (
NegotiationStateNone NegotiationState = iota
// waiting for remote description
NegotiationStateRemote
// need to Negotiate again
NegotiationStateRetry
)
func (n NegotiationState) String() string {
switch n {
case NegotiationStateNone:
return "NONE"
case NegotiationStateRemote:
return "WAITING_FOR_REMOTE"
case NegotiationStateRetry:
return "RETRY"
default:
return fmt.Sprintf("%d", int(n))
}
}