feature.go 782 B

12345678910111213141516171819202122
  1. package features
  2. import (
  3. "context"
  4. "github.com/xtls/xray-core/common"
  5. "github.com/xtls/xray-core/common/errors"
  6. )
  7. //go:generate go run github.com/xtls/xray-core/common/errors/errorgen
  8. // Feature is the interface for Xray features. All features must implement this interface.
  9. // All existing features have an implementation in app directory. These features can be replaced by third-party ones.
  10. type Feature interface {
  11. common.HasType
  12. common.Runnable
  13. }
  14. // PrintDeprecatedFeatureWarning prints a warning for deprecated feature.
  15. func PrintDeprecatedFeatureWarning(feature string) {
  16. errors.LogInfo(context.Background(), "You are using a deprecated feature: " + feature + ". Please update your config file with latest configuration format, or update your client software.")
  17. }