Add documentation for network

This commit is contained in:
9seconds
2021-04-05 18:46:15 +03:00
parent 0dd890a09d
commit 372c703ad6
6 changed files with 105 additions and 5 deletions
+4
View File
@@ -115,6 +115,10 @@ func (n *network) dnsResolve(protocol, address string) ([]string, error) {
return ips, nil
}
// NewNetwork assembles an mtglib.Network compatible structure
// based on a dialer and given params.
//
// It brings simple DNS cache and DNS-Over-HTTPS when necessary.
func NewNetwork(dialer Dialer,
userAgent, dohHostname string,
httpTimeout time.Duration) (mtglib.Network, error) {