Remove legacy code (#3838)

* Add feature migration notice

* Remove legacy code of transport processing

* Clear legacy proto field

* Fix missing

* Unify protocolname

* Test remove

* Supressor

* Weird code

* Remove errorgen related comments
This commit is contained in:
Kobe Arthur Scofield 2024-09-23 23:28:19 +08:00 committed by GitHub
parent d497de916f
commit 7086d286be
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
83 changed files with 206 additions and 512 deletions

View file

@ -1,4 +1,2 @@
// Package buf provides a light-weight memory allocation mechanism.
package buf // import "github.com/xtls/xray-core/common/buf"
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

View file

@ -12,8 +12,6 @@ import (
"github.com/xtls/xray-core/common/errors"
)
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
// ErrNoClue is for the situation that existing information is not enough to make a decision. For example, Router may return this error when there is no suitable route.
var ErrNoClue = errors.New("not enough information for making a decision")

View file

@ -1,4 +1,2 @@
// Package crypto provides common crypto libraries for Xray.
package crypto // import "github.com/xtls/xray-core/common/crypto"
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

View file

@ -2,8 +2,6 @@ package drain
import "io"
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
type Drainer interface {
AcknowledgeReceive(size int)
Drain(reader io.Reader) error

View file

@ -4,6 +4,15 @@ 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) {

View file

@ -1,3 +1 @@
package mux
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

View file

@ -1,4 +1,2 @@
// Package net is a drop-in replacement to Golang's net package, with some more functionalities.
package net // import "github.com/xtls/xray-core/common/net"
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

View file

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.34.2
// protoc v5.27.0
// protoc v5.28.0
// source: common/net/network.proto
package net
@ -24,25 +24,21 @@ type Network int32
const (
Network_Unknown Network = 0
// Deprecated: Marked as deprecated in common/net/network.proto.
Network_RawTCP Network = 1
Network_TCP Network = 2
Network_UDP Network = 3
Network_UNIX Network = 4
Network_TCP Network = 2
Network_UDP Network = 3
Network_UNIX Network = 4
)
// Enum value maps for Network.
var (
Network_name = map[int32]string{
0: "Unknown",
1: "RawTCP",
2: "TCP",
3: "UDP",
4: "UNIX",
}
Network_value = map[string]int32{
"Unknown": 0,
"RawTCP": 1,
"TCP": 2,
"UDP": 3,
"UNIX": 4,
@ -133,10 +129,9 @@ var file_common_net_network_proto_rawDesc = []byte{
0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x07, 0x6e, 0x65,
0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x78, 0x72,
0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x4e, 0x65,
0x74, 0x77, 0x6f, 0x72, 0x6b, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2a, 0x42,
0x74, 0x77, 0x6f, 0x72, 0x6b, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2a, 0x32,
0x0a, 0x07, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x6e, 0x6b,
0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x06, 0x52, 0x61, 0x77, 0x54, 0x43, 0x50,
0x10, 0x01, 0x1a, 0x02, 0x08, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x43, 0x50, 0x10, 0x02, 0x12,
0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x43, 0x50, 0x10, 0x02, 0x12,
0x07, 0x0a, 0x03, 0x55, 0x44, 0x50, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, 0x55, 0x4e, 0x49, 0x58,
0x10, 0x04, 0x42, 0x4f, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63,
0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x24, 0x67, 0x69, 0x74,

View file

@ -9,7 +9,6 @@ option java_multiple_files = true;
enum Network {
Unknown = 0;
RawTCP = 1 [deprecated = true];
TCP = 2;
UDP = 3;
UNIX = 4;

View file

@ -12,8 +12,6 @@ import (
"github.com/xtls/xray-core/common/platform"
)
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
func Run(args []string, input io.Reader) (buf.MultiBuffer, error) {
xctl := platform.GetToolLocation("xctl")
if _, err := os.Stat(xctl); err != nil {

View file

@ -1,3 +1 @@
package protocol // import "github.com/xtls/xray-core/common/protocol"
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

View file

@ -16,8 +16,6 @@ import (
"github.com/xtls/xray-core/common/errors"
)
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
type Certificate struct {
// certificate in ASN.1 DER format
Certificate []byte

View file

@ -1,7 +1,5 @@
package retry // import "github.com/xtls/xray-core/common/retry"
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
import (
"time"