mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-06-05 21:03:24 +08:00
Some checks failed
Build docker image / build-image (push) Has been cancelled
Build and Release / prepare (push) Has been cancelled
Test / test (macos-latest) (push) Has been cancelled
Test / test (ubuntu-latest) (push) Has been cancelled
Test / test (windows-latest) (push) Has been cancelled
Build and Release / build (386, freebsd, , ) (push) Has been cancelled
Build and Release / build (386, linux, , ) (push) Has been cancelled
Build and Release / build (386, openbsd, , ) (push) Has been cancelled
Build and Release / build (386, windows, , ) (push) Has been cancelled
Build and Release / build (386, windows, 1.21.4, win7-32) (push) Has been cancelled
Build and Release / build (amd64, darwin, , ) (push) Has been cancelled
Build and Release / build (amd64, freebsd, , ) (push) Has been cancelled
Build and Release / build (amd64, linux, , ) (push) Has been cancelled
Build and Release / build (amd64, openbsd, , ) (push) Has been cancelled
Build and Release / build (amd64, windows, , ) (push) Has been cancelled
Build and Release / build (amd64, windows, 1.21.4, win7-64) (push) Has been cancelled
Build and Release / build (arm, 5, linux) (push) Has been cancelled
Build and Release / build (arm, 6, linux) (push) Has been cancelled
Build and Release / build (arm, 7, freebsd) (push) Has been cancelled
Build and Release / build (arm, 7, linux) (push) Has been cancelled
Build and Release / build (arm, 7, openbsd) (push) Has been cancelled
Build and Release / build (arm, 7, windows) (push) Has been cancelled
Build and Release / build (arm64, android) (push) Has been cancelled
Build and Release / build (arm64, darwin) (push) Has been cancelled
Build and Release / build (arm64, freebsd) (push) Has been cancelled
Build and Release / build (arm64, linux) (push) Has been cancelled
Build and Release / build (arm64, openbsd) (push) Has been cancelled
Build and Release / build (arm64, windows) (push) Has been cancelled
Build and Release / build (loong64, linux) (push) Has been cancelled
Build and Release / build (mips, linux) (push) Has been cancelled
Build and Release / build (mips64, linux) (push) Has been cancelled
Build and Release / build (mips64le, linux) (push) Has been cancelled
Build and Release / build (mipsle, linux) (push) Has been cancelled
Build and Release / build (ppc64, linux) (push) Has been cancelled
Build and Release / build (ppc64le, linux) (push) Has been cancelled
Build and Release / build (riscv64, linux) (push) Has been cancelled
Build and Release / build (s390x, linux) (push) Has been cancelled
35 lines
2.0 KiB
Go
35 lines
2.0 KiB
Go
package errors
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
// PrintMigrateFeatureInfo prints a notice of the upcoming feature migration.
|
|
// Place it after the source feature related config file pharser code.
|
|
// Important note: Only use this when the target migrating feature is under construction.
|
|
// Important note: Even when the target migrating feature has finished its construction, this notice can still be used yet before announcing deprecation of the old feature.
|
|
// Do not remove this function even there is no reference to it.
|
|
func PrintMigrateFeatureInfo(sourceFeature string, targetFeature string) {
|
|
LogInfo(context.Background(), "The feature "+sourceFeature+" will be migrated to "+targetFeature+" in the future.")
|
|
}
|
|
|
|
// PrintDeprecatedFeatureWarning prints a warning for deprecated and going to be removed feature.
|
|
// Do not remove this function even there is no reference to it.
|
|
func PrintDeprecatedFeatureWarning(feature string, migrateFeature string) {
|
|
if len(migrateFeature) > 0 {
|
|
LogWarning(context.Background(), "This feature "+feature+" is deprecated and being migrated to "+migrateFeature+". Please update your config(s) according to release note and documentation before removal.")
|
|
} else {
|
|
LogWarning(context.Background(), "This feature "+feature+" is deprecated. Please update your config(s) according to release note and documentation before removal.")
|
|
}
|
|
}
|
|
|
|
// PrintRemovedFeatureError prints an error message for removed feature then return an error. And after long enough time the message can also be removed, uses as an indicator.
|
|
// Do not remove this function even there is no reference to it.
|
|
func PrintRemovedFeatureError(feature string, migrateFeature string) error {
|
|
if len(migrateFeature) > 0 {
|
|
return New("The feature " + feature + " has been removed and migrated to " + migrateFeature + ". Please update your config(s) according to release note and documentation.")
|
|
} else {
|
|
return New("The feature " + feature + " has been removed. Please update your config(s) according to release note and documentation.")
|
|
}
|
|
}
|