From 01ed2fa889a48f95eab3669e6c399e15cf084796 Mon Sep 17 00:00:00 2001 From: v2ray Date: Mon, 25 Jan 2016 17:19:09 +0100 Subject: [PATCH] rename RegisterInboundConnectionConfig to RegisterInboundConfig --- proxy/blackhole/config_json.go | 2 +- proxy/dokodemo/config_json.go | 2 +- proxy/freedom/config_json.go | 2 +- proxy/http/config_json.go | 2 +- proxy/internal/config/config_cache.go | 4 ++-- proxy/internal/config/config_cache_test.go | 4 ++-- proxy/socks/config_json.go | 2 +- proxy/vmess/inbound/config_json.go | 2 +- proxy/vmess/outbound/config_json.go | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/proxy/blackhole/config_json.go b/proxy/blackhole/config_json.go index 92d3bc827..45a0a29c4 100644 --- a/proxy/blackhole/config_json.go +++ b/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 }) diff --git a/proxy/dokodemo/config_json.go b/proxy/dokodemo/config_json.go index 4e170db19..eb7f0f5fb 100644 --- a/proxy/dokodemo/config_json.go +++ b/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"` diff --git a/proxy/freedom/config_json.go b/proxy/freedom/config_json.go index c36367afe..461aba499 100644 --- a/proxy/freedom/config_json.go +++ b/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 }) diff --git a/proxy/http/config_json.go b/proxy/http/config_json.go index b8b6301bc..b3d6ac64a 100644 --- a/proxy/http/config_json.go +++ b/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 }) diff --git a/proxy/internal/config/config_cache.go b/proxy/internal/config/config_cache.go index da003d9c2..0754b63b3 100644 --- a/proxy/internal/config/config_cache.go +++ b/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) } diff --git a/proxy/internal/config/config_cache_test.go b/proxy/internal/config/config_cache_test.go index 0d0354a4a..f6b05918c 100644 --- a/proxy/internal/config/config_cache_test.go +++ b/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) diff --git a/proxy/socks/config_json.go b/proxy/socks/config_json.go index c9c82d9a1..ee513dc46 100644 --- a/proxy/socks/config_json.go +++ b/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"` diff --git a/proxy/vmess/inbound/config_json.go b/proxy/vmess/inbound/config_json.go index dfcc52bb3..a552a730a 100644 --- a/proxy/vmess/inbound/config_json.go +++ b/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) diff --git a/proxy/vmess/outbound/config_json.go b/proxy/vmess/outbound/config_json.go index 83b76634b..fa697e2e3 100644 --- a/proxy/vmess/outbound/config_json.go +++ b/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 {