Przeglądaj źródła

rename RegisterInboundConnectionConfig to RegisterInboundConfig

v2ray 9 lat temu
rodzic
commit
01ed2fa889

+ 1 - 1
proxy/blackhole/config_json.go

@@ -7,7 +7,7 @@ import (
 )
 
 func init() {
-	config.RegisterOutboundConnectionConfig("blackhole",
+	config.RegisterOutboundConfig("blackhole",
 		func(data []byte) (interface{}, error) {
 			return new(Config), nil
 		})

+ 1 - 1
proxy/dokodemo/config_json.go

@@ -10,7 +10,7 @@ import (
 )
 
 func init() {
-	config.RegisterInboundConnectionConfig("dokodemo-door",
+	config.RegisterInboundConfig("dokodemo-door",
 		func(data []byte) (interface{}, error) {
 			type DokodemoConfig struct {
 				Host         *v2net.AddressJson `json:"address"`

+ 1 - 1
proxy/freedom/config_json.go

@@ -7,7 +7,7 @@ import (
 )
 
 func init() {
-	config.RegisterOutboundConnectionConfig("freedom",
+	config.RegisterOutboundConfig("freedom",
 		func(data []byte) (interface{}, error) {
 			return new(Config), nil
 		})

+ 1 - 1
proxy/http/config_json.go

@@ -7,7 +7,7 @@ import (
 )
 
 func init() {
-	config.RegisterInboundConnectionConfig("http",
+	config.RegisterInboundConfig("http",
 		func(data []byte) (interface{}, error) {
 			return new(Config), nil
 		})

+ 2 - 2
proxy/internal/config/config_cache.go

@@ -20,11 +20,11 @@ func registerConfigType(protocol string, proxyType string, creator ConfigObjectC
 	return nil
 }
 
-func RegisterInboundConnectionConfig(protocol string, creator ConfigObjectCreator) error {
+func RegisterInboundConfig(protocol string, creator ConfigObjectCreator) error {
 	return registerConfigType(protocol, "inbound", creator)
 }
 
-func RegisterOutboundConnectionConfig(protocol string, creator ConfigObjectCreator) error {
+func RegisterOutboundConfig(protocol string, creator ConfigObjectCreator) error {
 	return registerConfigType(protocol, "outbound", creator)
 }
 

+ 2 - 2
proxy/internal/config/config_cache_test.go

@@ -16,7 +16,7 @@ func TestRegisterInboundConfig(t *testing.T) {
 		return true, nil
 	}
 
-	err := RegisterInboundConnectionConfig(protocol, creator)
+	err := RegisterInboundConfig(protocol, creator)
 	assert.Error(err).IsNil()
 
 	configObj, err := CreateInboundConnectionConfig(protocol, nil)
@@ -36,7 +36,7 @@ func TestRegisterOutboundConfig(t *testing.T) {
 		return true, nil
 	}
 
-	err := RegisterOutboundConnectionConfig(protocol, creator)
+	err := RegisterOutboundConfig(protocol, creator)
 	assert.Error(err).IsNil()
 
 	configObj, err := CreateOutboundConnectionConfig(protocol, nil)

+ 1 - 1
proxy/socks/config_json.go

@@ -17,7 +17,7 @@ const (
 )
 
 func init() {
-	config.RegisterInboundConnectionConfig("socks",
+	config.RegisterInboundConfig("socks",
 		func(data []byte) (interface{}, error) {
 			type SocksAccount struct {
 				Username string `json:"user"`

+ 1 - 1
proxy/vmess/inbound/config_json.go

@@ -48,7 +48,7 @@ func (this *Config) UnmarshalJSON(data []byte) error {
 }
 
 func init() {
-	config.RegisterInboundConnectionConfig("vmess",
+	config.RegisterInboundConfig("vmess",
 		func(data []byte) (interface{}, error) {
 			config := new(Config)
 			err := json.Unmarshal(data, config)

+ 1 - 1
proxy/vmess/outbound/config_json.go

@@ -28,7 +28,7 @@ func (this *Config) UnmarshalJSON(data []byte) error {
 }
 
 func init() {
-	proxyconfig.RegisterOutboundConnectionConfig("vmess",
+	proxyconfig.RegisterOutboundConfig("vmess",
 		func(data []byte) (interface{}, error) {
 			rawConfig := new(Config)
 			if err := json.Unmarshal(data, rawConfig); err != nil {