26 lines
351 B
Go
26 lines
351 B
Go
package tunnel
|
|
|
|
import "github.com/google/uuid"
|
|
|
|
type ID string
|
|
|
|
func NewID() ID {
|
|
return ID(uuid.NewString())
|
|
}
|
|
|
|
type Type uint8
|
|
|
|
func (t Type) String() string {
|
|
switch t {
|
|
case TypeNormal:
|
|
return "normal"
|
|
case TypeRequest:
|
|
return "request"
|
|
case TypeConnected:
|
|
return "connected"
|
|
case TypeClosed:
|
|
return "closed"
|
|
}
|
|
return "invalid"
|
|
}
|