add options for components

This commit is contained in:
ginuerzh committed 2023-10-26 22:20:46 +08:00
1 parent 6431cd8bb9
commit 9e767d6745
6 files changed
+37 -11

No files matched your search

+5 -1
View File
@@ -5,7 +5,11 @@ import (
"net"
)
type Options struct{}
type Option func(opts *Options)
// HostMapper is a mapping from hostname to IP.
type HostMapper interface {
Lookup(ctx context.Context, network, host string) ([]net.IP, bool)
Lookup(ctx context.Context, network, host string, opts ...Option) ([]net.IP, bool)
}