From 791a7bb939757c46727880280dadcb25054abc42 Mon Sep 17 00:00:00 2001 From: LaurenceLiZhixin <382673304@qq.com> Date: Sat, 17 Sep 2022 22:40:57 +0800 Subject: [PATCH 1/5] upgrade version to 1.0.1 --- boot.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot.go b/boot.go index a4c330b..42a45d7 100644 --- a/boot.go +++ b/boot.go @@ -24,7 +24,7 @@ import ( _ "github.com/alibaba/ioc-golang/extension/imports/boot" ) -const Version = "1.0.0" +const Version = "1.0.1" func Load(opts ...config.Option) error { printLogo() From cf5d57e40c094251db2e58e3791fe84402a17228 Mon Sep 17 00:00:00 2001 From: LaurenceLiZhixin <382673304@qq.com> Date: Sat, 17 Sep 2022 22:57:42 +0800 Subject: [PATCH 2/5] Fix: remove arm windows because of relised --- .../call/api/ioc_golang/aop/call/call.pb.go | 32 +++++++++---------- iocli/Makefile | 1 - 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/extension/aop/call/api/ioc_golang/aop/call/call.pb.go b/extension/aop/call/api/ioc_golang/aop/call/call.pb.go index 308b617..79b0e4e 100644 --- a/extension/aop/call/api/ioc_golang/aop/call/call.pb.go +++ b/extension/aop/call/api/ioc_golang/aop/call/call.pb.go @@ -28,9 +28,9 @@ type CallRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Sdid string `protobuf:"bytes,1,opt,name=sdid,proto3" json:"sdid,omitempty"` - MethodName string `protobuf:"bytes,2,opt,name=methodName,proto3" json:"methodName,omitempty"` - AutowireType string `protobuf:"bytes,3,opt,name=autowireType,proto3" json:"autowireType,omitempty"` + AutowireType string `protobuf:"bytes,1,opt,name=autowireType,proto3" json:"autowireType,omitempty"` + Sdid string `protobuf:"bytes,2,opt,name=sdid,proto3" json:"sdid,omitempty"` + MethodName string `protobuf:"bytes,3,opt,name=methodName,proto3" json:"methodName,omitempty"` Params []byte `protobuf:"bytes,4,opt,name=params,proto3" json:"params,omitempty"` } @@ -66,23 +66,23 @@ func (*CallRequest) Descriptor() ([]byte, []int) { return file_extension_aop_call_api_ioc_golang_aop_call_call_proto_rawDescGZIP(), []int{0} } -func (x *CallRequest) GetSdid() string { +func (x *CallRequest) GetAutowireType() string { if x != nil { - return x.Sdid + return x.AutowireType } return "" } -func (x *CallRequest) GetMethodName() string { +func (x *CallRequest) GetSdid() string { if x != nil { - return x.MethodName + return x.Sdid } return "" } -func (x *CallRequest) GetAutowireType() string { +func (x *CallRequest) GetMethodName() string { if x != nil { - return x.AutowireType + return x.MethodName } return "" } @@ -173,13 +173,13 @@ var file_extension_aop_call_api_ioc_golang_aop_call_call_proto_rawDesc = []byte{ 0x61, 0x6e, 0x67, 0x2f, 0x61, 0x6f, 0x70, 0x2f, 0x63, 0x61, 0x6c, 0x6c, 0x2f, 0x63, 0x61, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x69, 0x6f, 0x63, 0x5f, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x61, 0x6f, 0x70, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x22, 0x7d, 0x0a, 0x0b, - 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, - 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x64, 0x69, 0x64, 0x12, - 0x1e, 0x0a, 0x0a, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x22, 0x0a, 0x0c, 0x61, 0x75, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x75, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x04, 0x20, + 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x61, + 0x75, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0c, 0x61, 0x75, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x12, 0x0a, 0x04, 0x73, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, + 0x64, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4e, 0x61, 0x6d, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x7e, 0x0a, 0x0c, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x64, 0x69, 0x64, 0x12, diff --git a/iocli/Makefile b/iocli/Makefile index 83b46af..662fb37 100644 --- a/iocli/Makefile +++ b/iocli/Makefile @@ -13,4 +13,3 @@ build-all-platform: mkdir -p ./.release/darwin-amd64 && GOOS=darwin GOARCH=amd64 go build -o ./.release/darwin-amd64 && cd .release && tar -czvf ./iocli-darwin-amd64.tar.gz ./darwin-amd64 mkdir -p ./.release/darwin-arm64 && GOOS=darwin GOARCH=arm64 go build -o ./.release/darwin-arm64 && cd .release && tar -czvf ./iocli-darwin-arm64.tar.gz ./darwin-arm64 mkdir -p ./.release/windows-amd64 && GOOS=windows GOARCH=amd64 go build -o ./.release/windows-amd64 && cd .release && tar -czvf ./iocli-windows-amd64.tar.gz ./windows-amd64 - mkdir -p ./.release/windows-arm64 && GOOS=windows GOARCH=arm64 go build -o ./.release/windows-arm64 && cd .release && tar -czvf ./iocli-windows-arm64.tar.gz ./windows-arm64 From 49f5ece0c3827de3085abb97fa136f24152721ab Mon Sep 17 00:00:00 2001 From: LaurenceLiZhixin <382673304@qq.com> Date: Sat, 17 Sep 2022 23:11:05 +0800 Subject: [PATCH 3/5] Fix: pb not match bug --- .github/workflows/github-actions.yml | 4 +-- .../call/api/ioc_golang/aop/call/call.pb.go | 32 +++++++++---------- .../call/api/ioc_golang/aop/call/call.proto | 6 ++-- extension/config/zz_generated.ioc.go | 6 ++-- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 0ca08a8..f1d316e 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -37,9 +37,9 @@ jobs: run : | cd ./iocli && go build -o /usr/local/bin . - - name: iocli gen + - name: gen all run : | - /usr/local/bin/iocli gen + make gen-all - name: Unit Test run: | make test-all \ No newline at end of file diff --git a/extension/aop/call/api/ioc_golang/aop/call/call.pb.go b/extension/aop/call/api/ioc_golang/aop/call/call.pb.go index 79b0e4e..308b617 100644 --- a/extension/aop/call/api/ioc_golang/aop/call/call.pb.go +++ b/extension/aop/call/api/ioc_golang/aop/call/call.pb.go @@ -28,9 +28,9 @@ type CallRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - AutowireType string `protobuf:"bytes,1,opt,name=autowireType,proto3" json:"autowireType,omitempty"` - Sdid string `protobuf:"bytes,2,opt,name=sdid,proto3" json:"sdid,omitempty"` - MethodName string `protobuf:"bytes,3,opt,name=methodName,proto3" json:"methodName,omitempty"` + Sdid string `protobuf:"bytes,1,opt,name=sdid,proto3" json:"sdid,omitempty"` + MethodName string `protobuf:"bytes,2,opt,name=methodName,proto3" json:"methodName,omitempty"` + AutowireType string `protobuf:"bytes,3,opt,name=autowireType,proto3" json:"autowireType,omitempty"` Params []byte `protobuf:"bytes,4,opt,name=params,proto3" json:"params,omitempty"` } @@ -66,23 +66,23 @@ func (*CallRequest) Descriptor() ([]byte, []int) { return file_extension_aop_call_api_ioc_golang_aop_call_call_proto_rawDescGZIP(), []int{0} } -func (x *CallRequest) GetAutowireType() string { +func (x *CallRequest) GetSdid() string { if x != nil { - return x.AutowireType + return x.Sdid } return "" } -func (x *CallRequest) GetSdid() string { +func (x *CallRequest) GetMethodName() string { if x != nil { - return x.Sdid + return x.MethodName } return "" } -func (x *CallRequest) GetMethodName() string { +func (x *CallRequest) GetAutowireType() string { if x != nil { - return x.MethodName + return x.AutowireType } return "" } @@ -173,13 +173,13 @@ var file_extension_aop_call_api_ioc_golang_aop_call_call_proto_rawDesc = []byte{ 0x61, 0x6e, 0x67, 0x2f, 0x61, 0x6f, 0x70, 0x2f, 0x63, 0x61, 0x6c, 0x6c, 0x2f, 0x63, 0x61, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x69, 0x6f, 0x63, 0x5f, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x61, 0x6f, 0x70, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x22, 0x7d, 0x0a, 0x0b, - 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x61, - 0x75, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0c, 0x61, 0x75, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x12, 0x0a, 0x04, 0x73, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, - 0x64, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4e, 0x61, 0x6d, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4e, - 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x04, 0x20, + 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, + 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x64, 0x69, 0x64, 0x12, + 0x1e, 0x0a, 0x0a, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x22, 0x0a, 0x0c, 0x61, 0x75, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x75, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x7e, 0x0a, 0x0c, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x64, 0x69, 0x64, 0x12, diff --git a/extension/aop/call/api/ioc_golang/aop/call/call.proto b/extension/aop/call/api/ioc_golang/aop/call/call.proto index 1d76f26..06945b9 100644 --- a/extension/aop/call/api/ioc_golang/aop/call/call.proto +++ b/extension/aop/call/api/ioc_golang/aop/call/call.proto @@ -24,9 +24,9 @@ service CallService { } message CallRequest{ - string autowireType = 1; - string sdid = 2; - string methodName = 3; + string sdid = 1; + string methodName = 2; + string autowireType = 3; bytes params = 4; } diff --git a/extension/config/zz_generated.ioc.go b/extension/config/zz_generated.ioc.go index 48933a6..603c99b 100644 --- a/extension/config/zz_generated.ioc.go +++ b/extension/config/zz_generated.ioc.go @@ -158,6 +158,9 @@ func init() { autowireconfig.RegisterStructDescriptor(configStringStructDescriptor) } +type configStringInterface interface { + new(impl *ConfigString) (*ConfigString, error) +} type configFloat64Interface interface { new(impl *ConfigFloat64) (*ConfigFloat64, error) } @@ -173,9 +176,6 @@ type configMapInterface interface { type configSliceInterface interface { new(impl *ConfigSlice) (*ConfigSlice, error) } -type configStringInterface interface { - new(impl *ConfigString) (*ConfigString, error) -} type configFloat64_ struct { Value_ func() float64 new_ func(impl *ConfigFloat64) (*ConfigFloat64, error) From 6610483fcade4b6415e1930c55e5f54ddb14a579 Mon Sep 17 00:00:00 2001 From: LaurenceLiZhixin <382673304@qq.com> Date: Sat, 17 Sep 2022 23:16:54 +0800 Subject: [PATCH 4/5] Fix --- example/aop/dynamic_plugin/complex/main_test.go | 7 +++++++ extension/config/zz_generated.ioc.go | 6 +++--- extension/pubsub/rocketmq/zz_generated.ioc.go | 6 +++--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/example/aop/dynamic_plugin/complex/main_test.go b/example/aop/dynamic_plugin/complex/main_test.go index 5dc92fb..537d21a 100644 --- a/example/aop/dynamic_plugin/complex/main_test.go +++ b/example/aop/dynamic_plugin/complex/main_test.go @@ -16,7 +16,9 @@ package main import ( + "log" "os/exec" + "runtime" "strings" "testing" "time" @@ -60,6 +62,11 @@ func (a *App) Init(t *testing.T) { } func TestApp(t *testing.T) { + if runtime.GOARCH != "amd64" { + log.Println("Warning: Goplugin update only stable on amd64 platform. Skip integration test") + return + } + assert.Nil(t, docker_compose.DockerComposeUp("./docker-compose/docker-compose.yaml", 0)) assert.Nil(t, ioc.Load()) app, err := GetAppSingleton() diff --git a/extension/config/zz_generated.ioc.go b/extension/config/zz_generated.ioc.go index 603c99b..48933a6 100644 --- a/extension/config/zz_generated.ioc.go +++ b/extension/config/zz_generated.ioc.go @@ -158,9 +158,6 @@ func init() { autowireconfig.RegisterStructDescriptor(configStringStructDescriptor) } -type configStringInterface interface { - new(impl *ConfigString) (*ConfigString, error) -} type configFloat64Interface interface { new(impl *ConfigFloat64) (*ConfigFloat64, error) } @@ -176,6 +173,9 @@ type configMapInterface interface { type configSliceInterface interface { new(impl *ConfigSlice) (*ConfigSlice, error) } +type configStringInterface interface { + new(impl *ConfigString) (*ConfigString, error) +} type configFloat64_ struct { Value_ func() float64 new_ func(impl *ConfigFloat64) (*ConfigFloat64, error) diff --git a/extension/pubsub/rocketmq/zz_generated.ioc.go b/extension/pubsub/rocketmq/zz_generated.ioc.go index 611d319..db7c59d 100644 --- a/extension/pubsub/rocketmq/zz_generated.ioc.go +++ b/extension/pubsub/rocketmq/zz_generated.ioc.go @@ -96,15 +96,15 @@ func init() { singleton.RegisterStructDescriptor(adminStructDescriptor) } -type pushConsumerParamInterface interface { - New(impl *PushConsumer) (*PushConsumer, error) -} type producerParamInterface interface { New(impl *Producer) (*Producer, error) } type adminParamInterface interface { New(impl *Admin) (*Admin, error) } +type pushConsumerParamInterface interface { + New(impl *PushConsumer) (*PushConsumer, error) +} type pushConsumer_ struct { Start_ func() error Shutdown_ func() error From 54d1a0980bdbc1ede3846363b8df9f8a433076a2 Mon Sep 17 00:00:00 2001 From: LaurenceLiZhixin <382673304@qq.com> Date: Sat, 17 Sep 2022 23:27:28 +0800 Subject: [PATCH 5/5] Fix --- .github/workflows/github-actions.yml | 4 ++-- extension/config/zz_generated.ioc.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index f1d316e..0ca08a8 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -37,9 +37,9 @@ jobs: run : | cd ./iocli && go build -o /usr/local/bin . - - name: gen all + - name: iocli gen run : | - make gen-all + /usr/local/bin/iocli gen - name: Unit Test run: | make test-all \ No newline at end of file diff --git a/extension/config/zz_generated.ioc.go b/extension/config/zz_generated.ioc.go index 48933a6..603c99b 100644 --- a/extension/config/zz_generated.ioc.go +++ b/extension/config/zz_generated.ioc.go @@ -158,6 +158,9 @@ func init() { autowireconfig.RegisterStructDescriptor(configStringStructDescriptor) } +type configStringInterface interface { + new(impl *ConfigString) (*ConfigString, error) +} type configFloat64Interface interface { new(impl *ConfigFloat64) (*ConfigFloat64, error) } @@ -173,9 +176,6 @@ type configMapInterface interface { type configSliceInterface interface { new(impl *ConfigSlice) (*ConfigSlice, error) } -type configStringInterface interface { - new(impl *ConfigString) (*ConfigString, error) -} type configFloat64_ struct { Value_ func() float64 new_ func(impl *ConfigFloat64) (*ConfigFloat64, error)