1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-26 01:15:38 +00:00
v2fly/features/feature.go

24 lines
844 B
Go
Raw Normal View History

package features
2021-02-16 20:31:50 +00:00
import "github.com/v2fly/v2ray-core/v4/common"
2021-02-16 20:31:50 +00:00
//go:generate go run github.com/v2fly/v2ray-core/v4/common/errors/errorgen
2018-10-13 13:15:49 +00:00
// Feature is the interface for V2Ray features. All features must implement this interface.
// All existing features have an implementation in app directory. These features can be replaced by third-party ones.
type Feature interface {
2018-10-12 21:57:56 +00:00
common.HasType
common.Runnable
}
2018-10-13 13:15:49 +00:00
// PrintDeprecatedFeatureWarning prints a warning for deprecated feature.
func PrintDeprecatedFeatureWarning(feature string) {
newError("You are using a deprecated feature: " + feature + ". Please update your config file with latest configuration format, or update your client software.").WriteToLog()
}
2021-06-19 08:27:46 +00:00
// TaggedFeatures unstable
2021-06-19 08:27:46 +00:00
type TaggedFeatures interface {
GetFeaturesByTag(tag string) (Feature, error)
common.Runnable
2021-06-19 08:27:46 +00:00
}