зеркало из
https://github.com/XTLS/Xray-core.git
синхронизирован 2025-07-01 23:54:16 +00:00
Errors: Add PrintRemovedFeatureError & PrintDeprecatedFeatureWarning (#3804)
Этот коммит содержится в:
родитель
3fed0c773f
коммит
5f0642a671
8 изменённых файлов: 32 добавлений и 25 удалений
|
@ -1,27 +1,12 @@
|
|||
package features
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/xtls/xray-core/common"
|
||||
"github.com/xtls/xray-core/common/errors"
|
||||
)
|
||||
|
||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
||||
|
||||
// Feature is the interface for Xray 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 {
|
||||
common.HasType
|
||||
common.Runnable
|
||||
}
|
||||
|
||||
// PrintDeprecatedFeatureWarning prints a warning for deprecated feature.
|
||||
func PrintDeprecatedFeatureWarning(feature string) {
|
||||
errors.LogWarning(context.Background(), "You are using a deprecated feature: " + feature + ". Please update your config file(s) with latest configuration format, or update your client software.")
|
||||
}
|
||||
|
||||
// PrintRemovedFeatureError prints an error message for removed feature. And after long enough time the message can also be removed, use as an indicator.
|
||||
func PrintRemovedFeatureError(feature string) {
|
||||
errors.New("The feature " + feature + " is removed. Please update your config file(s) according to release notes and documentations.")
|
||||
}
|
||||
|
|
Загрузка…
Создание таблицы
Добавить ссылку
Сослаться в новой задаче