add vhost for node

This commit is contained in:
ginuerzh
2022-11-11 22:21:29 +08:00
parent eb9d483127
commit c2a1dd2a89
3 changed files with 15 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import "context"
type SelectOptions struct {
Addr string
Host string
}
type SelectOption func(*SelectOptions)
@ -14,6 +15,12 @@ func AddrSelectOption(addr string) SelectOption {
}
}
func HostSelectOption(host string) SelectOption {
return func(o *SelectOptions) {
o.Host = host
}
}
type Hop interface {
Nodes() []*Node
Select(ctx context.Context, opts ...SelectOption) *Node