mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-30 22:34:15 -05:00
dfbc2e81e3
quic-go now vendors all of its dependencies, so we don't need to vendor them here. Created by running: gvt delete github.com/lucas-clemente/quic-go gvt delete github.com/bifurcation/mint gvt delete github.com/lucas-clemente/aes12 gvt delete github.com/lucas-clemente/fnv128a gvt delete github.com/lucas-clemente/quic-go-certificates gvt delete github.com/aead/chacha20 gvt delete github.com/hashicorp/golang-lru gvt fetch -tag v0.10.0-no-integrationtests github.com/lucas-clemente/quic-go
26 lines
501 B
Go
26 lines
501 B
Go
package protocol
|
|
|
|
// Perspective determines if we're acting as a server or a client
|
|
type Perspective int
|
|
|
|
// the perspectives
|
|
const (
|
|
PerspectiveServer Perspective = 1
|
|
PerspectiveClient Perspective = 2
|
|
)
|
|
|
|
// Opposite returns the perspective of the peer
|
|
func (p Perspective) Opposite() Perspective {
|
|
return 3 - p
|
|
}
|
|
|
|
func (p Perspective) String() string {
|
|
switch p {
|
|
case PerspectiveServer:
|
|
return "Server"
|
|
case PerspectiveClient:
|
|
return "Client"
|
|
default:
|
|
return "invalid perspective"
|
|
}
|
|
}
|