add context for modules

This commit is contained in:
ginuerzh
2023-04-18 20:46:44 +08:00
parent f3482d7cd8
commit a2115a3d38
8 changed files with 24 additions and 15 deletions

View File

@ -1,10 +1,11 @@
package hosts
import (
"context"
"net"
)
// HostMapper is a mapping from hostname to IP.
type HostMapper interface {
Lookup(network, host string) ([]net.IP, bool)
Lookup(ctx context.Context, network, host string) ([]net.IP, bool)
}