mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-04-29 09:09:07 -04:00
more docs
This commit is contained in:
@@ -1,18 +1,21 @@
|
||||
package net
|
||||
|
||||
// Destination represents a network destination including address and protocol (tcp / udp).
|
||||
type Destination interface {
|
||||
Network() string
|
||||
Address() Address
|
||||
String() string
|
||||
Network() string // Protocol of communication (tcp / udp)
|
||||
Address() Address // Address of destination
|
||||
String() string // String representation of the destination
|
||||
|
||||
IsTCP() bool
|
||||
IsUDP() bool
|
||||
IsTCP() bool // True if destination is reachable via TCP
|
||||
IsUDP() bool // True if destination is reachable via UDP
|
||||
}
|
||||
|
||||
// NewTCPDestination creates a TCP destination with given address
|
||||
func NewTCPDestination(address Address) Destination {
|
||||
return TCPDestination{address: address}
|
||||
}
|
||||
|
||||
// NewUDPDestination creates a UDP destination with given address
|
||||
func NewUDPDestination(address Address) Destination {
|
||||
return UDPDestination{address: address}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user