add more node options
This commit is contained in:
@ -17,6 +17,11 @@ type HTTPNodeSettings struct {
|
|||||||
type TLSNodeSettings struct {
|
type TLSNodeSettings struct {
|
||||||
ServerName string
|
ServerName string
|
||||||
Secure bool
|
Secure bool
|
||||||
|
Options struct {
|
||||||
|
MinVersion string
|
||||||
|
MaxVersion string
|
||||||
|
CipherSuites []string
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type NodeOptions struct {
|
type NodeOptions struct {
|
||||||
@ -28,6 +33,7 @@ type NodeOptions struct {
|
|||||||
Host string
|
Host string
|
||||||
Network string
|
Network string
|
||||||
Protocol string
|
Protocol string
|
||||||
|
Path string
|
||||||
HTTP *HTTPNodeSettings
|
HTTP *HTTPNodeSettings
|
||||||
TLS *TLSNodeSettings
|
TLS *TLSNodeSettings
|
||||||
Auther auth.Authenticator
|
Auther auth.Authenticator
|
||||||
@ -77,6 +83,12 @@ func ProtocolNodeOption(protocol string) NodeOption {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func PathNodeOption(path string) NodeOption {
|
||||||
|
return func(o *NodeOptions) {
|
||||||
|
o.Path = path
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func MetadataNodeOption(md metadata.Metadata) NodeOption {
|
func MetadataNodeOption(md metadata.Metadata) NodeOption {
|
||||||
return func(o *NodeOptions) {
|
return func(o *NodeOptions) {
|
||||||
o.Metadata = md
|
o.Metadata = md
|
||||||
|
13
hop/hop.go
13
hop/hop.go
@ -9,8 +9,9 @@ import (
|
|||||||
type SelectOptions struct {
|
type SelectOptions struct {
|
||||||
Network string
|
Network string
|
||||||
Addr string
|
Addr string
|
||||||
Host string
|
|
||||||
Protocol string
|
Protocol string
|
||||||
|
Host string
|
||||||
|
Path string
|
||||||
}
|
}
|
||||||
|
|
||||||
type SelectOption func(*SelectOptions)
|
type SelectOption func(*SelectOptions)
|
||||||
@ -27,15 +28,21 @@ func AddrSelectOption(addr string) SelectOption {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ProtocolSelectOption(protocol string) SelectOption {
|
||||||
|
return func(o *SelectOptions) {
|
||||||
|
o.Protocol = protocol
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func HostSelectOption(host string) SelectOption {
|
func HostSelectOption(host string) SelectOption {
|
||||||
return func(o *SelectOptions) {
|
return func(o *SelectOptions) {
|
||||||
o.Host = host
|
o.Host = host
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func ProtocolSelectOption(protocol string) SelectOption {
|
func PathSelectOption(path string) SelectOption {
|
||||||
return func(o *SelectOptions) {
|
return func(o *SelectOptions) {
|
||||||
o.Protocol = protocol
|
o.Path = path
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user