This repository has been archived on 2022-09-10. You can view files and clone it, but cannot push or open issues or pull requests.
2022-09-09 06:05:20 +00:00
|
|
|
package tunnel
|
|
|
|
|
2022-09-09 06:31:47 +00:00
|
|
|
import "github.com/google/uuid"
|
|
|
|
|
2022-09-09 06:05:20 +00:00
|
|
|
type ID string
|
2022-09-09 06:31:47 +00:00
|
|
|
|
|
|
|
func NewID() ID {
|
|
|
|
return ID(uuid.NewString())
|
|
|
|
}
|
|
|
|
|
2022-09-09 06:05:20 +00:00
|
|
|
type Type uint8
|
2022-09-09 11:53:46 +00:00
|
|
|
|
|
|
|
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"
|
|
|
|
}
|