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 dohClient Resolver
} }
func NewResolver(config *util.Config) *Dns { func NewDns(config *util.Config) *Dns {
addr := *config.DnsAddr addr := *config.DnsAddr
port := strconv.Itoa(*config.DnsPort) port := strconv.Itoa(*config.DnsPort)
return &Dns{ return &Dns{
host: *config.DnsAddr, host: *config.DnsAddr,
port: port, port: port,
systemClient: client.NewSystemResolver(), systemClient: resolver.NewSystemResolver(),
generalClient: client.NewGeneralResolver(net.JoinHostPort(addr, port)), generalClient: resolver.NewGeneralResolver(net.JoinHostPort(addr, port)),
dohClient: client.NewDOHResolver(addr), dohClient: resolver.NewDOHResolver(addr),
} }
} }

View File

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

View File

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

View File

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

View File

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

View File

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