Documentation
¶
Index ¶
- Variables
- func EncodeURLWithMetadata(scheme string, host string, metadata Metadata, keyUsername, keyPassword string) string
- func RegisterAlias(k, v string)
- func RegisterReverseAlias(k, v string)
- func RegisterScheme(scheme string, schemeInfo SchemeInfo)
- type AddressKind
- type Endpoint
- type Metadata
- type Protocol
- type SchemeInfo
- type SchemeKind
- type Wrapper
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidScheme = fmt.Errorf("invalid scheme")
Functions ¶
func EncodeURLWithMetadata ¶
func RegisterAlias ¶
func RegisterAlias(k, v string)
func RegisterReverseAlias ¶
func RegisterReverseAlias(k, v string)
func RegisterScheme ¶
func RegisterScheme(scheme string, schemeInfo SchemeInfo)
Types ¶
type AddressKind ¶
type AddressKind uint8
var ( AddressHost AddressKind = 1 AddressPath AddressKind = 2 AddressOpaque AddressKind = 3 )
type Endpoint ¶
type Endpoint struct { // Network is the name of the network. // stream-like, e.g. tcp, unix, etc. // packet-like, e.g. udp, unixpacket, etc. Network string `json:"network"` // Address is the address of the endpoint. // e.g. "localhost:8080", "/tmp/foo.sock" Address string `json:"address"` }
Endpoint represents a network endpoint.
type Protocol ¶
type Protocol struct { // Wrappers is a list of network wrappers. Wrappers []Wrapper `json:"wrappers,omitempty"` // Endpoint is the endpoint of the protocol. Endpoint Endpoint `json:"endpoint"` }
Protocol represents a network protocol.
func NewProtocol ¶
type SchemeInfo ¶
type SchemeInfo struct { Kind SchemeKind Base SchemeKind AddressKind AddressKind MetaFields []string // Match username/password of url UsernameField string PasswordField string }
type SchemeKind ¶
type SchemeKind string
var ( KindNone SchemeKind = "" KindStream SchemeKind = "stream" KindPacket SchemeKind = "packet" KindProxy SchemeKind = "proxy" )
type Wrapper ¶
type Wrapper struct { // Scheme is the scheme of the wrapper. Scheme string `json:"scheme"` // Metadata is the metadata of the wrapper. Metadata Metadata `json:"metadata,omitempty"` }
Wrapper is a network wrapper. Wrap a packet-like network with a stream-like network. e.g. udp -> quic Wrap a stream-like network with a stream-like network. e.g. tls or compression Wrap a stream-like network with a proxy. e.g. tcp -> socks5
Click to show internal directories.
Click to hide internal directories.