mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-04-16 18:49:16 -04:00
logger service
This commit is contained in:
12
v2ray.go
12
v2ray.go
@@ -163,6 +163,18 @@ func (s *Instance) RegisterFeature(feature interface{}, instance Feature) error
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetFeature returns a feature that was registered in this Instance. Nil if not found.
|
||||
func (s *Instance) GetFeature(featureType interface{}) Feature {
|
||||
for _, f := range s.features {
|
||||
if hasType, ok := f.(common.HasType); ok {
|
||||
if hasType.Type() == featureType {
|
||||
return f
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DNSClient returns the DNSClient used by this Instance. The returned DNSClient is always functional.
|
||||
func (s *Instance) DNSClient() DNSClient {
|
||||
return &(s.dnsClient)
|
||||
|
||||
Reference in New Issue
Block a user