chore: rename client to resolver

This commit is contained in:
xvzc 2024-08-19 11:00:26 +09:00
parent 8515b9a23f
commit a244aa6f1b
6 changed files with 9 additions and 9 deletions

View File

@ -26,16 +26,16 @@ type Dns struct {
dohClient Resolver
}
func NewResolver(config *util.Config) *Dns {
func NewDns(config *util.Config) *Dns {
addr := *config.DnsAddr
port := strconv.Itoa(*config.DnsPort)
return &Dns{
host: *config.DnsAddr,
port: port,
systemClient: client.NewSystemResolver(),
generalClient: client.NewGeneralResolver(net.JoinHostPort(addr, port)),
dohClient: client.NewDOHResolver(addr),
systemClient: resolver.NewSystemResolver(),
generalClient: resolver.NewGeneralResolver(net.JoinHostPort(addr, port)),
dohClient: resolver.NewDOHResolver(addr),
}
}

View File

@ -1,4 +1,4 @@
package client
package resolver
import (
"bytes"

View File

@ -1,4 +1,4 @@
package client
package resolver
import (
"context"

View File

@ -1,4 +1,4 @@
package client
package resolver
import (
"context"

View File

@ -1,4 +1,4 @@
package client
package resolver
import (
"context"

View File

@ -31,7 +31,7 @@ func New(config *util.Config) *Proxy {
windowSize: *config.WindowSize,
enableDoh: *config.EnableDoh,
allowedPattern: config.AllowedPatterns,
resolver: dns.NewResolver(config),
resolver: dns.NewDns(config),
}
}