Improve doc comments
This commit is contained in:
12
dial.go
12
dial.go
@@ -5,23 +5,19 @@ import "context"
|
||||
import "crypto/tls"
|
||||
import "github.com/quic-go/quic-go"
|
||||
|
||||
// TODO: dial should be super simple like it is now, and there should be a
|
||||
// "dialer" which the dial function dial configures automaticaly, but the dialer
|
||||
// should offer much more options when used directlym
|
||||
|
||||
// Dial opens a connection to a server. The network must be one of "udp",
|
||||
// "udp4", "udp6", or "unixgram".
|
||||
// Dial opens a connection to a server. The network must be one of "quic",
|
||||
// "quic4", (IPv4-only) "quic6" (IPv6-only), or "unix".
|
||||
func Dial(ctx context.Context, network, address string) (Conn, error) {
|
||||
return (Dialer { }).Dial(ctx, network, address)
|
||||
}
|
||||
|
||||
// TODO: export when there are options here
|
||||
// Dialer allows for further configuration of the dialing process.
|
||||
type Dialer struct {
|
||||
TLSConfig *tls.Config
|
||||
}
|
||||
|
||||
// Dial opens a connection to a server. The network must be one of "quic",
|
||||
// "quic4", "quic6", or "unix".
|
||||
// "quic4", (IPv4-only) "quic6" (IPv6-only), or "unix".
|
||||
func (diale Dialer) Dial(ctx context.Context, network, address string) (Conn, error) {
|
||||
switch network {
|
||||
case "quic", "quic4", "quic6": return diale.dialQUIC(ctx, network, address)
|
||||
|
||||
Reference in New Issue
Block a user