mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 21:34:02 +03:00
Add test for generate-secret command
This commit is contained in:
@@ -40,4 +40,5 @@ type Network interface {
|
||||
DNSResolve(network, hostname string) (ips []string, err error)
|
||||
MakeHTTPClient(DialFunc) *http.Client
|
||||
IdleTimeout() time.Duration
|
||||
HTTPTimeout() time.Duration
|
||||
}
|
||||
|
||||
@@ -115,10 +115,6 @@ func (n *network) DNSResolve(protocol, address string) ([]string, error) {
|
||||
return ips, nil
|
||||
}
|
||||
|
||||
func (n *network) IdleTimeout() time.Duration {
|
||||
return n.idleTimeout
|
||||
}
|
||||
|
||||
func (n *network) MakeHTTPClient(dialFunc DialFunc) *http.Client {
|
||||
if dialFunc == nil {
|
||||
dialFunc = n.DialContext
|
||||
@@ -127,6 +123,14 @@ func (n *network) MakeHTTPClient(dialFunc DialFunc) *http.Client {
|
||||
return makeHTTPClient(n.userAgent, n.httpTimeout, dialFunc)
|
||||
}
|
||||
|
||||
func (n *network) IdleTimeout() time.Duration {
|
||||
return n.idleTimeout
|
||||
}
|
||||
|
||||
func (n *network) HTTPTimeout() time.Duration {
|
||||
return n.httpTimeout
|
||||
}
|
||||
|
||||
func NewNetwork(dialer Dialer,
|
||||
userAgent, dohHostname string,
|
||||
httpTimeout, idleTimeout time.Duration) (Network, error) {
|
||||
|
||||
Reference in New Issue
Block a user