1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 01:57:12 -05:00

details about GetFeature

This commit is contained in:
Darien Raymond 2018-02-14 21:59:58 +01:00
parent c48fa50ab1
commit 42e9af63aa
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -164,6 +164,7 @@ func (s *Instance) RegisterFeature(feature interface{}, instance Feature) error
} }
// GetFeature returns a feature that was registered in this Instance. Nil if not found. // GetFeature returns a feature that was registered in this Instance. Nil if not found.
// The returned Feature must implement common.HasType and whose type equals the given feature type.
func (s *Instance) GetFeature(featureType interface{}) Feature { func (s *Instance) GetFeature(featureType interface{}) Feature {
for _, f := range s.features { for _, f := range s.features {
if hasType, ok := f.(common.HasType); ok { if hasType, ok := f.(common.HasType); ok {