1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-01-05 16:55:27 -05:00

logger service

This commit is contained in:
Darien Raymond
2018-02-14 17:35:09 +01:00
parent 1e0b35f869
commit c48fa50ab1
9 changed files with 313 additions and 17 deletions

View File

@@ -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)