add netns option for handler and listener
This commit is contained in:
parent
5aede9a2b3
commit
ca340b1bf1
@ -23,8 +23,9 @@ type Options struct {
|
|||||||
Limiter traffic.TrafficLimiter
|
Limiter traffic.TrafficLimiter
|
||||||
TLSConfig *tls.Config
|
TLSConfig *tls.Config
|
||||||
Logger logger.Logger
|
Logger logger.Logger
|
||||||
Observer observer.Observer
|
Observer observer.Observer
|
||||||
Service string
|
Service string
|
||||||
|
Netns string
|
||||||
}
|
}
|
||||||
|
|
||||||
type Option func(opts *Options)
|
type Option func(opts *Options)
|
||||||
@ -89,6 +90,12 @@ func ServiceOption(service string) Option {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NetnsOption(netns string) Option {
|
||||||
|
return func(opts *Options) {
|
||||||
|
opts.Netns = netns
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
type HandleOptions struct {
|
type HandleOptions struct {
|
||||||
Metadata metadata.Metadata
|
Metadata metadata.Metadata
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,7 @@ type Options struct {
|
|||||||
Logger logger.Logger
|
Logger logger.Logger
|
||||||
Service string
|
Service string
|
||||||
ProxyProtocol int
|
ProxyProtocol int
|
||||||
|
Netns string
|
||||||
}
|
}
|
||||||
|
|
||||||
type Option func(opts *Options)
|
type Option func(opts *Options)
|
||||||
@ -101,3 +102,9 @@ func ProxyProtocolOption(ppv int) Option {
|
|||||||
opts.ProxyProtocol = ppv
|
opts.ProxyProtocol = ppv
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NetnsOption(netns string) Option {
|
||||||
|
return func(opts *Options) {
|
||||||
|
opts.Netns = netns
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user