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

@ -14,6 +14,7 @@ type NodeOptions struct {
Resolver resolver.Resolver
HostMapper hosts.HostMapper
Metadata metadata.Metadata
Host string
}
type NodeOption func(*NodeOptions)
@ -42,6 +43,12 @@ func HostMapperNodeOption(m hosts.HostMapper) NodeOption {
}
}
func HostNodeOption(host string) NodeOption {
return func(o *NodeOptions) {
o.Host = host
}
}
func MetadataNodeOption(md metadata.Metadata) NodeOption {
return func(o *NodeOptions) {
o.Metadata = md