add options for components

This commit is contained in:
ginuerzh
2023-10-26 22:20:10 +08:00
parent 33adbb9027
commit e5fa371586
21 changed files with 42 additions and 42 deletions

View File

@ -91,7 +91,7 @@ func NewResolver(nameservers []NameServer, opts ...Option) (resolver.Resolver, e
}, nil
}
func (r *localResolver) Resolve(ctx context.Context, network, host string) (ips []net.IP, err error) {
func (r *localResolver) Resolve(ctx context.Context, network, host string, opts ...resolver.Option) (ips []net.IP, err error) {
if ip := net.ParseIP(host); ip != nil {
return []net.IP{ip}, nil
}