add protocol option for node
This commit is contained in:
@ -15,6 +15,7 @@ type NodeOptions struct {
|
||||
HostMapper hosts.HostMapper
|
||||
Metadata metadata.Metadata
|
||||
Host string
|
||||
Protocol string
|
||||
}
|
||||
|
||||
type NodeOption func(*NodeOptions)
|
||||
@ -49,6 +50,12 @@ func HostNodeOption(host string) NodeOption {
|
||||
}
|
||||
}
|
||||
|
||||
func ProtocolNodeOption(protocol string) NodeOption {
|
||||
return func(o *NodeOptions) {
|
||||
o.Protocol = protocol
|
||||
}
|
||||
}
|
||||
|
||||
func MetadataNodeOption(md metadata.Metadata) NodeOption {
|
||||
return func(o *NodeOptions) {
|
||||
o.Metadata = md
|
||||
|
Reference in New Issue
Block a user