add options for components

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

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)
}