You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by ti...@apache.org on 2020/07/13 09:54:28 UTC
[servicecomb-service-center] branch master updated: remove grpc
support (#662)
This is an automated email from the ASF dual-hosted git repository.
tianxiaoliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-service-center.git
The following commit(s) were added to refs/heads/master by this push:
new 4e80b03 remove grpc support (#662)
4e80b03 is described below
commit 4e80b037e0cb63a46ae107973c591d386466ea80
Author: Shawn <xi...@gmail.com>
AuthorDate: Mon Jul 13 17:53:52 2020 +0800
remove grpc support (#662)
---
.github/workflows/golangci-lint.yml | 2 +-
README.md | 3 +-
docs/user-guides/rbac.md | 16 +-
go.mod | 1 +
server/api.go | 37 -
server/broker/README.md | 105 -
server/broker/brokerpb/broker.pb.go | 56 -
server/broker/brokerpb/broker.proto | 177 -
server/broker/service.go | 4 +-
server/broker/service_test.go | 22 +-
server/core/proto/README.md | 5 -
server/core/proto/parser_test.go | 19 +-
server/core/proto/services.pb.go | 4500 ++------------------
server/core/proto/services.proto | 613 ---
server/plugin/auth/buildin/buidlin_test.go | 8 +-
server/plugin/registry/etcd/etcd_test.go | 36 -
server/rest/controller/v4/auth_resource.go | 12 +-
server/rest/controller/v4/auth_resource_test.go | 83 +
server/rest/controller/v4/instance_controller.go | 2 +-
server/rest/govern/controller_v4.go | 2 +-
server/rest/govern/govern.go | 11 -
server/rpc/server.go | 65 -
server/scerror/error.go | 16 +-
server/service/instance.go | 20 +-
server/service/rbac/authr_plugin.go | 13 +-
server/service/rbac/dao/account_dao.go | 11 +-
server/service/rbac/dao/account_dao_test.go | 6 +-
server/service/rbac/password.go | 40 +-
server/service/rbac/rbac.go | 17 +-
server/service/rbac/rbca_test.go | 32 +-
server/service/rule.go | 12 +-
server/service/service.go | 9 -
server/service/service_suite_test.go | 1 -
server/service/util/instance_util_test.go | 22 +-
server/service/validate.go | 2 +-
syncer/plugins/servicecenter/instance.go | 53 -
syncer/plugins/servicecenter/instance_test.go | 72 -
syncer/plugins/servicecenter/schemas.go | 42 -
syncer/plugins/servicecenter/service.go | 76 -
syncer/plugins/servicecenter/service_test.go | 68 -
syncer/plugins/servicecenter/servicecenter.go | 85 -
syncer/plugins/servicecenter/servicecenter_test.go | 57 -
syncer/plugins/servicecenter/transform.go | 289 --
syncer/server/server.go | 1 -
.../rbac/dao/account_dao_test.go => test/test.go | 20 +-
45 files changed, 574 insertions(+), 6169 deletions(-)
diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml
index bce3d29..498862c 100644
--- a/.github/workflows/golangci-lint.yml
+++ b/.github/workflows/golangci-lint.yml
@@ -10,4 +10,4 @@ jobs:
uses: golangci/golangci-lint-action@v1
with:
version: v1.27
- args: --timeout=5m --skip-dirs=pkg/cache,server/plugin/discovery,server/service/event,server/service/util,server/bootstrap,server/notify,server/rest/controller/v3,server/broker/brokerpb,examples,syncer,frontend,scctl,integration,server/core/proto --out-format=colored-line-number --enable golint,gocyclo --skip-files=.*_test.go$
\ No newline at end of file
+ args: --timeout=5m --skip-dirs=test,pkg/cache,server/plugin/discovery,server/service/event,server/service/util,server/bootstrap,server/notify,server/rest/controller/v3,server/broker/brokerpb,examples,syncer,frontend,scctl,integration,server/core/proto --out-format=colored-line-number --enable golint,gocyclo --skip-files=.*_test.go$
\ No newline at end of file
diff --git a/README.md b/README.md
index 545ea5d..8071cf1 100644
--- a/README.md
+++ b/README.md
@@ -10,12 +10,11 @@ It provides out of box support for metrics and tracing. It has a web portal to m
# Components
- server: a http server which provide restful API
- scctl: CLI of server
-- syncer: multiple service centers cluster synchronization tool, designed for large microservice architectures
+- syncer: alpha feature. multiple cluster synchronization tool, designed for large microservice architectures
## Features
- **[`Open API`](/server/core/swagger/v4.yaml)**: API doc(Open API format) management for microservice
- **Metadata**: Metadata management for both microservice and microservice instance
- - **Dependency**: Microservice dependency management
- **Separated**: Separated microservice and microservice instance entity management
- **Domains**: Logical multiple domains management
- **Security**: White and black list configuration for service discovery
diff --git a/docs/user-guides/rbac.md b/docs/user-guides/rbac.md
index bdc782d..567d3ba 100644
--- a/docs/user-guides/rbac.md
+++ b/docs/user-guides/rbac.md
@@ -20,12 +20,14 @@ rbac_rsa_private_key_file = ./private.key # rsa key pairs
auth_plugin = buildin # must set to buildin
```
3.root account
+
before you start server, you need to set env to set your root account password.
```sh
export SC_INIT_ROOT_PASSWORD=rootpwd
```
-at the first time service center cluster init, it will use this env to setup rbac module. you can not revoke password after cluster start
+at the first time service center cluster init, it will use this password to setup rbac module.
+you can revoke password by rest API after cluster started. but you can not use this env to revoke password after cluster started.
the root account name is "root"
@@ -47,21 +49,21 @@ will return a token, token will expired after 30m
### Authentication
in each request you must add token to http header:
```
-Authorization: Bear {token}
+Authorization: Bearer {token}
```
for example:
```shell script
curl -X GET \
'http://127.0.0.1:30100/v4/default/registry/microservices/{service-id}/instances' \
- -H 'Authorization: Bear eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1OTI4OTQ1NTEsInVzZXIiOiJyb290In0.FfLOSvVmHT9qCZSe_6iPf4gNjbXLwCrkXxKHsdJoQ8w'
+ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1OTI4OTQ1NTEsInVzZXIiOiJyb290In0.FfLOSvVmHT9qCZSe_6iPf4gNjbXLwCrkXxKHsdJoQ8w'
```
### Change password
You must supply current password and token to update to new password
```shell script
curl -X PUT \
- http://127.0.0.1:30100/v4/account-password \
- -H 'Authorization: Bear {your_token}' \
+ http://127.0.0.1:30100/v4/reset-password \
+ -H 'Authorization: Bearer {your_token}' \
-d '{
"currentPassword":"rootpwd",
"password":"123"
@@ -73,7 +75,7 @@ curl -X PUT \
curl -X POST \
http://127.0.0.1:30100/v4/account \
-H 'Accept: */*' \
- -H 'Authorization: Bear {your_token}' \
+ -H 'Authorization: Bearer {your_token}' \
-H 'Content-Type: application/json' \
-d '{
"name":"peter",
@@ -85,4 +87,4 @@ curl -X POST \
### Roles
currently, you can not custom and manage any role and role policy. there is only 2 build in roles. rbac feature is in early development stage.
- admin: able to do anything, including manage account, even change other account password
-- service: able to call most of API except account management.
\ No newline at end of file
+- developer: able to call most of API except account management. except account management
\ No newline at end of file
diff --git a/go.mod b/go.mod
index 5e7d911..491a601 100644
--- a/go.mod
+++ b/go.mod
@@ -75,6 +75,7 @@ require (
go.etcd.io/bbolt v1.3.4 // indirect
go.etcd.io/etcd v3.3.22+incompatible
go.uber.org/zap v1.10.0
+ golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586
google.golang.org/grpc v1.19.0
gopkg.in/cheggaaa/pb.v1 v1.0.28 // indirect
gopkg.in/karlseguin/expect.v1 v1.0.1 // indirect
diff --git a/server/api.go b/server/api.go
index aabee30..a98b9ad 100644
--- a/server/api.go
+++ b/server/api.go
@@ -27,7 +27,6 @@ import (
"github.com/apache/servicecomb-service-center/server/core"
"github.com/apache/servicecomb-service-center/server/core/backend"
rs "github.com/apache/servicecomb-service-center/server/rest"
- "github.com/apache/servicecomb-service-center/server/rpc"
"github.com/apache/servicecomb-service-center/server/service"
"net"
"strconv"
@@ -66,7 +65,6 @@ type APIServer struct {
Listeners map[APIType]string
restSrv *rest.Server
- rpcSrv *rpc.Server
isClose bool
forked bool
err chan error
@@ -139,31 +137,6 @@ func (s *APIServer) startRESTServer() (err error) {
return
}
-func (s *APIServer) startRPCServer() (err error) {
- addr, ok := s.Listeners[RPC]
- if !ok {
- return
- }
-
- s.rpcSrv, err = rpc.NewServer(addr)
- if err != nil {
- return
- }
- log.Infof("listen address: %s://%s", RPC, s.rpcSrv.Listener.Addr().String())
-
- s.populateEndpoint(RPC, s.rpcSrv.Listener.Addr().String())
-
- s.goroutine.Do(func(_ context.Context) {
- err := s.rpcSrv.Serve()
- if s.isClose {
- return
- }
- log.Errorf(err, "error to start RPC API server %s", addr)
- s.err <- err
- })
- return
-}
-
func (s *APIServer) Start() {
if !s.isClose {
return
@@ -178,12 +151,6 @@ func (s *APIServer) Start() {
return
}
- err = s.startRPCServer()
- if err != nil {
- s.err <- err
- return
- }
-
s.graceDone()
defer log.Info("api server is ready")
@@ -215,10 +182,6 @@ func (s *APIServer) Stop() {
s.restSrv.Shutdown()
}
- if s.rpcSrv != nil {
- s.rpcSrv.GracefulStop()
- }
-
close(s.err)
s.goroutine.Close(true)
diff --git a/server/broker/README.md b/server/broker/README.md
deleted file mode 100644
index 777ed19..0000000
--- a/server/broker/README.md
+++ /dev/null
@@ -1,105 +0,0 @@
-# Pact Broker Module
-
-Pact broker module enables consumer-driven contract testing in service-center.
-
-## Pact broker services
-
-* Consumer microservices can publish pact.
-
-```
-PUT /pacts/provider/:providerId/consumer/:consumerId/version/:number
-'{
- "provider" : "",
- "consumer" : "",
- ...
-
-}'
-```
-
-* Provider microservices can retrieve pacts published by consumer microservices, verify the pacts, and publish the verification results.
-
- 1. Retrieving the information about the pacts associated with a provider
-
-```
-GET /pacts/provider/:providerId/latest
-
-Response:
-{
- "_links" : {
- "pacts" : [
- {
- "href" : "/pacts/provider/:providerId/consumer/:consumerId/version/:number"
- "name" : "Pact between consumerId and providerId with version number"
- }
- ]
- }
-}
-```
-
- 2. Retrieving the actual pact between a consumer and provider for verification
-
-```
-GET /pacts/provider/:providerId/consumer/:consumerId/version/:number
-Response:
-{
- "pact" : []byte
-}
-```
-
- 3. Publishing the pact verification result to the broker
-
-```
-POST /pacts/provider/:providerId/consumer/:consumerId/pact-version/:number/verification-results
-'{
- "success" : true
- "providerApplicationVersion" : "0.0.1"
-}'
-
-Response:
-{
- "confirmation" : {
- "providerName" : ""
- "providerApplicationVersion" : "0.0.1"
- "success" : true
- "verificationDate" : ""
- }
-}
-```
-
-* Consumer microservices can retrieve the verification results published by the providers.
-
-```
-GET /verification-results/consumer/:consumerId/version/:version/latest
-
-Response:
-{
- "result" : {
- "success" : true
- "providerSummary" : {
- "successful" : [
- ]
- "failed" : [
- ]
- "unknown" : [
- ]
- }
- "_embedded" : {
- "verificationResults" : [
- {
- "providerName" : ""
- "providerApplicationVersion" : ""
- "success" : true
- "verificationDate" : ""
- }
- ]
- }
- }
-}
-```
-
-## protobuf to golang
-
-```bash
-cd brokerpb
-protoc --go_out=plugins=grpc:. -I=$GOPATH/src -I=./ broker.proto
-```
\ No newline at end of file
diff --git a/server/broker/brokerpb/broker.pb.go b/server/broker/brokerpb/broker.pb.go
index f71fd32..310d707 100644
--- a/server/broker/brokerpb/broker.pb.go
+++ b/server/broker/brokerpb/broker.pb.go
@@ -279,13 +279,6 @@ func (m *PublishPactRequest) GetConsumerId() string {
return ""
}
-func (m *PublishPactRequest) GetVersion() string {
- if m != nil {
- return m.Version
- }
- return ""
-}
-
func (m *PublishPactRequest) GetPact() []byte {
if m != nil {
return m.Pact
@@ -302,13 +295,6 @@ func (m *PublishPactResponse) String() string { return proto.CompactT
func (*PublishPactResponse) ProtoMessage() {}
func (*PublishPactResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} }
-func (m *PublishPactResponse) GetResponse() *proto1.Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
type GetAllProviderPactsRequest struct {
ProviderId string `protobuf:"bytes,1,opt,name=providerId" json:"providerId,omitempty"`
BaseUrl *BaseBrokerRequest `protobuf:"bytes,2,opt,name=baseUrl" json:"baseUrl,omitempty"`
@@ -383,13 +369,6 @@ func (m *GetAllProviderPactsResponse) String() string { return proto.
func (*GetAllProviderPactsResponse) ProtoMessage() {}
func (*GetAllProviderPactsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} }
-func (m *GetAllProviderPactsResponse) GetResponse() *proto1.Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
func (m *GetAllProviderPactsResponse) GetXLinks() *Links {
if m != nil {
return m.XLinks
@@ -425,13 +404,6 @@ func (m *GetProviderConsumerVersionPactRequest) GetConsumerId() string {
return ""
}
-func (m *GetProviderConsumerVersionPactRequest) GetVersion() string {
- if m != nil {
- return m.Version
- }
- return ""
-}
-
func (m *GetProviderConsumerVersionPactRequest) GetBaseUrl() *BaseBrokerRequest {
if m != nil {
return m.BaseUrl
@@ -453,13 +425,6 @@ func (*GetProviderConsumerVersionPactResponse) Descriptor() ([]byte, []int) {
return fileDescriptor0, []int{12}
}
-func (m *GetProviderConsumerVersionPactResponse) GetResponse() *proto1.Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
func (m *GetProviderConsumerVersionPactResponse) GetPact() []byte {
if m != nil {
return m.Pact
@@ -709,13 +674,6 @@ func (m *PublishVerificationResponse) String() string { return proto.
func (*PublishVerificationResponse) ProtoMessage() {}
func (*PublishVerificationResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} }
-func (m *PublishVerificationResponse) GetResponse() *proto1.Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
func (m *PublishVerificationResponse) GetConfirmation() *VerificationDetail {
if m != nil {
return m.Confirmation
@@ -757,13 +715,6 @@ func (m *RetrieveVerificationResponse) String() string { return proto
func (*RetrieveVerificationResponse) ProtoMessage() {}
func (*RetrieveVerificationResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21} }
-func (m *RetrieveVerificationResponse) GetResponse() *proto1.Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
func (m *RetrieveVerificationResponse) GetResult() *VerificationResult {
if m != nil {
return m.Result
@@ -846,13 +797,6 @@ func (m *BrokerHomeResponse) String() string { return proto.CompactTe
func (*BrokerHomeResponse) ProtoMessage() {}
func (*BrokerHomeResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{24} }
-func (m *BrokerHomeResponse) GetResponse() *proto1.Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
func (m *BrokerHomeResponse) GetXLinks() map[string]*BrokerAPIInfoEntry {
if m != nil {
return m.XLinks
diff --git a/server/broker/brokerpb/broker.proto b/server/broker/brokerpb/broker.proto
deleted file mode 100644
index a580402..0000000
--- a/server/broker/brokerpb/broker.proto
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed //under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-syntax = "proto3";
-
-package brokerpb;
-
-import "github.com/apache/servicecomb-service-center/server/core/proto/services.proto";
-option go_package = "brokerpb";
-
-/*
-Definitions of objects
-*/
-
-message Participant {
- int32 id = 1;
- string appId = 2;
- string serviceName = 3;
-}
-
-message Version {
- int32 id = 1;
- string number = 2;
- int32 participantId = 3;
- int32 order = 4;
-}
-
-message Pact {
- int32 id = 1;
- int32 consumerParticipantId = 2;
- int32 providerParticipantId = 3;
- bytes sha = 4;
- bytes content = 5;
-}
-
-message PactVersion {
- int32 id = 1;
- int32 versionId = 2;
- int32 pactId = 3;
- int32 providerParticipantId = 4;
-}
-
-message Tag {
- string name = 1;
- int32 versionId = 2;
-}
-
-message PublishPactRequest {
- string providerId = 1;
- string consumerId = 2;
- string version = 3;
- bytes pact = 4;
-}
-
-message PublishPactResponse {
- proto.Response response = 1;
-}
-
-message GetAllProviderPactsRequest {
- string providerId = 1;
- BaseBrokerRequest baseUrl = 2;
-}
-
-message ConsumerInfo {
- string href = 1;
- string name = 2;
-}
-
-message Links {
- repeated ConsumerInfo pacts = 1;
-}
-
-message GetAllProviderPactsResponse {
- proto.Response response = 1;
- Links _links = 2;
-}
-
-message GetProviderConsumerVersionPactRequest {
- string providerId = 1;
- string consumerId = 2;
- string version = 3;
- BaseBrokerRequest baseUrl = 4;
-}
-
-message GetProviderConsumerVersionPactResponse {
- proto.Response response = 1;
- bytes pact = 2;
-}
-
-message Verification {
- int32 id = 1;
- int32 number = 2;
- int32 pactVersionId = 3; // id of the version object
- bool success = 4;
- string providerVersion = 5;
- string buildUrl = 6;
- string verificationDate = 7;
-}
-
-message VerificationSummary {
- repeated string successful = 1;
- repeated string failed = 2;
- repeated string unknown = 3;
-}
-
-message VerificationDetail {
- string providerName = 1;
- string providerApplicationVersion = 2;
- bool success = 3;
- string verificationDate = 4;
-}
-
-message VerificationDetails {
- repeated VerificationDetail verificationResults = 1;
-}
-
-message VerificationResult {
- bool success = 1;
- VerificationSummary providerSummary = 2;
- VerificationDetails _embedded = 3;
-}
-
-message PublishVerificationRequest {
- string providerId = 1;
- string consumerId = 2;
- int32 pactId = 3;
- bool success = 4;
- string providerApplicationVersion = 5;
-}
-
-message PublishVerificationResponse {
- proto.Response response = 1;
- VerificationDetail confirmation = 2;
-}
-
-message RetrieveVerificationRequest {
- string consumerId = 1;
- string consumerVersion = 2;
-}
-
-message RetrieveVerificationResponse {
- proto.Response response = 1;
- VerificationResult result = 2;
-}
-
-message BaseBrokerRequest {
- string hostAddress = 1;
- string scheme = 2;
-}
-
-
-message BrokerAPIInfoEntry {
- string href = 1;
- string name = 2;
- string title = 3;
- bool templated = 4;
-}
-
-message BrokerHomeResponse {
- proto.Response response = 1;
- map<string, BrokerAPIInfoEntry> _links = 2;
- repeated BrokerAPIInfoEntry curies = 3;
-}
diff --git a/server/broker/service.go b/server/broker/service.go
index ed8615f..4006e13 100644
--- a/server/broker/service.go
+++ b/server/broker/service.go
@@ -67,7 +67,7 @@ func (*Service) GetPactsOfProvider(ctx context.Context,
}
PactLogger.Errorf(err, "Get pacts of provider failed: %s\n", message)
return &brokerpb.GetProviderConsumerVersionPactResponse{
- Response: resp.GetResponse(),
+ Response: resp.Response,
}, err
}
@@ -772,7 +772,7 @@ func (*Service) PublishPact(ctx context.Context, in *brokerpb.PublishPactRequest
}
// check that the consumer has that vesion in the url
- if strings.Compare(consumer.GetVersion(), in.Version) != 0 {
+ if strings.Compare(consumer.Version, in.Version) != 0 {
log.Errorf(nil,
"pact publish failed, version (%s) does not exist for consmer", in.Version)
return &brokerpb.PublishPactResponse{
diff --git a/server/broker/service_test.go b/server/broker/service_test.go
index 7e841b7..b8d90a8 100644
--- a/server/broker/service_test.go
+++ b/server/broker/service_test.go
@@ -67,7 +67,7 @@ var _ = Describe("Controller", func() {
Expect(err).To(BeNil())
consumerServiceId = resp.ServiceId
- Expect(resp.GetResponse().Code).To(Equal(pb.Response_SUCCESS))
+ Expect(resp.Response.Code).To(Equal(pb.Response_SUCCESS))
//(2) create provider service
resp, err = core.ServiceAPI.Create(getContext(), &pb.CreateServiceRequest{
@@ -85,7 +85,7 @@ var _ = Describe("Controller", func() {
})
Expect(err).To(BeNil())
providerServiceId = resp.ServiceId
- Expect(resp.GetResponse().Code).To(Equal(pb.Response_SUCCESS))
+ Expect(resp.Response.Code).To(Equal(pb.Response_SUCCESS))
//(3) publish a pact between two services
respPublishPact, err := brokerResource.PublishPact(getContext(),
@@ -97,7 +97,7 @@ var _ = Describe("Controller", func() {
})
Expect(err).To(BeNil())
- Expect(respPublishPact.GetResponse().Code).To(Equal(pb.Response_SUCCESS))
+ Expect(respPublishPact.Response.Code).To(Equal(pb.Response_SUCCESS))
})
It("PublishPact-noProviderServiceId", func() {
@@ -111,7 +111,7 @@ var _ = Describe("Controller", func() {
Pact: []byte("hello"),
})
- Expect(respPublishPact.GetResponse().Code).ToNot(Equal(pb.Response_SUCCESS))
+ Expect(respPublishPact.Response.Code).ToNot(Equal(pb.Response_SUCCESS))
})
It("PublishPact-noConumerServiceId", func() {
@@ -125,7 +125,7 @@ var _ = Describe("Controller", func() {
Pact: []byte("hello"),
})
- Expect(respPublishPact.GetResponse().Code).ToNot(Equal(pb.Response_SUCCESS))
+ Expect(respPublishPact.Response.Code).ToNot(Equal(pb.Response_SUCCESS))
})
It("PublishPact-noConumerVersion", func() {
@@ -139,7 +139,7 @@ var _ = Describe("Controller", func() {
Pact: []byte("hello"),
})
- Expect(respPublishPact.GetResponse().Code).ToNot(Equal(pb.Response_SUCCESS))
+ Expect(respPublishPact.Response.Code).ToNot(Equal(pb.Response_SUCCESS))
})
It("GetBrokerHome", func() {
@@ -166,7 +166,7 @@ var _ = Describe("Controller", func() {
}})
Expect(respGetAllProviderPacts).NotTo(BeNil())
- Expect(respGetAllProviderPacts.GetResponse().Code).To(Equal(pb.Response_SUCCESS))
+ Expect(respGetAllProviderPacts.Response.Code).To(Equal(pb.Response_SUCCESS))
})
It("GetBrokerPactsOfProvider", func() {
@@ -183,7 +183,7 @@ var _ = Describe("Controller", func() {
}})
Expect(respGetAllProviderPacts).NotTo(BeNil())
- Expect(respGetAllProviderPacts.GetResponse().Code).To(Equal(pb.Response_SUCCESS))
+ Expect(respGetAllProviderPacts.Response.Code).To(Equal(pb.Response_SUCCESS))
})
It("PublishVerificationResults", func() {
@@ -200,7 +200,7 @@ var _ = Describe("Controller", func() {
})
Expect(respResults).NotTo(BeNil())
- Expect(respResults.GetResponse().Code).To(Equal(pb.Response_SUCCESS))
+ Expect(respResults.Response.Code).To(Equal(pb.Response_SUCCESS))
})
It("RetrieveVerificationResults", func() {
@@ -213,7 +213,7 @@ var _ = Describe("Controller", func() {
})
Expect(respVerification).NotTo(BeNil())
- Expect(respVerification.GetResponse().Code).To(Equal(pb.Response_SUCCESS))
+ Expect(respVerification.Response.Code).To(Equal(pb.Response_SUCCESS))
})
It("RetrieveProviderPacts", func() {
@@ -229,7 +229,7 @@ var _ = Describe("Controller", func() {
})
Expect(respProviderPact).NotTo(BeNil())
- Expect(respProviderPact.GetResponse().Code).To(Equal(pb.Response_SUCCESS))
+ Expect(respProviderPact.Response.Code).To(Equal(pb.Response_SUCCESS))
})
})
})
diff --git a/server/core/proto/README.md b/server/core/proto/README.md
deleted file mode 100644
index 928649b..0000000
--- a/server/core/proto/README.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# service-center support for grpc
-1. Download 'protoc' compiler, https://github.com/google/protobuf/releases
-1. git clone -b v1.0.0 https://github.com/golang/protobuf $GOPATH/src/github.com/golang/protobuf
-1. Install the go-grpc plugin, go get github.com/golang/protobuf/protoc-gen-go
-1. Compile the service.proto file, protoc --go_out=plugins=grpc:. services.proto
\ No newline at end of file
diff --git a/server/core/proto/parser_test.go b/server/core/proto/parser_test.go
index 43de2e1..116c953 100644
--- a/server/core/proto/parser_test.go
+++ b/server/core/proto/parser_test.go
@@ -17,6 +17,7 @@
package proto
import (
+ "github.com/stretchr/testify/assert"
"testing"
)
@@ -86,17 +87,17 @@ func TestParseValueTypeFunc(t *testing.T) {
if err != nil {
t.Fatalf("ServiceParser.Unmarshal failed, %s", err.Error())
}
- if v, ok := r.(*MicroService); !ok || v.ServiceName != "abc" {
- t.Fatalf("ServiceParser.Unmarshal failed, %s", v)
- }
+ v, ok := r.(*MicroService)
+ assert.True(t, ok)
+ assert.Equal(t, "abc", v.ServiceName)
r, err = InstanceParser.Unmarshal([]byte(`{"hostName": "abc"}`))
if err != nil {
t.Fatalf("InstanceParser.Unmarshal failed, %s", err.Error())
}
- if v, ok := r.(*MicroServiceInstance); !ok || v.HostName != "abc" {
- t.Fatalf("InstanceParser.Unmarshal failed, %s", v)
- }
+ mi, ok := r.(*MicroServiceInstance)
+ assert.True(t, ok)
+ assert.Equal(t, "abc", mi.HostName)
r, err = RuleParser.Unmarshal([]byte(`{"ruleId": "abc"}`))
if err != nil {
@@ -110,7 +111,7 @@ func TestParseValueTypeFunc(t *testing.T) {
if err != nil {
t.Fatalf("DependencyRuleParser.Unmarshal failed, %s", err.Error())
}
- if v, ok := r.(*MicroServiceDependency); !ok || v.Dependency[0].ServiceName != "zhqClient" {
- t.Fatalf("DependencyRuleParser.Unmarshal failed, %s", v)
- }
+ md, ok := r.(*MicroServiceDependency)
+ assert.True(t, ok)
+ assert.Equal(t, "zhqClient", md.Dependency[0].ServiceName)
}
diff --git a/server/core/proto/services.pb.go b/server/core/proto/services.pb.go
index 492d7c8..bacf07e 100644
--- a/server/core/proto/services.pb.go
+++ b/server/core/proto/services.pb.go
@@ -15,396 +15,68 @@
* limitations under the License.
*/
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: services.proto
-
-/*
-Package proto is a generated protocol buffer package.
-
-It is generated from these files:
- services.proto
-
-It has these top-level messages:
- ModifySchemasRequest
- Schema
- ModifySchemasResponse
- HeartbeatSetRequest
- HeartbeatSetElement
- HeartbeatSetResponse
- InstanceHbRst
- StService
- StInstance
- StApp
- Statistics
- GetServicesInfoRequest
- GetServicesInfoResponse
- MicroServiceKey
- MicroService
- FrameWorkProperty
- ServiceRule
- AddOrUpdateServiceRule
- ServicePath
- Response
- GetExistenceRequest
- GetExistenceResponse
- CreateServiceRequest
- CreateServiceResponse
- DeleteServiceRequest
- DeleteServiceResponse
- GetServiceRequest
- GetServiceResponse
- GetServicesRequest
- GetServicesResponse
- UpdateServicePropsRequest
- UpdateServicePropsResponse
- GetServiceRulesRequest
- GetServiceRulesResponse
- UpdateServiceRuleRequest
- UpdateServiceRuleResponse
- AddServiceRulesRequest
- AddServiceRulesResponse
- DeleteServiceRulesRequest
- DeleteServiceRulesResponse
- GetServiceTagsRequest
- GetServiceTagsResponse
- UpdateServiceTagRequest
- UpdateServiceTagResponse
- AddServiceTagsRequest
- AddServiceTagsResponse
- DeleteServiceTagsRequest
- DeleteServiceTagsResponse
- HealthCheck
- MicroServiceInstance
- DataCenterInfo
- MicroServiceInstanceKey
- RegisterInstanceRequest
- RegisterInstanceResponse
- UnregisterInstanceRequest
- UnregisterInstanceResponse
- HeartbeatRequest
- HeartbeatResponse
- FindInstancesRequest
- FindInstancesResponse
- GetOneInstanceRequest
- GetOneInstanceResponse
- GetInstancesRequest
- GetInstancesResponse
- UpdateInstanceStatusRequest
- UpdateInstanceStatusResponse
- UpdateInstancePropsRequest
- UpdateInstancePropsResponse
- WatchInstanceRequest
- WatchInstanceResponse
- GetSchemaRequest
- GetAllSchemaRequest
- GetSchemaResponse
- GetAllSchemaResponse
- DeleteSchemaRequest
- DeleteSchemaResponse
- ModifySchemaRequest
- ModifySchemaResponse
- AddDependenciesRequest
- AddDependenciesResponse
- CreateDependenciesRequest
- ConsumerDependency
- CreateDependenciesResponse
- GetDependenciesRequest
- GetConDependenciesResponse
- GetProDependenciesResponse
- ServiceDetail
- GetServiceDetailResponse
- DelServicesRequest
- DelServicesRspInfo
- DelServicesResponse
- GetAppsRequest
- GetAppsResponse
-*/
package proto
-import proto1 "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-
import (
- context "context"
- grpc "google.golang.org/grpc"
+ "context"
+ "google.golang.org/grpc"
)
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto1.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto1.ProtoPackageIsVersion2 // please upgrade the proto package
-
type ModifySchemasRequest struct {
ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
Schemas []*Schema `protobuf:"bytes,2,rep,name=schemas" json:"schemas,omitempty"`
}
-func (m *ModifySchemasRequest) Reset() { *m = ModifySchemasRequest{} }
-func (m *ModifySchemasRequest) String() string { return proto1.CompactTextString(m) }
-func (*ModifySchemasRequest) ProtoMessage() {}
-func (*ModifySchemasRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
-
-func (m *ModifySchemasRequest) GetServiceId() string {
- if m != nil {
- return m.ServiceId
- }
- return ""
-}
-
-func (m *ModifySchemasRequest) GetSchemas() []*Schema {
- if m != nil {
- return m.Schemas
- }
- return nil
-}
-
type Schema struct {
SchemaId string `protobuf:"bytes,1,opt,name=schemaId" json:"schemaId,omitempty"`
Summary string `protobuf:"bytes,2,opt,name=summary" json:"summary,omitempty"`
Schema string `protobuf:"bytes,3,opt,name=schema" json:"schema,omitempty"`
}
-func (m *Schema) Reset() { *m = Schema{} }
-func (m *Schema) String() string { return proto1.CompactTextString(m) }
-func (*Schema) ProtoMessage() {}
-func (*Schema) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
-
-func (m *Schema) GetSchemaId() string {
- if m != nil {
- return m.SchemaId
- }
- return ""
-}
-
-func (m *Schema) GetSummary() string {
- if m != nil {
- return m.Summary
- }
- return ""
-}
-
-func (m *Schema) GetSchema() string {
- if m != nil {
- return m.Schema
- }
- return ""
-}
-
type ModifySchemasResponse struct {
Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
}
-func (m *ModifySchemasResponse) Reset() { *m = ModifySchemasResponse{} }
-func (m *ModifySchemasResponse) String() string { return proto1.CompactTextString(m) }
-func (*ModifySchemasResponse) ProtoMessage() {}
-func (*ModifySchemasResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
-
-func (m *ModifySchemasResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
type HeartbeatSetRequest struct {
Instances []*HeartbeatSetElement `protobuf:"bytes,1,rep,name=instances" json:"instances,omitempty"`
}
-func (m *HeartbeatSetRequest) Reset() { *m = HeartbeatSetRequest{} }
-func (m *HeartbeatSetRequest) String() string { return proto1.CompactTextString(m) }
-func (*HeartbeatSetRequest) ProtoMessage() {}
-func (*HeartbeatSetRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
-
-func (m *HeartbeatSetRequest) GetInstances() []*HeartbeatSetElement {
- if m != nil {
- return m.Instances
- }
- return nil
-}
-
type HeartbeatSetElement struct {
ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
InstanceId string `protobuf:"bytes,2,opt,name=instanceId" json:"instanceId,omitempty"`
}
-func (m *HeartbeatSetElement) Reset() { *m = HeartbeatSetElement{} }
-func (m *HeartbeatSetElement) String() string { return proto1.CompactTextString(m) }
-func (*HeartbeatSetElement) ProtoMessage() {}
-func (*HeartbeatSetElement) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }
-
-func (m *HeartbeatSetElement) GetServiceId() string {
- if m != nil {
- return m.ServiceId
- }
- return ""
-}
-
-func (m *HeartbeatSetElement) GetInstanceId() string {
- if m != nil {
- return m.InstanceId
- }
- return ""
-}
-
type HeartbeatSetResponse struct {
Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
Instances []*InstanceHbRst `protobuf:"bytes,2,rep,name=instances" json:"instances,omitempty"`
}
-func (m *HeartbeatSetResponse) Reset() { *m = HeartbeatSetResponse{} }
-func (m *HeartbeatSetResponse) String() string { return proto1.CompactTextString(m) }
-func (*HeartbeatSetResponse) ProtoMessage() {}
-func (*HeartbeatSetResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} }
-
-func (m *HeartbeatSetResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-func (m *HeartbeatSetResponse) GetInstances() []*InstanceHbRst {
- if m != nil {
- return m.Instances
- }
- return nil
-}
-
type InstanceHbRst struct {
ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
InstanceId string `protobuf:"bytes,2,opt,name=instanceId" json:"instanceId,omitempty"`
ErrMessage string `protobuf:"bytes,3,opt,name=errMessage" json:"errMessage,omitempty"`
}
-func (m *InstanceHbRst) Reset() { *m = InstanceHbRst{} }
-func (m *InstanceHbRst) String() string { return proto1.CompactTextString(m) }
-func (*InstanceHbRst) ProtoMessage() {}
-func (*InstanceHbRst) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} }
-
-func (m *InstanceHbRst) GetServiceId() string {
- if m != nil {
- return m.ServiceId
- }
- return ""
-}
-
-func (m *InstanceHbRst) GetInstanceId() string {
- if m != nil {
- return m.InstanceId
- }
- return ""
-}
-
-func (m *InstanceHbRst) GetErrMessage() string {
- if m != nil {
- return m.ErrMessage
- }
- return ""
-}
-
type StService struct {
Count int64 `protobuf:"varint,1,opt,name=count" json:"count,omitempty"`
OnlineCount int64 `protobuf:"varint,2,opt,name=onlineCount" json:"onlineCount,omitempty"`
}
-func (m *StService) Reset() { *m = StService{} }
-func (m *StService) String() string { return proto1.CompactTextString(m) }
-func (*StService) ProtoMessage() {}
-func (*StService) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} }
-
-func (m *StService) GetCount() int64 {
- if m != nil {
- return m.Count
- }
- return 0
-}
-
-func (m *StService) GetOnlineCount() int64 {
- if m != nil {
- return m.OnlineCount
- }
- return 0
-}
-
type StInstance struct {
Count int64 `protobuf:"varint,1,opt,name=count" json:"count,omitempty"`
CountByDomain int64 `protobuf:"varint,2,opt,name=countByDomain" json:"countByDomain,omitempty"`
}
-func (m *StInstance) Reset() { *m = StInstance{} }
-func (m *StInstance) String() string { return proto1.CompactTextString(m) }
-func (*StInstance) ProtoMessage() {}
-func (*StInstance) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} }
-
-func (m *StInstance) GetCount() int64 {
- if m != nil {
- return m.Count
- }
- return 0
-}
-
-func (m *StInstance) GetCountByDomain() int64 {
- if m != nil {
- return m.CountByDomain
- }
- return 0
-}
-
type StApp struct {
Count int64 `protobuf:"varint,1,opt,name=count" json:"count,omitempty"`
}
-func (m *StApp) Reset() { *m = StApp{} }
-func (m *StApp) String() string { return proto1.CompactTextString(m) }
-func (*StApp) ProtoMessage() {}
-func (*StApp) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} }
-
-func (m *StApp) GetCount() int64 {
- if m != nil {
- return m.Count
- }
- return 0
-}
-
type Statistics struct {
Services *StService `protobuf:"bytes,1,opt,name=services" json:"services,omitempty"`
Instances *StInstance `protobuf:"bytes,2,opt,name=instances" json:"instances,omitempty"`
Apps *StApp `protobuf:"bytes,3,opt,name=apps" json:"apps,omitempty"`
}
-func (m *Statistics) Reset() { *m = Statistics{} }
-func (m *Statistics) String() string { return proto1.CompactTextString(m) }
-func (*Statistics) ProtoMessage() {}
-func (*Statistics) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} }
-
-func (m *Statistics) GetServices() *StService {
- if m != nil {
- return m.Services
- }
- return nil
-}
-
-func (m *Statistics) GetInstances() *StInstance {
- if m != nil {
- return m.Instances
- }
- return nil
-}
-
-func (m *Statistics) GetApps() *StApp {
- if m != nil {
- return m.Apps
- }
- return nil
-}
-
type GetServicesInfoRequest struct {
Options []string `protobuf:"bytes,1,rep,name=options" json:"options,omitempty"`
AppId string `protobuf:"bytes,2,opt,name=appId" json:"appId,omitempty"`
@@ -413,78 +85,12 @@ type GetServicesInfoRequest struct {
WithShared bool `protobuf:"varint,5,opt,name=withShared" json:"withShared,omitempty"`
}
-func (m *GetServicesInfoRequest) Reset() { *m = GetServicesInfoRequest{} }
-func (m *GetServicesInfoRequest) String() string { return proto1.CompactTextString(m) }
-func (*GetServicesInfoRequest) ProtoMessage() {}
-func (*GetServicesInfoRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} }
-
-func (m *GetServicesInfoRequest) GetOptions() []string {
- if m != nil {
- return m.Options
- }
- return nil
-}
-
-func (m *GetServicesInfoRequest) GetAppId() string {
- if m != nil {
- return m.AppId
- }
- return ""
-}
-
-func (m *GetServicesInfoRequest) GetServiceName() string {
- if m != nil {
- return m.ServiceName
- }
- return ""
-}
-
-func (m *GetServicesInfoRequest) GetCountOnly() bool {
- if m != nil {
- return m.CountOnly
- }
- return false
-}
-
-func (m *GetServicesInfoRequest) GetWithShared() bool {
- if m != nil {
- return m.WithShared
- }
- return false
-}
-
type GetServicesInfoResponse struct {
Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
AllServicesDetail []*ServiceDetail `protobuf:"bytes,2,rep,name=allServicesDetail" json:"allServicesDetail,omitempty"`
Statistics *Statistics `protobuf:"bytes,3,opt,name=statistics" json:"statistics,omitempty"`
}
-func (m *GetServicesInfoResponse) Reset() { *m = GetServicesInfoResponse{} }
-func (m *GetServicesInfoResponse) String() string { return proto1.CompactTextString(m) }
-func (*GetServicesInfoResponse) ProtoMessage() {}
-func (*GetServicesInfoResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} }
-
-func (m *GetServicesInfoResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-func (m *GetServicesInfoResponse) GetAllServicesDetail() []*ServiceDetail {
- if m != nil {
- return m.AllServicesDetail
- }
- return nil
-}
-
-func (m *GetServicesInfoResponse) GetStatistics() *Statistics {
- if m != nil {
- return m.Statistics
- }
- return nil
-}
-
type MicroServiceKey struct {
Tenant string `protobuf:"bytes,1,opt,name=tenant" json:"tenant,omitempty"`
Project string `protobuf:"bytes,2,opt,name=project" json:"project,omitempty"`
@@ -495,60 +101,6 @@ type MicroServiceKey struct {
Alias string `protobuf:"bytes,7,opt,name=alias" json:"alias,omitempty"`
}
-func (m *MicroServiceKey) Reset() { *m = MicroServiceKey{} }
-func (m *MicroServiceKey) String() string { return proto1.CompactTextString(m) }
-func (*MicroServiceKey) ProtoMessage() {}
-func (*MicroServiceKey) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} }
-
-func (m *MicroServiceKey) GetTenant() string {
- if m != nil {
- return m.Tenant
- }
- return ""
-}
-
-func (m *MicroServiceKey) GetProject() string {
- if m != nil {
- return m.Project
- }
- return ""
-}
-
-func (m *MicroServiceKey) GetAppId() string {
- if m != nil {
- return m.AppId
- }
- return ""
-}
-
-func (m *MicroServiceKey) GetServiceName() string {
- if m != nil {
- return m.ServiceName
- }
- return ""
-}
-
-func (m *MicroServiceKey) GetVersion() string {
- if m != nil {
- return m.Version
- }
- return ""
-}
-
-func (m *MicroServiceKey) GetEnvironment() string {
- if m != nil {
- return m.Environment
- }
- return ""
-}
-
-func (m *MicroServiceKey) GetAlias() string {
- if m != nil {
- return m.Alias
- }
- return ""
-}
-
type MicroService struct {
ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
AppId string `protobuf:"bytes,2,opt,name=appId" json:"appId,omitempty"`
@@ -570,3911 +122,495 @@ type MicroService struct {
Framework *FrameWorkProperty `protobuf:"bytes,18,opt,name=framework" json:"framework,omitempty"`
}
-func (m *MicroService) Reset() { *m = MicroService{} }
-func (m *MicroService) String() string { return proto1.CompactTextString(m) }
-func (*MicroService) ProtoMessage() {}
-func (*MicroService) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} }
+type FrameWorkProperty struct {
+ Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
+ Version string `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"`
+}
-func (m *MicroService) GetServiceId() string {
- if m != nil {
- return m.ServiceId
- }
- return ""
+type ServiceRule struct {
+ RuleId string `protobuf:"bytes,1,opt,name=ruleId" json:"ruleId,omitempty"`
+ RuleType string `protobuf:"bytes,2,opt,name=ruleType" json:"ruleType,omitempty"`
+ Attribute string `protobuf:"bytes,3,opt,name=attribute" json:"attribute,omitempty"`
+ Pattern string `protobuf:"bytes,4,opt,name=pattern" json:"pattern,omitempty"`
+ Description string `protobuf:"bytes,5,opt,name=description" json:"description,omitempty"`
+ Timestamp string `protobuf:"bytes,6,opt,name=timestamp" json:"timestamp,omitempty"`
+ ModTimestamp string `protobuf:"bytes,7,opt,name=modTimestamp" json:"modTimestamp,omitempty"`
}
-func (m *MicroService) GetAppId() string {
- if m != nil {
- return m.AppId
- }
- return ""
+type AddOrUpdateServiceRule struct {
+ RuleType string `protobuf:"bytes,1,opt,name=ruleType" json:"ruleType,omitempty"`
+ Attribute string `protobuf:"bytes,2,opt,name=attribute" json:"attribute,omitempty"`
+ Pattern string `protobuf:"bytes,3,opt,name=pattern" json:"pattern,omitempty"`
+ Description string `protobuf:"bytes,4,opt,name=description" json:"description,omitempty"`
}
-func (m *MicroService) GetServiceName() string {
- if m != nil {
- return m.ServiceName
- }
- return ""
+type ServicePath struct {
+ Path string `protobuf:"bytes,1,opt,name=path" json:"path,omitempty"`
+ Property map[string]string `protobuf:"bytes,2,rep,name=property" json:"property,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
}
-func (m *MicroService) GetVersion() string {
- if m != nil {
- return m.Version
- }
- return ""
+type Response struct {
+ Code int32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"`
+ Message string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"`
}
-func (m *MicroService) GetDescription() string {
+func (m *Response) GetCode() int32 {
if m != nil {
- return m.Description
+ return m.Code
}
- return ""
+ return 0
}
-func (m *MicroService) GetLevel() string {
+func (m *Response) GetMessage() string {
if m != nil {
- return m.Level
+ return m.Message
}
return ""
}
-func (m *MicroService) GetSchemas() []string {
- if m != nil {
- return m.Schemas
- }
- return nil
+type GetExistenceRequest struct {
+ Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"`
+ AppId string `protobuf:"bytes,2,opt,name=appId" json:"appId,omitempty"`
+ ServiceName string `protobuf:"bytes,3,opt,name=serviceName" json:"serviceName,omitempty"`
+ Version string `protobuf:"bytes,4,opt,name=version" json:"version,omitempty"`
+ ServiceId string `protobuf:"bytes,5,opt,name=serviceId" json:"serviceId,omitempty"`
+ SchemaId string `protobuf:"bytes,6,opt,name=schemaId" json:"schemaId,omitempty"`
+ Environment string `protobuf:"bytes,7,opt,name=environment" json:"environment,omitempty"`
}
-func (m *MicroService) GetPaths() []*ServicePath {
- if m != nil {
- return m.Paths
- }
- return nil
+type GetExistenceResponse struct {
+ Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
+ ServiceId string `protobuf:"bytes,2,opt,name=serviceId" json:"serviceId,omitempty"`
+ SchemaId string `protobuf:"bytes,3,opt,name=schemaId" json:"schemaId,omitempty"`
+ Summary string `protobuf:"bytes,4,opt,name=summary" json:"summary,omitempty"`
}
-func (m *MicroService) GetStatus() string {
+func (m *GetExistenceResponse) GetSummary() string {
if m != nil {
- return m.Status
+ return m.Summary
}
return ""
}
-func (m *MicroService) GetProperties() map[string]string {
- if m != nil {
- return m.Properties
- }
- return nil
-}
-
-func (m *MicroService) GetTimestamp() string {
- if m != nil {
- return m.Timestamp
- }
- return ""
-}
-
-func (m *MicroService) GetProviders() []*MicroServiceKey {
- if m != nil {
- return m.Providers
- }
- return nil
-}
-
-func (m *MicroService) GetAlias() string {
- if m != nil {
- return m.Alias
- }
- return ""
-}
-
-func (m *MicroService) GetLBStrategy() map[string]string {
- if m != nil {
- return m.LBStrategy
- }
- return nil
-}
-
-func (m *MicroService) GetModTimestamp() string {
- if m != nil {
- return m.ModTimestamp
- }
- return ""
-}
-
-func (m *MicroService) GetEnvironment() string {
- if m != nil {
- return m.Environment
- }
- return ""
-}
-
-func (m *MicroService) GetRegisterBy() string {
- if m != nil {
- return m.RegisterBy
- }
- return ""
-}
-
-func (m *MicroService) GetFramework() *FrameWorkProperty {
- if m != nil {
- return m.Framework
- }
- return nil
-}
-
-type FrameWorkProperty struct {
- Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
- Version string `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"`
-}
-
-func (m *FrameWorkProperty) Reset() { *m = FrameWorkProperty{} }
-func (m *FrameWorkProperty) String() string { return proto1.CompactTextString(m) }
-func (*FrameWorkProperty) ProtoMessage() {}
-func (*FrameWorkProperty) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} }
-
-func (m *FrameWorkProperty) GetName() string {
- if m != nil {
- return m.Name
- }
- return ""
-}
-
-func (m *FrameWorkProperty) GetVersion() string {
- if m != nil {
- return m.Version
- }
- return ""
-}
-
-type ServiceRule struct {
- RuleId string `protobuf:"bytes,1,opt,name=ruleId" json:"ruleId,omitempty"`
- RuleType string `protobuf:"bytes,2,opt,name=ruleType" json:"ruleType,omitempty"`
- Attribute string `protobuf:"bytes,3,opt,name=attribute" json:"attribute,omitempty"`
- Pattern string `protobuf:"bytes,4,opt,name=pattern" json:"pattern,omitempty"`
- Description string `protobuf:"bytes,5,opt,name=description" json:"description,omitempty"`
- Timestamp string `protobuf:"bytes,6,opt,name=timestamp" json:"timestamp,omitempty"`
- ModTimestamp string `protobuf:"bytes,7,opt,name=modTimestamp" json:"modTimestamp,omitempty"`
-}
-
-func (m *ServiceRule) Reset() { *m = ServiceRule{} }
-func (m *ServiceRule) String() string { return proto1.CompactTextString(m) }
-func (*ServiceRule) ProtoMessage() {}
-func (*ServiceRule) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} }
-
-func (m *ServiceRule) GetRuleId() string {
- if m != nil {
- return m.RuleId
- }
- return ""
-}
-
-func (m *ServiceRule) GetRuleType() string {
- if m != nil {
- return m.RuleType
- }
- return ""
-}
-
-func (m *ServiceRule) GetAttribute() string {
- if m != nil {
- return m.Attribute
- }
- return ""
-}
-
-func (m *ServiceRule) GetPattern() string {
- if m != nil {
- return m.Pattern
- }
- return ""
-}
-
-func (m *ServiceRule) GetDescription() string {
- if m != nil {
- return m.Description
- }
- return ""
-}
-
-func (m *ServiceRule) GetTimestamp() string {
- if m != nil {
- return m.Timestamp
- }
- return ""
-}
-
-func (m *ServiceRule) GetModTimestamp() string {
- if m != nil {
- return m.ModTimestamp
- }
- return ""
-}
-
-type AddOrUpdateServiceRule struct {
- RuleType string `protobuf:"bytes,1,opt,name=ruleType" json:"ruleType,omitempty"`
- Attribute string `protobuf:"bytes,2,opt,name=attribute" json:"attribute,omitempty"`
- Pattern string `protobuf:"bytes,3,opt,name=pattern" json:"pattern,omitempty"`
- Description string `protobuf:"bytes,4,opt,name=description" json:"description,omitempty"`
-}
-
-func (m *AddOrUpdateServiceRule) Reset() { *m = AddOrUpdateServiceRule{} }
-func (m *AddOrUpdateServiceRule) String() string { return proto1.CompactTextString(m) }
-func (*AddOrUpdateServiceRule) ProtoMessage() {}
-func (*AddOrUpdateServiceRule) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} }
-
-func (m *AddOrUpdateServiceRule) GetRuleType() string {
- if m != nil {
- return m.RuleType
- }
- return ""
-}
-
-func (m *AddOrUpdateServiceRule) GetAttribute() string {
- if m != nil {
- return m.Attribute
- }
- return ""
-}
-
-func (m *AddOrUpdateServiceRule) GetPattern() string {
- if m != nil {
- return m.Pattern
- }
- return ""
-}
-
-func (m *AddOrUpdateServiceRule) GetDescription() string {
- if m != nil {
- return m.Description
- }
- return ""
-}
-
-type ServicePath struct {
- Path string `protobuf:"bytes,1,opt,name=path" json:"path,omitempty"`
- Property map[string]string `protobuf:"bytes,2,rep,name=property" json:"property,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
-}
-
-func (m *ServicePath) Reset() { *m = ServicePath{} }
-func (m *ServicePath) String() string { return proto1.CompactTextString(m) }
-func (*ServicePath) ProtoMessage() {}
-func (*ServicePath) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} }
-
-func (m *ServicePath) GetPath() string {
- if m != nil {
- return m.Path
- }
- return ""
-}
-
-func (m *ServicePath) GetProperty() map[string]string {
- if m != nil {
- return m.Property
- }
- return nil
-}
-
-type Response struct {
- Code int32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"`
- Message string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"`
-}
-
-func (m *Response) Reset() { *m = Response{} }
-func (m *Response) String() string { return proto1.CompactTextString(m) }
-func (*Response) ProtoMessage() {}
-func (*Response) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} }
-
-func (m *Response) GetCode() int32 {
- if m != nil {
- return m.Code
- }
- return 0
-}
-
-func (m *Response) GetMessage() string {
- if m != nil {
- return m.Message
- }
- return ""
-}
-
-type GetExistenceRequest struct {
- Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"`
- AppId string `protobuf:"bytes,2,opt,name=appId" json:"appId,omitempty"`
- ServiceName string `protobuf:"bytes,3,opt,name=serviceName" json:"serviceName,omitempty"`
- Version string `protobuf:"bytes,4,opt,name=version" json:"version,omitempty"`
- ServiceId string `protobuf:"bytes,5,opt,name=serviceId" json:"serviceId,omitempty"`
- SchemaId string `protobuf:"bytes,6,opt,name=schemaId" json:"schemaId,omitempty"`
- Environment string `protobuf:"bytes,7,opt,name=environment" json:"environment,omitempty"`
-}
-
-func (m *GetExistenceRequest) Reset() { *m = GetExistenceRequest{} }
-func (m *GetExistenceRequest) String() string { return proto1.CompactTextString(m) }
-func (*GetExistenceRequest) ProtoMessage() {}
-func (*GetExistenceRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20} }
-
-func (m *GetExistenceRequest) GetType() string {
- if m != nil {
- return m.Type
- }
- return ""
-}
-
-func (m *GetExistenceRequest) GetAppId() string {
- if m != nil {
- return m.AppId
- }
- return ""
-}
-
-func (m *GetExistenceRequest) GetServiceName() string {
- if m != nil {
- return m.ServiceName
- }
- return ""
-}
-
-func (m *GetExistenceRequest) GetVersion() string {
- if m != nil {
- return m.Version
- }
- return ""
-}
-
-func (m *GetExistenceRequest) GetServiceId() string {
- if m != nil {
- return m.ServiceId
- }
- return ""
-}
-
-func (m *GetExistenceRequest) GetSchemaId() string {
- if m != nil {
- return m.SchemaId
- }
- return ""
-}
-
-func (m *GetExistenceRequest) GetEnvironment() string {
- if m != nil {
- return m.Environment
- }
- return ""
-}
-
-type GetExistenceResponse struct {
- Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
- ServiceId string `protobuf:"bytes,2,opt,name=serviceId" json:"serviceId,omitempty"`
- SchemaId string `protobuf:"bytes,3,opt,name=schemaId" json:"schemaId,omitempty"`
- Summary string `protobuf:"bytes,4,opt,name=summary" json:"summary,omitempty"`
-}
-
-func (m *GetExistenceResponse) Reset() { *m = GetExistenceResponse{} }
-func (m *GetExistenceResponse) String() string { return proto1.CompactTextString(m) }
-func (*GetExistenceResponse) ProtoMessage() {}
-func (*GetExistenceResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21} }
-
-func (m *GetExistenceResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-func (m *GetExistenceResponse) GetServiceId() string {
- if m != nil {
- return m.ServiceId
- }
- return ""
-}
-
-func (m *GetExistenceResponse) GetSchemaId() string {
- if m != nil {
- return m.SchemaId
- }
- return ""
-}
-
-func (m *GetExistenceResponse) GetSummary() string {
- if m != nil {
- return m.Summary
- }
- return ""
-}
-
-type CreateServiceRequest struct {
- Service *MicroService `protobuf:"bytes,1,opt,name=service" json:"service,omitempty"`
- Rules []*AddOrUpdateServiceRule `protobuf:"bytes,2,rep,name=rules" json:"rules,omitempty"`
- Tags map[string]string `protobuf:"bytes,3,rep,name=tags" json:"tags,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
- Instances []*MicroServiceInstance `protobuf:"bytes,4,rep,name=instances" json:"instances,omitempty"`
-}
-
-func (m *CreateServiceRequest) Reset() { *m = CreateServiceRequest{} }
-func (m *CreateServiceRequest) String() string { return proto1.CompactTextString(m) }
-func (*CreateServiceRequest) ProtoMessage() {}
-func (*CreateServiceRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{22} }
-
-func (m *CreateServiceRequest) GetService() *MicroService {
- if m != nil {
- return m.Service
- }
- return nil
-}
-
-func (m *CreateServiceRequest) GetRules() []*AddOrUpdateServiceRule {
- if m != nil {
- return m.Rules
- }
- return nil
-}
-
-func (m *CreateServiceRequest) GetTags() map[string]string {
- if m != nil {
- return m.Tags
- }
- return nil
-}
-
-func (m *CreateServiceRequest) GetInstances() []*MicroServiceInstance {
- if m != nil {
- return m.Instances
- }
- return nil
-}
-
-type CreateServiceResponse struct {
- Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
- ServiceId string `protobuf:"bytes,2,opt,name=serviceId" json:"serviceId,omitempty"`
-}
-
-func (m *CreateServiceResponse) Reset() { *m = CreateServiceResponse{} }
-func (m *CreateServiceResponse) String() string { return proto1.CompactTextString(m) }
-func (*CreateServiceResponse) ProtoMessage() {}
-func (*CreateServiceResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{23} }
-
-func (m *CreateServiceResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-func (m *CreateServiceResponse) GetServiceId() string {
- if m != nil {
- return m.ServiceId
- }
- return ""
-}
-
-type DeleteServiceRequest struct {
- ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
- Force bool `protobuf:"varint,2,opt,name=force" json:"force,omitempty"`
-}
-
-func (m *DeleteServiceRequest) Reset() { *m = DeleteServiceRequest{} }
-func (m *DeleteServiceRequest) String() string { return proto1.CompactTextString(m) }
-func (*DeleteServiceRequest) ProtoMessage() {}
-func (*DeleteServiceRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{24} }
-
-func (m *DeleteServiceRequest) GetServiceId() string {
- if m != nil {
- return m.ServiceId
- }
- return ""
-}
-
-func (m *DeleteServiceRequest) GetForce() bool {
- if m != nil {
- return m.Force
- }
- return false
-}
-
-type DeleteServiceResponse struct {
- Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
-}
-
-func (m *DeleteServiceResponse) Reset() { *m = DeleteServiceResponse{} }
-func (m *DeleteServiceResponse) String() string { return proto1.CompactTextString(m) }
-func (*DeleteServiceResponse) ProtoMessage() {}
-func (*DeleteServiceResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{25} }
-
-func (m *DeleteServiceResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-type GetServiceRequest struct {
- ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
-}
-
-func (m *GetServiceRequest) Reset() { *m = GetServiceRequest{} }
-func (m *GetServiceRequest) String() string { return proto1.CompactTextString(m) }
-func (*GetServiceRequest) ProtoMessage() {}
-func (*GetServiceRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{26} }
-
-func (m *GetServiceRequest) GetServiceId() string {
- if m != nil {
- return m.ServiceId
- }
- return ""
-}
-
-type GetServiceResponse struct {
- Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
- Service *MicroService `protobuf:"bytes,2,opt,name=service" json:"service,omitempty"`
-}
-
-func (m *GetServiceResponse) Reset() { *m = GetServiceResponse{} }
-func (m *GetServiceResponse) String() string { return proto1.CompactTextString(m) }
-func (*GetServiceResponse) ProtoMessage() {}
-func (*GetServiceResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{27} }
-
-func (m *GetServiceResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-func (m *GetServiceResponse) GetService() *MicroService {
- if m != nil {
- return m.Service
- }
- return nil
-}
-
-type GetServicesRequest struct {
-}
-
-func (m *GetServicesRequest) Reset() { *m = GetServicesRequest{} }
-func (m *GetServicesRequest) String() string { return proto1.CompactTextString(m) }
-func (*GetServicesRequest) ProtoMessage() {}
-func (*GetServicesRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{28} }
-
-type GetServicesResponse struct {
- Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
- Services []*MicroService `protobuf:"bytes,2,rep,name=services" json:"services,omitempty"`
-}
-
-func (m *GetServicesResponse) Reset() { *m = GetServicesResponse{} }
-func (m *GetServicesResponse) String() string { return proto1.CompactTextString(m) }
-func (*GetServicesResponse) ProtoMessage() {}
-func (*GetServicesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{29} }
-
-func (m *GetServicesResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-func (m *GetServicesResponse) GetServices() []*MicroService {
- if m != nil {
- return m.Services
- }
- return nil
-}
-
-type UpdateServicePropsRequest struct {
- ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
- Properties map[string]string `protobuf:"bytes,2,rep,name=properties" json:"properties,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
-}
-
-func (m *UpdateServicePropsRequest) Reset() { *m = UpdateServicePropsRequest{} }
-func (m *UpdateServicePropsRequest) String() string { return proto1.CompactTextString(m) }
-func (*UpdateServicePropsRequest) ProtoMessage() {}
-func (*UpdateServicePropsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{30} }
-
-func (m *UpdateServicePropsRequest) GetServiceId() string {
- if m != nil {
- return m.ServiceId
- }
- return ""
-}
-
-func (m *UpdateServicePropsRequest) GetProperties() map[string]string {
- if m != nil {
- return m.Properties
- }
- return nil
-}
-
-type UpdateServicePropsResponse struct {
- Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
-}
-
-func (m *UpdateServicePropsResponse) Reset() { *m = UpdateServicePropsResponse{} }
-func (m *UpdateServicePropsResponse) String() string { return proto1.CompactTextString(m) }
-func (*UpdateServicePropsResponse) ProtoMessage() {}
-func (*UpdateServicePropsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{31} }
-
-func (m *UpdateServicePropsResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-type GetServiceRulesRequest struct {
- ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
-}
-
-func (m *GetServiceRulesRequest) Reset() { *m = GetServiceRulesRequest{} }
-func (m *GetServiceRulesRequest) String() string { return proto1.CompactTextString(m) }
-func (*GetServiceRulesRequest) ProtoMessage() {}
-func (*GetServiceRulesRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{32} }
-
-func (m *GetServiceRulesRequest) GetServiceId() string {
- if m != nil {
- return m.ServiceId
- }
- return ""
-}
-
-type GetServiceRulesResponse struct {
- Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
- Rules []*ServiceRule `protobuf:"bytes,2,rep,name=rules" json:"rules,omitempty"`
-}
-
-func (m *GetServiceRulesResponse) Reset() { *m = GetServiceRulesResponse{} }
-func (m *GetServiceRulesResponse) String() string { return proto1.CompactTextString(m) }
-func (*GetServiceRulesResponse) ProtoMessage() {}
-func (*GetServiceRulesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{33} }
-
-func (m *GetServiceRulesResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-func (m *GetServiceRulesResponse) GetRules() []*ServiceRule {
- if m != nil {
- return m.Rules
- }
- return nil
-}
-
-type UpdateServiceRuleRequest struct {
- ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
- RuleId string `protobuf:"bytes,2,opt,name=ruleId" json:"ruleId,omitempty"`
- Rule *AddOrUpdateServiceRule `protobuf:"bytes,3,opt,name=rule" json:"rule,omitempty"`
-}
-
-func (m *UpdateServiceRuleRequest) Reset() { *m = UpdateServiceRuleRequest{} }
-func (m *UpdateServiceRuleRequest) String() string { return proto1.CompactTextString(m) }
-func (*UpdateServiceRuleRequest) ProtoMessage() {}
-func (*UpdateServiceRuleRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{34} }
-
-func (m *UpdateServiceRuleRequest) GetServiceId() string {
- if m != nil {
- return m.ServiceId
- }
- return ""
-}
-
-func (m *UpdateServiceRuleRequest) GetRuleId() string {
- if m != nil {
- return m.RuleId
- }
- return ""
-}
-
-func (m *UpdateServiceRuleRequest) GetRule() *AddOrUpdateServiceRule {
- if m != nil {
- return m.Rule
- }
- return nil
-}
-
-type UpdateServiceRuleResponse struct {
- Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
-}
-
-func (m *UpdateServiceRuleResponse) Reset() { *m = UpdateServiceRuleResponse{} }
-func (m *UpdateServiceRuleResponse) String() string { return proto1.CompactTextString(m) }
-func (*UpdateServiceRuleResponse) ProtoMessage() {}
-func (*UpdateServiceRuleResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{35} }
-
-func (m *UpdateServiceRuleResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-type AddServiceRulesRequest struct {
- ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
- Rules []*AddOrUpdateServiceRule `protobuf:"bytes,2,rep,name=rules" json:"rules,omitempty"`
-}
-
-func (m *AddServiceRulesRequest) Reset() { *m = AddServiceRulesRequest{} }
-func (m *AddServiceRulesRequest) String() string { return proto1.CompactTextString(m) }
-func (*AddServiceRulesRequest) ProtoMessage() {}
-func (*AddServiceRulesRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{36} }
-
-func (m *AddServiceRulesRequest) GetServiceId() string {
- if m != nil {
- return m.ServiceId
- }
- return ""
-}
-
-func (m *AddServiceRulesRequest) GetRules() []*AddOrUpdateServiceRule {
- if m != nil {
- return m.Rules
- }
- return nil
-}
-
-type AddServiceRulesResponse struct {
- Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
- RuleIds []string `protobuf:"bytes,2,rep,name=RuleIds" json:"RuleIds,omitempty"`
-}
-
-func (m *AddServiceRulesResponse) Reset() { *m = AddServiceRulesResponse{} }
-func (m *AddServiceRulesResponse) String() string { return proto1.CompactTextString(m) }
-func (*AddServiceRulesResponse) ProtoMessage() {}
-func (*AddServiceRulesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{37} }
-
-func (m *AddServiceRulesResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-func (m *AddServiceRulesResponse) GetRuleIds() []string {
- if m != nil {
- return m.RuleIds
- }
- return nil
-}
-
-type DeleteServiceRulesRequest struct {
- ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
- RuleIds []string `protobuf:"bytes,2,rep,name=ruleIds" json:"ruleIds,omitempty"`
-}
-
-func (m *DeleteServiceRulesRequest) Reset() { *m = DeleteServiceRulesRequest{} }
-func (m *DeleteServiceRulesRequest) String() string { return proto1.CompactTextString(m) }
-func (*DeleteServiceRulesRequest) ProtoMessage() {}
-func (*DeleteServiceRulesRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{38} }
-
-func (m *DeleteServiceRulesRequest) GetServiceId() string {
- if m != nil {
- return m.ServiceId
- }
- return ""
-}
-
-func (m *DeleteServiceRulesRequest) GetRuleIds() []string {
- if m != nil {
- return m.RuleIds
- }
- return nil
-}
-
-type DeleteServiceRulesResponse struct {
- Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
-}
-
-func (m *DeleteServiceRulesResponse) Reset() { *m = DeleteServiceRulesResponse{} }
-func (m *DeleteServiceRulesResponse) String() string { return proto1.CompactTextString(m) }
-func (*DeleteServiceRulesResponse) ProtoMessage() {}
-func (*DeleteServiceRulesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{39} }
-
-func (m *DeleteServiceRulesResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-type GetServiceTagsRequest struct {
- ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
-}
-
-func (m *GetServiceTagsRequest) Reset() { *m = GetServiceTagsRequest{} }
-func (m *GetServiceTagsRequest) String() string { return proto1.CompactTextString(m) }
-func (*GetServiceTagsRequest) ProtoMessage() {}
-func (*GetServiceTagsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{40} }
-
-func (m *GetServiceTagsRequest) GetServiceId() string {
- if m != nil {
- return m.ServiceId
- }
- return ""
-}
-
-type GetServiceTagsResponse struct {
- Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
- Tags map[string]string `protobuf:"bytes,2,rep,name=tags" json:"tags,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
-}
-
-func (m *GetServiceTagsResponse) Reset() { *m = GetServiceTagsResponse{} }
-func (m *GetServiceTagsResponse) String() string { return proto1.CompactTextString(m) }
-func (*GetServiceTagsResponse) ProtoMessage() {}
-func (*GetServiceTagsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{41} }
-
-func (m *GetServiceTagsResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-func (m *GetServiceTagsResponse) GetTags() map[string]string {
- if m != nil {
- return m.Tags
- }
- return nil
-}
-
-type UpdateServiceTagRequest struct {
- ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
- Key string `protobuf:"bytes,2,opt,name=key" json:"key,omitempty"`
- Value string `protobuf:"bytes,3,opt,name=value" json:"value,omitempty"`
-}
-
-func (m *UpdateServiceTagRequest) Reset() { *m = UpdateServiceTagRequest{} }
-func (m *UpdateServiceTagRequest) String() string { return proto1.CompactTextString(m) }
-func (*UpdateServiceTagRequest) ProtoMessage() {}
-func (*UpdateServiceTagRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{42} }
-
-func (m *UpdateServiceTagRequest) GetServiceId() string {
- if m != nil {
- return m.ServiceId
- }
- return ""
-}
-
-func (m *UpdateServiceTagRequest) GetKey() string {
- if m != nil {
- return m.Key
- }
- return ""
-}
-
-func (m *UpdateServiceTagRequest) GetValue() string {
- if m != nil {
- return m.Value
- }
- return ""
-}
-
-type UpdateServiceTagResponse struct {
- Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
-}
-
-func (m *UpdateServiceTagResponse) Reset() { *m = UpdateServiceTagResponse{} }
-func (m *UpdateServiceTagResponse) String() string { return proto1.CompactTextString(m) }
-func (*UpdateServiceTagResponse) ProtoMessage() {}
-func (*UpdateServiceTagResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{43} }
-
-func (m *UpdateServiceTagResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-type AddServiceTagsRequest struct {
- ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
- Tags map[string]string `protobuf:"bytes,2,rep,name=tags" json:"tags,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
-}
-
-func (m *AddServiceTagsRequest) Reset() { *m = AddServiceTagsRequest{} }
-func (m *AddServiceTagsRequest) String() string { return proto1.CompactTextString(m) }
-func (*AddServiceTagsRequest) ProtoMessage() {}
-func (*AddServiceTagsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{44} }
-
-func (m *AddServiceTagsRequest) GetServiceId() string {
- if m != nil {
- return m.ServiceId
- }
- return ""
-}
-
-func (m *AddServiceTagsRequest) GetTags() map[string]string {
- if m != nil {
- return m.Tags
- }
- return nil
-}
-
-type AddServiceTagsResponse struct {
- Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
-}
-
-func (m *AddServiceTagsResponse) Reset() { *m = AddServiceTagsResponse{} }
-func (m *AddServiceTagsResponse) String() string { return proto1.CompactTextString(m) }
-func (*AddServiceTagsResponse) ProtoMessage() {}
-func (*AddServiceTagsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{45} }
-
-func (m *AddServiceTagsResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-type DeleteServiceTagsRequest struct {
- ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
- Keys []string `protobuf:"bytes,2,rep,name=keys" json:"keys,omitempty"`
-}
-
-func (m *DeleteServiceTagsRequest) Reset() { *m = DeleteServiceTagsRequest{} }
-func (m *DeleteServiceTagsRequest) String() string { return proto1.CompactTextString(m) }
-func (*DeleteServiceTagsRequest) ProtoMessage() {}
-func (*DeleteServiceTagsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{46} }
-
-func (m *DeleteServiceTagsRequest) GetServiceId() string {
- if m != nil {
- return m.ServiceId
- }
- return ""
-}
-
-func (m *DeleteServiceTagsRequest) GetKeys() []string {
- if m != nil {
- return m.Keys
- }
- return nil
-}
-
-type DeleteServiceTagsResponse struct {
- Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
-}
-
-func (m *DeleteServiceTagsResponse) Reset() { *m = DeleteServiceTagsResponse{} }
-func (m *DeleteServiceTagsResponse) String() string { return proto1.CompactTextString(m) }
-func (*DeleteServiceTagsResponse) ProtoMessage() {}
-func (*DeleteServiceTagsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{47} }
-
-func (m *DeleteServiceTagsResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-type HealthCheck struct {
- Mode string `protobuf:"bytes,1,opt,name=mode" json:"mode,omitempty"`
- Port int32 `protobuf:"varint,2,opt,name=port" json:"port,omitempty"`
- Interval int32 `protobuf:"varint,3,opt,name=interval" json:"interval,omitempty"`
- Times int32 `protobuf:"varint,4,opt,name=times" json:"times,omitempty"`
- Url string `protobuf:"bytes,5,opt,name=url" json:"url,omitempty"`
-}
-
-func (m *HealthCheck) Reset() { *m = HealthCheck{} }
-func (m *HealthCheck) String() string { return proto1.CompactTextString(m) }
-func (*HealthCheck) ProtoMessage() {}
-func (*HealthCheck) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{48} }
-
-func (m *HealthCheck) GetMode() string {
- if m != nil {
- return m.Mode
- }
- return ""
-}
-
-func (m *HealthCheck) GetPort() int32 {
- if m != nil {
- return m.Port
- }
- return 0
-}
-
-func (m *HealthCheck) GetInterval() int32 {
- if m != nil {
- return m.Interval
- }
- return 0
-}
-
-func (m *HealthCheck) GetTimes() int32 {
- if m != nil {
- return m.Times
- }
- return 0
-}
-
-func (m *HealthCheck) GetUrl() string {
- if m != nil {
- return m.Url
- }
- return ""
-}
-
-type MicroServiceInstance struct {
- InstanceId string `protobuf:"bytes,1,opt,name=instanceId" json:"instanceId,omitempty"`
- ServiceId string `protobuf:"bytes,2,opt,name=serviceId" json:"serviceId,omitempty"`
- Endpoints []string `protobuf:"bytes,3,rep,name=endpoints" json:"endpoints,omitempty"`
- HostName string `protobuf:"bytes,4,opt,name=hostName" json:"hostName,omitempty"`
- Status string `protobuf:"bytes,5,opt,name=status" json:"status,omitempty"`
- Properties map[string]string `protobuf:"bytes,6,rep,name=properties" json:"properties,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
- HealthCheck *HealthCheck `protobuf:"bytes,7,opt,name=healthCheck" json:"healthCheck,omitempty"`
- Timestamp string `protobuf:"bytes,8,opt,name=timestamp" json:"timestamp,omitempty"`
- DataCenterInfo *DataCenterInfo `protobuf:"bytes,9,opt,name=dataCenterInfo" json:"dataCenterInfo,omitempty"`
- ModTimestamp string `protobuf:"bytes,10,opt,name=modTimestamp" json:"modTimestamp,omitempty"`
- Version string `protobuf:"bytes,11,opt,name=version" json:"version,omitempty"`
-}
-
-func (m *MicroServiceInstance) Reset() { *m = MicroServiceInstance{} }
-func (m *MicroServiceInstance) String() string { return proto1.CompactTextString(m) }
-func (*MicroServiceInstance) ProtoMessage() {}
-func (*MicroServiceInstance) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{49} }
-
-func (m *MicroServiceInstance) GetInstanceId() string {
- if m != nil {
- return m.InstanceId
- }
- return ""
-}
-
-func (m *MicroServiceInstance) GetServiceId() string {
- if m != nil {
- return m.ServiceId
- }
- return ""
-}
-
-func (m *MicroServiceInstance) GetEndpoints() []string {
- if m != nil {
- return m.Endpoints
- }
- return nil
-}
-
-func (m *MicroServiceInstance) GetHostName() string {
- if m != nil {
- return m.HostName
- }
- return ""
-}
-
-func (m *MicroServiceInstance) GetStatus() string {
- if m != nil {
- return m.Status
- }
- return ""
-}
-
-func (m *MicroServiceInstance) GetProperties() map[string]string {
- if m != nil {
- return m.Properties
- }
- return nil
-}
-
-func (m *MicroServiceInstance) GetHealthCheck() *HealthCheck {
- if m != nil {
- return m.HealthCheck
- }
- return nil
-}
-
-func (m *MicroServiceInstance) GetTimestamp() string {
- if m != nil {
- return m.Timestamp
- }
- return ""
-}
-
-func (m *MicroServiceInstance) GetDataCenterInfo() *DataCenterInfo {
- if m != nil {
- return m.DataCenterInfo
- }
- return nil
-}
-
-func (m *MicroServiceInstance) GetModTimestamp() string {
- if m != nil {
- return m.ModTimestamp
- }
- return ""
-}
-
-func (m *MicroServiceInstance) GetVersion() string {
- if m != nil {
- return m.Version
- }
- return ""
-}
-
-type DataCenterInfo struct {
- Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
- Region string `protobuf:"bytes,2,opt,name=region" json:"region,omitempty"`
- AvailableZone string `protobuf:"bytes,3,opt,name=availableZone" json:"availableZone,omitempty"`
-}
-
-func (m *DataCenterInfo) Reset() { *m = DataCenterInfo{} }
-func (m *DataCenterInfo) String() string { return proto1.CompactTextString(m) }
-func (*DataCenterInfo) ProtoMessage() {}
-func (*DataCenterInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{50} }
-
-func (m *DataCenterInfo) GetName() string {
- if m != nil {
- return m.Name
- }
- return ""
-}
-
-func (m *DataCenterInfo) GetRegion() string {
- if m != nil {
- return m.Region
- }
- return ""
-}
-
-func (m *DataCenterInfo) GetAvailableZone() string {
- if m != nil {
- return m.AvailableZone
- }
- return ""
-}
-
-type MicroServiceInstanceKey struct {
- InstanceId string `protobuf:"bytes,1,opt,name=instanceId" json:"instanceId,omitempty"`
- ServiceId string `protobuf:"bytes,2,opt,name=serviceId" json:"serviceId,omitempty"`
-}
-
-func (m *MicroServiceInstanceKey) Reset() { *m = MicroServiceInstanceKey{} }
-func (m *MicroServiceInstanceKey) String() string { return proto1.CompactTextString(m) }
-func (*MicroServiceInstanceKey) ProtoMessage() {}
-func (*MicroServiceInstanceKey) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{51} }
-
-func (m *MicroServiceInstanceKey) GetInstanceId() string {
- if m != nil {
- return m.InstanceId
- }
- return ""
-}
-
-func (m *MicroServiceInstanceKey) GetServiceId() string {
- if m != nil {
- return m.ServiceId
- }
- return ""
-}
-
-type RegisterInstanceRequest struct {
- Instance *MicroServiceInstance `protobuf:"bytes,1,opt,name=instance" json:"instance,omitempty"`
-}
-
-func (m *RegisterInstanceRequest) Reset() { *m = RegisterInstanceRequest{} }
-func (m *RegisterInstanceRequest) String() string { return proto1.CompactTextString(m) }
-func (*RegisterInstanceRequest) ProtoMessage() {}
-func (*RegisterInstanceRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{52} }
-
-func (m *RegisterInstanceRequest) GetInstance() *MicroServiceInstance {
- if m != nil {
- return m.Instance
- }
- return nil
-}
-
-type RegisterInstanceResponse struct {
- Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
- InstanceId string `protobuf:"bytes,2,opt,name=instanceId" json:"instanceId,omitempty"`
-}
-
-func (m *RegisterInstanceResponse) Reset() { *m = RegisterInstanceResponse{} }
-func (m *RegisterInstanceResponse) String() string { return proto1.CompactTextString(m) }
-func (*RegisterInstanceResponse) ProtoMessage() {}
-func (*RegisterInstanceResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{53} }
-
-func (m *RegisterInstanceResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-func (m *RegisterInstanceResponse) GetInstanceId() string {
- if m != nil {
- return m.InstanceId
- }
- return ""
-}
-
-type UnregisterInstanceRequest struct {
- ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
- InstanceId string `protobuf:"bytes,2,opt,name=instanceId" json:"instanceId,omitempty"`
-}
-
-func (m *UnregisterInstanceRequest) Reset() { *m = UnregisterInstanceRequest{} }
-func (m *UnregisterInstanceRequest) String() string { return proto1.CompactTextString(m) }
-func (*UnregisterInstanceRequest) ProtoMessage() {}
-func (*UnregisterInstanceRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{54} }
-
-func (m *UnregisterInstanceRequest) GetServiceId() string {
- if m != nil {
- return m.ServiceId
- }
- return ""
-}
-
-func (m *UnregisterInstanceRequest) GetInstanceId() string {
- if m != nil {
- return m.InstanceId
- }
- return ""
-}
-
-type UnregisterInstanceResponse struct {
- Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
-}
-
-func (m *UnregisterInstanceResponse) Reset() { *m = UnregisterInstanceResponse{} }
-func (m *UnregisterInstanceResponse) String() string { return proto1.CompactTextString(m) }
-func (*UnregisterInstanceResponse) ProtoMessage() {}
-func (*UnregisterInstanceResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{55} }
-
-func (m *UnregisterInstanceResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-type HeartbeatRequest struct {
- ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
- InstanceId string `protobuf:"bytes,2,opt,name=instanceId" json:"instanceId,omitempty"`
-}
-
-func (m *HeartbeatRequest) Reset() { *m = HeartbeatRequest{} }
-func (m *HeartbeatRequest) String() string { return proto1.CompactTextString(m) }
-func (*HeartbeatRequest) ProtoMessage() {}
-func (*HeartbeatRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{56} }
-
-func (m *HeartbeatRequest) GetServiceId() string {
- if m != nil {
- return m.ServiceId
- }
- return ""
-}
-
-func (m *HeartbeatRequest) GetInstanceId() string {
- if m != nil {
- return m.InstanceId
- }
- return ""
-}
-
-type HeartbeatResponse struct {
- Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
-}
-
-func (m *HeartbeatResponse) Reset() { *m = HeartbeatResponse{} }
-func (m *HeartbeatResponse) String() string { return proto1.CompactTextString(m) }
-func (*HeartbeatResponse) ProtoMessage() {}
-func (*HeartbeatResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{57} }
-
-func (m *HeartbeatResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-type FindInstancesRequest struct {
- ConsumerServiceId string `protobuf:"bytes,1,opt,name=consumerServiceId" json:"consumerServiceId,omitempty"`
- AppId string `protobuf:"bytes,2,opt,name=appId" json:"appId,omitempty"`
- ServiceName string `protobuf:"bytes,3,opt,name=serviceName" json:"serviceName,omitempty"`
- VersionRule string `protobuf:"bytes,4,opt,name=versionRule" json:"versionRule,omitempty"`
- Tags []string `protobuf:"bytes,5,rep,name=tags" json:"tags,omitempty"`
- Environment string `protobuf:"bytes,6,opt,name=environment" json:"environment,omitempty"`
-}
-
-func (m *FindInstancesRequest) Reset() { *m = FindInstancesRequest{} }
-func (m *FindInstancesRequest) String() string { return proto1.CompactTextString(m) }
-func (*FindInstancesRequest) ProtoMessage() {}
-func (*FindInstancesRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{58} }
-
-func (m *FindInstancesRequest) GetConsumerServiceId() string {
- if m != nil {
- return m.ConsumerServiceId
- }
- return ""
-}
-
-func (m *FindInstancesRequest) GetAppId() string {
- if m != nil {
- return m.AppId
- }
- return ""
-}
-
-func (m *FindInstancesRequest) GetServiceName() string {
- if m != nil {
- return m.ServiceName
- }
- return ""
-}
-
-func (m *FindInstancesRequest) GetVersionRule() string {
- if m != nil {
- return m.VersionRule
- }
- return ""
-}
-
-func (m *FindInstancesRequest) GetTags() []string {
- if m != nil {
- return m.Tags
- }
- return nil
-}
-
-func (m *FindInstancesRequest) GetEnvironment() string {
- if m != nil {
- return m.Environment
- }
- return ""
-}
-
-type FindInstancesResponse struct {
- Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
- Instances []*MicroServiceInstance `protobuf:"bytes,2,rep,name=instances" json:"instances,omitempty"`
-}
-
-func (m *FindInstancesResponse) Reset() { *m = FindInstancesResponse{} }
-func (m *FindInstancesResponse) String() string { return proto1.CompactTextString(m) }
-func (*FindInstancesResponse) ProtoMessage() {}
-func (*FindInstancesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{59} }
-
-func (m *FindInstancesResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-func (m *FindInstancesResponse) GetInstances() []*MicroServiceInstance {
- if m != nil {
- return m.Instances
- }
- return nil
-}
-
-type GetOneInstanceRequest struct {
- ConsumerServiceId string `protobuf:"bytes,1,opt,name=consumerServiceId" json:"consumerServiceId,omitempty"`
- ProviderServiceId string `protobuf:"bytes,2,opt,name=providerServiceId" json:"providerServiceId,omitempty"`
- ProviderInstanceId string `protobuf:"bytes,3,opt,name=providerInstanceId" json:"providerInstanceId,omitempty"`
- Tags []string `protobuf:"bytes,4,rep,name=tags" json:"tags,omitempty"`
-}
-
-func (m *GetOneInstanceRequest) Reset() { *m = GetOneInstanceRequest{} }
-func (m *GetOneInstanceRequest) String() string { return proto1.CompactTextString(m) }
-func (*GetOneInstanceRequest) ProtoMessage() {}
-func (*GetOneInstanceRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{60} }
-
-func (m *GetOneInstanceRequest) GetConsumerServiceId() string {
- if m != nil {
- return m.ConsumerServiceId
- }
- return ""
-}
-
-func (m *GetOneInstanceRequest) GetProviderServiceId() string {
- if m != nil {
- return m.ProviderServiceId
- }
- return ""
-}
-
-func (m *GetOneInstanceRequest) GetProviderInstanceId() string {
- if m != nil {
- return m.ProviderInstanceId
- }
- return ""
-}
-
-func (m *GetOneInstanceRequest) GetTags() []string {
- if m != nil {
- return m.Tags
- }
- return nil
-}
-
-type GetOneInstanceResponse struct {
- Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
- Instance *MicroServiceInstance `protobuf:"bytes,2,opt,name=instance" json:"instance,omitempty"`
-}
-
-func (m *GetOneInstanceResponse) Reset() { *m = GetOneInstanceResponse{} }
-func (m *GetOneInstanceResponse) String() string { return proto1.CompactTextString(m) }
-func (*GetOneInstanceResponse) ProtoMessage() {}
-func (*GetOneInstanceResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{61} }
-
-func (m *GetOneInstanceResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-func (m *GetOneInstanceResponse) GetInstance() *MicroServiceInstance {
- if m != nil {
- return m.Instance
- }
- return nil
-}
-
-type GetInstancesRequest struct {
- ConsumerServiceId string `protobuf:"bytes,1,opt,name=consumerServiceId" json:"consumerServiceId,omitempty"`
- ProviderServiceId string `protobuf:"bytes,2,opt,name=providerServiceId" json:"providerServiceId,omitempty"`
- Tags []string `protobuf:"bytes,3,rep,name=tags" json:"tags,omitempty"`
-}
-
-func (m *GetInstancesRequest) Reset() { *m = GetInstancesRequest{} }
-func (m *GetInstancesRequest) String() string { return proto1.CompactTextString(m) }
-func (*GetInstancesRequest) ProtoMessage() {}
-func (*GetInstancesRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{62} }
-
-func (m *GetInstancesRequest) GetConsumerServiceId() string {
- if m != nil {
- return m.ConsumerServiceId
- }
- return ""
-}
-
-func (m *GetInstancesRequest) GetProviderServiceId() string {
- if m != nil {
- return m.ProviderServiceId
- }
- return ""
-}
-
-func (m *GetInstancesRequest) GetTags() []string {
- if m != nil {
- return m.Tags
- }
- return nil
-}
-
-type GetInstancesResponse struct {
- Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
- Instances []*MicroServiceInstance `protobuf:"bytes,2,rep,name=instances" json:"instances,omitempty"`
-}
-
-func (m *GetInstancesResponse) Reset() { *m = GetInstancesResponse{} }
-func (m *GetInstancesResponse) String() string { return proto1.CompactTextString(m) }
-func (*GetInstancesResponse) ProtoMessage() {}
-func (*GetInstancesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{63} }
-
-func (m *GetInstancesResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-func (m *GetInstancesResponse) GetInstances() []*MicroServiceInstance {
- if m != nil {
- return m.Instances
- }
- return nil
-}
-
-type UpdateInstanceStatusRequest struct {
- ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
- InstanceId string `protobuf:"bytes,2,opt,name=instanceId" json:"instanceId,omitempty"`
- Status string `protobuf:"bytes,3,opt,name=status" json:"status,omitempty"`
-}
-
-func (m *UpdateInstanceStatusRequest) Reset() { *m = UpdateInstanceStatusRequest{} }
-func (m *UpdateInstanceStatusRequest) String() string { return proto1.CompactTextString(m) }
-func (*UpdateInstanceStatusRequest) ProtoMessage() {}
-func (*UpdateInstanceStatusRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{64} }
-
-func (m *UpdateInstanceStatusRequest) GetServiceId() string {
- if m != nil {
- return m.ServiceId
- }
- return ""
-}
-
-func (m *UpdateInstanceStatusRequest) GetInstanceId() string {
- if m != nil {
- return m.InstanceId
- }
- return ""
-}
-
-func (m *UpdateInstanceStatusRequest) GetStatus() string {
- if m != nil {
- return m.Status
- }
- return ""
-}
-
-type UpdateInstanceStatusResponse struct {
- Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
-}
-
-func (m *UpdateInstanceStatusResponse) Reset() { *m = UpdateInstanceStatusResponse{} }
-func (m *UpdateInstanceStatusResponse) String() string { return proto1.CompactTextString(m) }
-func (*UpdateInstanceStatusResponse) ProtoMessage() {}
-func (*UpdateInstanceStatusResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{65} }
-
-func (m *UpdateInstanceStatusResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-type UpdateInstancePropsRequest struct {
- ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
- InstanceId string `protobuf:"bytes,2,opt,name=instanceId" json:"instanceId,omitempty"`
- Properties map[string]string `protobuf:"bytes,3,rep,name=properties" json:"properties,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
-}
-
-func (m *UpdateInstancePropsRequest) Reset() { *m = UpdateInstancePropsRequest{} }
-func (m *UpdateInstancePropsRequest) String() string { return proto1.CompactTextString(m) }
-func (*UpdateInstancePropsRequest) ProtoMessage() {}
-func (*UpdateInstancePropsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{66} }
-
-func (m *UpdateInstancePropsRequest) GetServiceId() string {
- if m != nil {
- return m.ServiceId
- }
- return ""
-}
-
-func (m *UpdateInstancePropsRequest) GetInstanceId() string {
- if m != nil {
- return m.InstanceId
- }
- return ""
-}
-
-func (m *UpdateInstancePropsRequest) GetProperties() map[string]string {
- if m != nil {
- return m.Properties
- }
- return nil
-}
-
-type UpdateInstancePropsResponse struct {
- Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
-}
-
-func (m *UpdateInstancePropsResponse) Reset() { *m = UpdateInstancePropsResponse{} }
-func (m *UpdateInstancePropsResponse) String() string { return proto1.CompactTextString(m) }
-func (*UpdateInstancePropsResponse) ProtoMessage() {}
-func (*UpdateInstancePropsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{67} }
-
-func (m *UpdateInstancePropsResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-type WatchInstanceRequest struct {
- SelfServiceId string `protobuf:"bytes,1,opt,name=selfServiceId" json:"selfServiceId,omitempty"`
-}
-
-func (m *WatchInstanceRequest) Reset() { *m = WatchInstanceRequest{} }
-func (m *WatchInstanceRequest) String() string { return proto1.CompactTextString(m) }
-func (*WatchInstanceRequest) ProtoMessage() {}
-func (*WatchInstanceRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{68} }
-
-func (m *WatchInstanceRequest) GetSelfServiceId() string {
- if m != nil {
- return m.SelfServiceId
- }
- return ""
-}
-
-type WatchInstanceResponse struct {
- Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
- Action string `protobuf:"bytes,2,opt,name=action" json:"action,omitempty"`
- Key *MicroServiceKey `protobuf:"bytes,3,opt,name=key" json:"key,omitempty"`
- Instance *MicroServiceInstance `protobuf:"bytes,4,opt,name=instance" json:"instance,omitempty"`
-}
-
-func (m *WatchInstanceResponse) Reset() { *m = WatchInstanceResponse{} }
-func (m *WatchInstanceResponse) String() string { return proto1.CompactTextString(m) }
-func (*WatchInstanceResponse) ProtoMessage() {}
-func (*WatchInstanceResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{69} }
-
-func (m *WatchInstanceResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-func (m *WatchInstanceResponse) GetAction() string {
- if m != nil {
- return m.Action
- }
- return ""
-}
-
-func (m *WatchInstanceResponse) GetKey() *MicroServiceKey {
- if m != nil {
- return m.Key
- }
- return nil
-}
-
-func (m *WatchInstanceResponse) GetInstance() *MicroServiceInstance {
- if m != nil {
- return m.Instance
- }
- return nil
-}
-
-type GetSchemaRequest struct {
- ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
- SchemaId string `protobuf:"bytes,2,opt,name=schemaId" json:"schemaId,omitempty"`
-}
-
-func (m *GetSchemaRequest) Reset() { *m = GetSchemaRequest{} }
-func (m *GetSchemaRequest) String() string { return proto1.CompactTextString(m) }
-func (*GetSchemaRequest) ProtoMessage() {}
-func (*GetSchemaRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{70} }
-
-func (m *GetSchemaRequest) GetServiceId() string {
- if m != nil {
- return m.ServiceId
- }
- return ""
-}
-
-func (m *GetSchemaRequest) GetSchemaId() string {
- if m != nil {
- return m.SchemaId
- }
- return ""
-}
-
-type GetAllSchemaRequest struct {
- ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
- WithSchema bool `protobuf:"varint,2,opt,name=withSchema" json:"withSchema,omitempty"`
-}
-
-func (m *GetAllSchemaRequest) Reset() { *m = GetAllSchemaRequest{} }
-func (m *GetAllSchemaRequest) String() string { return proto1.CompactTextString(m) }
-func (*GetAllSchemaRequest) ProtoMessage() {}
-func (*GetAllSchemaRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{71} }
-
-func (m *GetAllSchemaRequest) GetServiceId() string {
- if m != nil {
- return m.ServiceId
- }
- return ""
-}
-
-func (m *GetAllSchemaRequest) GetWithSchema() bool {
- if m != nil {
- return m.WithSchema
- }
- return false
-}
-
-type GetSchemaResponse struct {
- Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
- Schema string `protobuf:"bytes,2,opt,name=schema" json:"schema,omitempty"`
- SchemaSummary string `protobuf:"bytes,3,opt,name=schemaSummary" json:"schemaSummary,omitempty"`
-}
-
-func (m *GetSchemaResponse) Reset() { *m = GetSchemaResponse{} }
-func (m *GetSchemaResponse) String() string { return proto1.CompactTextString(m) }
-func (*GetSchemaResponse) ProtoMessage() {}
-func (*GetSchemaResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{72} }
-
-func (m *GetSchemaResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-func (m *GetSchemaResponse) GetSchema() string {
- if m != nil {
- return m.Schema
- }
- return ""
-}
-
-func (m *GetSchemaResponse) GetSchemaSummary() string {
- if m != nil {
- return m.SchemaSummary
- }
- return ""
-}
-
-type GetAllSchemaResponse struct {
- Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
- Schemas []*Schema `protobuf:"bytes,2,rep,name=schemas" json:"schemas,omitempty"`
-}
-
-func (m *GetAllSchemaResponse) Reset() { *m = GetAllSchemaResponse{} }
-func (m *GetAllSchemaResponse) String() string { return proto1.CompactTextString(m) }
-func (*GetAllSchemaResponse) ProtoMessage() {}
-func (*GetAllSchemaResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{73} }
-
-func (m *GetAllSchemaResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-func (m *GetAllSchemaResponse) GetSchemas() []*Schema {
- if m != nil {
- return m.Schemas
- }
- return nil
-}
-
-type DeleteSchemaRequest struct {
- ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
- SchemaId string `protobuf:"bytes,2,opt,name=schemaId" json:"schemaId,omitempty"`
-}
-
-func (m *DeleteSchemaRequest) Reset() { *m = DeleteSchemaRequest{} }
-func (m *DeleteSchemaRequest) String() string { return proto1.CompactTextString(m) }
-func (*DeleteSchemaRequest) ProtoMessage() {}
-func (*DeleteSchemaRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{74} }
-
-func (m *DeleteSchemaRequest) GetServiceId() string {
- if m != nil {
- return m.ServiceId
- }
- return ""
-}
-
-func (m *DeleteSchemaRequest) GetSchemaId() string {
- if m != nil {
- return m.SchemaId
- }
- return ""
-}
-
-type DeleteSchemaResponse struct {
- Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
-}
-
-func (m *DeleteSchemaResponse) Reset() { *m = DeleteSchemaResponse{} }
-func (m *DeleteSchemaResponse) String() string { return proto1.CompactTextString(m) }
-func (*DeleteSchemaResponse) ProtoMessage() {}
-func (*DeleteSchemaResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{75} }
-
-func (m *DeleteSchemaResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-type ModifySchemaRequest struct {
- ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
- SchemaId string `protobuf:"bytes,2,opt,name=schemaId" json:"schemaId,omitempty"`
- Schema string `protobuf:"bytes,3,opt,name=schema" json:"schema,omitempty"`
- Summary string `protobuf:"bytes,4,opt,name=summary" json:"summary,omitempty"`
-}
-
-func (m *ModifySchemaRequest) Reset() { *m = ModifySchemaRequest{} }
-func (m *ModifySchemaRequest) String() string { return proto1.CompactTextString(m) }
-func (*ModifySchemaRequest) ProtoMessage() {}
-func (*ModifySchemaRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{76} }
-
-func (m *ModifySchemaRequest) GetServiceId() string {
- if m != nil {
- return m.ServiceId
- }
- return ""
-}
-
-func (m *ModifySchemaRequest) GetSchemaId() string {
- if m != nil {
- return m.SchemaId
- }
- return ""
-}
-
-func (m *ModifySchemaRequest) GetSchema() string {
- if m != nil {
- return m.Schema
- }
- return ""
-}
-
-func (m *ModifySchemaRequest) GetSummary() string {
- if m != nil {
- return m.Summary
- }
- return ""
-}
-
-type ModifySchemaResponse struct {
- Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
-}
-
-func (m *ModifySchemaResponse) Reset() { *m = ModifySchemaResponse{} }
-func (m *ModifySchemaResponse) String() string { return proto1.CompactTextString(m) }
-func (*ModifySchemaResponse) ProtoMessage() {}
-func (*ModifySchemaResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{77} }
-
-func (m *ModifySchemaResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-type AddDependenciesRequest struct {
- Dependencies []*ConsumerDependency `protobuf:"bytes,1,rep,name=dependencies" json:"dependencies,omitempty"`
-}
-
-func (m *AddDependenciesRequest) Reset() { *m = AddDependenciesRequest{} }
-func (m *AddDependenciesRequest) String() string { return proto1.CompactTextString(m) }
-func (*AddDependenciesRequest) ProtoMessage() {}
-func (*AddDependenciesRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{78} }
-
-func (m *AddDependenciesRequest) GetDependencies() []*ConsumerDependency {
- if m != nil {
- return m.Dependencies
- }
- return nil
-}
-
-type AddDependenciesResponse struct {
- Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
-}
-
-func (m *AddDependenciesResponse) Reset() { *m = AddDependenciesResponse{} }
-func (m *AddDependenciesResponse) String() string { return proto1.CompactTextString(m) }
-func (*AddDependenciesResponse) ProtoMessage() {}
-func (*AddDependenciesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{79} }
-
-func (m *AddDependenciesResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-type CreateDependenciesRequest struct {
- Dependencies []*ConsumerDependency `protobuf:"bytes,1,rep,name=dependencies" json:"dependencies,omitempty"`
-}
-
-func (m *CreateDependenciesRequest) Reset() { *m = CreateDependenciesRequest{} }
-func (m *CreateDependenciesRequest) String() string { return proto1.CompactTextString(m) }
-func (*CreateDependenciesRequest) ProtoMessage() {}
-func (*CreateDependenciesRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{80} }
-
-func (m *CreateDependenciesRequest) GetDependencies() []*ConsumerDependency {
- if m != nil {
- return m.Dependencies
- }
- return nil
-}
-
-type ConsumerDependency struct {
- Consumer *MicroServiceKey `protobuf:"bytes,1,opt,name=consumer" json:"consumer,omitempty"`
- Providers []*MicroServiceKey `protobuf:"bytes,2,rep,name=providers" json:"providers,omitempty"`
- Override bool `protobuf:"varint,3,opt,name=override" json:"override,omitempty"`
-}
-
-func (m *ConsumerDependency) Reset() { *m = ConsumerDependency{} }
-func (m *ConsumerDependency) String() string { return proto1.CompactTextString(m) }
-func (*ConsumerDependency) ProtoMessage() {}
-func (*ConsumerDependency) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{81} }
-
-func (m *ConsumerDependency) GetConsumer() *MicroServiceKey {
- if m != nil {
- return m.Consumer
- }
- return nil
-}
-
-func (m *ConsumerDependency) GetProviders() []*MicroServiceKey {
- if m != nil {
- return m.Providers
- }
- return nil
-}
-
-func (m *ConsumerDependency) GetOverride() bool {
- if m != nil {
- return m.Override
- }
- return false
-}
-
-type CreateDependenciesResponse struct {
- Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
-}
-
-func (m *CreateDependenciesResponse) Reset() { *m = CreateDependenciesResponse{} }
-func (m *CreateDependenciesResponse) String() string { return proto1.CompactTextString(m) }
-func (*CreateDependenciesResponse) ProtoMessage() {}
-func (*CreateDependenciesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{82} }
-
-func (m *CreateDependenciesResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-type GetDependenciesRequest struct {
- ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
- SameDomain bool `protobuf:"varint,2,opt,name=sameDomain" json:"sameDomain,omitempty"`
- NoSelf bool `protobuf:"varint,3,opt,name=noSelf" json:"noSelf,omitempty"`
-}
-
-func (m *GetDependenciesRequest) Reset() { *m = GetDependenciesRequest{} }
-func (m *GetDependenciesRequest) String() string { return proto1.CompactTextString(m) }
-func (*GetDependenciesRequest) ProtoMessage() {}
-func (*GetDependenciesRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{83} }
-
-func (m *GetDependenciesRequest) GetServiceId() string {
- if m != nil {
- return m.ServiceId
- }
- return ""
-}
-
-func (m *GetDependenciesRequest) GetSameDomain() bool {
- if m != nil {
- return m.SameDomain
- }
- return false
-}
-
-func (m *GetDependenciesRequest) GetNoSelf() bool {
- if m != nil {
- return m.NoSelf
- }
- return false
-}
-
-type GetConDependenciesResponse struct {
- Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
- Providers []*MicroService `protobuf:"bytes,2,rep,name=providers" json:"providers,omitempty"`
-}
-
-func (m *GetConDependenciesResponse) Reset() { *m = GetConDependenciesResponse{} }
-func (m *GetConDependenciesResponse) String() string { return proto1.CompactTextString(m) }
-func (*GetConDependenciesResponse) ProtoMessage() {}
-func (*GetConDependenciesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{84} }
-
-func (m *GetConDependenciesResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-func (m *GetConDependenciesResponse) GetProviders() []*MicroService {
- if m != nil {
- return m.Providers
- }
- return nil
-}
-
-type GetProDependenciesResponse struct {
- Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
- Consumers []*MicroService `protobuf:"bytes,2,rep,name=consumers" json:"consumers,omitempty"`
-}
-
-func (m *GetProDependenciesResponse) Reset() { *m = GetProDependenciesResponse{} }
-func (m *GetProDependenciesResponse) String() string { return proto1.CompactTextString(m) }
-func (*GetProDependenciesResponse) ProtoMessage() {}
-func (*GetProDependenciesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{85} }
-
-func (m *GetProDependenciesResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-func (m *GetProDependenciesResponse) GetConsumers() []*MicroService {
- if m != nil {
- return m.Consumers
- }
- return nil
-}
-
-// 服务详情
-type ServiceDetail struct {
- MicroService *MicroService `protobuf:"bytes,1,opt,name=microService" json:"microService,omitempty"`
- Instances []*MicroServiceInstance `protobuf:"bytes,2,rep,name=instances" json:"instances,omitempty"`
- SchemaInfos []*Schema `protobuf:"bytes,3,rep,name=schemaInfos" json:"schemaInfos,omitempty"`
- Rules []*ServiceRule `protobuf:"bytes,4,rep,name=rules" json:"rules,omitempty"`
- Providers []*MicroService `protobuf:"bytes,5,rep,name=providers" json:"providers,omitempty"`
- Consumers []*MicroService `protobuf:"bytes,6,rep,name=consumers" json:"consumers,omitempty"`
- Tags map[string]string `protobuf:"bytes,7,rep,name=tags" json:"tags,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
- MicroServiceVersions []string `protobuf:"bytes,8,rep,name=microServiceVersions" json:"microServiceVersions,omitempty"`
- Statics *Statistics `protobuf:"bytes,9,opt,name=statics" json:"statics,omitempty"`
-}
-
-func (m *ServiceDetail) Reset() { *m = ServiceDetail{} }
-func (m *ServiceDetail) String() string { return proto1.CompactTextString(m) }
-func (*ServiceDetail) ProtoMessage() {}
-func (*ServiceDetail) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{86} }
-
-func (m *ServiceDetail) GetMicroService() *MicroService {
- if m != nil {
- return m.MicroService
- }
- return nil
-}
-
-func (m *ServiceDetail) GetInstances() []*MicroServiceInstance {
- if m != nil {
- return m.Instances
- }
- return nil
-}
-
-func (m *ServiceDetail) GetSchemaInfos() []*Schema {
- if m != nil {
- return m.SchemaInfos
- }
- return nil
-}
-
-func (m *ServiceDetail) GetRules() []*ServiceRule {
- if m != nil {
- return m.Rules
- }
- return nil
-}
-
-func (m *ServiceDetail) GetProviders() []*MicroService {
- if m != nil {
- return m.Providers
- }
- return nil
-}
-
-func (m *ServiceDetail) GetConsumers() []*MicroService {
- if m != nil {
- return m.Consumers
- }
- return nil
-}
-
-func (m *ServiceDetail) GetTags() map[string]string {
- if m != nil {
- return m.Tags
- }
- return nil
-}
-
-func (m *ServiceDetail) GetMicroServiceVersions() []string {
- if m != nil {
- return m.MicroServiceVersions
- }
- return nil
-}
-
-func (m *ServiceDetail) GetStatics() *Statistics {
- if m != nil {
- return m.Statics
- }
- return nil
-}
-
-// 服务详情返回信息
-type GetServiceDetailResponse struct {
- Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
- Service *ServiceDetail `protobuf:"bytes,2,opt,name=service" json:"service,omitempty"`
-}
-
-func (m *GetServiceDetailResponse) Reset() { *m = GetServiceDetailResponse{} }
-func (m *GetServiceDetailResponse) String() string { return proto1.CompactTextString(m) }
-func (*GetServiceDetailResponse) ProtoMessage() {}
-func (*GetServiceDetailResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{87} }
-
-func (m *GetServiceDetailResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-func (m *GetServiceDetailResponse) GetService() *ServiceDetail {
- if m != nil {
- return m.Service
- }
- return nil
-}
-
-// 删除服务请求
-type DelServicesRequest struct {
- ServiceIds []string `protobuf:"bytes,1,rep,name=serviceIds" json:"serviceIds,omitempty"`
- Force bool `protobuf:"varint,2,opt,name=force" json:"force,omitempty"`
-}
-
-func (m *DelServicesRequest) Reset() { *m = DelServicesRequest{} }
-func (m *DelServicesRequest) String() string { return proto1.CompactTextString(m) }
-func (*DelServicesRequest) ProtoMessage() {}
-func (*DelServicesRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{88} }
-
-func (m *DelServicesRequest) GetServiceIds() []string {
- if m != nil {
- return m.ServiceIds
- }
- return nil
-}
-
-func (m *DelServicesRequest) GetForce() bool {
- if m != nil {
- return m.Force
- }
- return false
-}
-
-// 删除服务响应内容
-type DelServicesRspInfo struct {
- ErrMessage string `protobuf:"bytes,1,opt,name=errMessage" json:"errMessage,omitempty"`
- ServiceId string `protobuf:"bytes,2,opt,name=serviceId" json:"serviceId,omitempty"`
-}
-
-func (m *DelServicesRspInfo) Reset() { *m = DelServicesRspInfo{} }
-func (m *DelServicesRspInfo) String() string { return proto1.CompactTextString(m) }
-func (*DelServicesRspInfo) ProtoMessage() {}
-func (*DelServicesRspInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{89} }
-
-func (m *DelServicesRspInfo) GetErrMessage() string {
- if m != nil {
- return m.ErrMessage
- }
- return ""
-}
-
-func (m *DelServicesRspInfo) GetServiceId() string {
- if m != nil {
- return m.ServiceId
- }
- return ""
-}
-
-// 删除服务响应
-type DelServicesResponse struct {
- Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
- Services []*DelServicesRspInfo `protobuf:"bytes,2,rep,name=services" json:"services,omitempty"`
-}
-
-func (m *DelServicesResponse) Reset() { *m = DelServicesResponse{} }
-func (m *DelServicesResponse) String() string { return proto1.CompactTextString(m) }
-func (*DelServicesResponse) ProtoMessage() {}
-func (*DelServicesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{90} }
-
-func (m *DelServicesResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-func (m *DelServicesResponse) GetServices() []*DelServicesRspInfo {
- if m != nil {
- return m.Services
- }
- return nil
-}
-
-type GetAppsRequest struct {
- Environment string `protobuf:"bytes,1,opt,name=environment" json:"environment,omitempty"`
- WithShared bool `protobuf:"varint,2,opt,name=withShared" json:"withShared,omitempty"`
-}
-
-func (m *GetAppsRequest) Reset() { *m = GetAppsRequest{} }
-func (m *GetAppsRequest) String() string { return proto1.CompactTextString(m) }
-func (*GetAppsRequest) ProtoMessage() {}
-func (*GetAppsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{91} }
-
-func (m *GetAppsRequest) GetEnvironment() string {
- if m != nil {
- return m.Environment
- }
- return ""
-}
-
-func (m *GetAppsRequest) GetWithShared() bool {
- if m != nil {
- return m.WithShared
- }
- return false
-}
-
-type GetAppsResponse struct {
- Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
- AppIds []string `protobuf:"bytes,2,rep,name=appIds" json:"appIds,omitempty"`
-}
-
-func (m *GetAppsResponse) Reset() { *m = GetAppsResponse{} }
-func (m *GetAppsResponse) String() string { return proto1.CompactTextString(m) }
-func (*GetAppsResponse) ProtoMessage() {}
-func (*GetAppsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{92} }
-
-func (m *GetAppsResponse) GetResponse() *Response {
- if m != nil {
- return m.Response
- }
- return nil
-}
-
-func (m *GetAppsResponse) GetAppIds() []string {
- if m != nil {
- return m.AppIds
- }
- return nil
-}
-
-func init() {
- proto1.RegisterType((*ModifySchemasRequest)(nil), "proto.ModifySchemasRequest")
- proto1.RegisterType((*Schema)(nil), "proto.Schema")
- proto1.RegisterType((*ModifySchemasResponse)(nil), "proto.ModifySchemasResponse")
- proto1.RegisterType((*HeartbeatSetRequest)(nil), "proto.HeartbeatSetRequest")
- proto1.RegisterType((*HeartbeatSetElement)(nil), "proto.HeartbeatSetElement")
- proto1.RegisterType((*HeartbeatSetResponse)(nil), "proto.HeartbeatSetResponse")
- proto1.RegisterType((*InstanceHbRst)(nil), "proto.InstanceHbRst")
- proto1.RegisterType((*StService)(nil), "proto.StService")
- proto1.RegisterType((*StInstance)(nil), "proto.StInstance")
- proto1.RegisterType((*StApp)(nil), "proto.StApp")
- proto1.RegisterType((*Statistics)(nil), "proto.Statistics")
- proto1.RegisterType((*GetServicesInfoRequest)(nil), "proto.GetServicesInfoRequest")
- proto1.RegisterType((*GetServicesInfoResponse)(nil), "proto.GetServicesInfoResponse")
- proto1.RegisterType((*MicroServiceKey)(nil), "proto.MicroServiceKey")
- proto1.RegisterType((*MicroService)(nil), "proto.MicroService")
- proto1.RegisterType((*FrameWorkProperty)(nil), "proto.FrameWorkProperty")
- proto1.RegisterType((*ServiceRule)(nil), "proto.ServiceRule")
- proto1.RegisterType((*AddOrUpdateServiceRule)(nil), "proto.AddOrUpdateServiceRule")
- proto1.RegisterType((*ServicePath)(nil), "proto.ServicePath")
- proto1.RegisterType((*Response)(nil), "proto.Response")
- proto1.RegisterType((*GetExistenceRequest)(nil), "proto.GetExistenceRequest")
- proto1.RegisterType((*GetExistenceResponse)(nil), "proto.GetExistenceResponse")
- proto1.RegisterType((*CreateServiceRequest)(nil), "proto.CreateServiceRequest")
- proto1.RegisterType((*CreateServiceResponse)(nil), "proto.CreateServiceResponse")
- proto1.RegisterType((*DeleteServiceRequest)(nil), "proto.DeleteServiceRequest")
- proto1.RegisterType((*DeleteServiceResponse)(nil), "proto.DeleteServiceResponse")
- proto1.RegisterType((*GetServiceRequest)(nil), "proto.GetServiceRequest")
- proto1.RegisterType((*GetServiceResponse)(nil), "proto.GetServiceResponse")
- proto1.RegisterType((*GetServicesRequest)(nil), "proto.GetServicesRequest")
- proto1.RegisterType((*GetServicesResponse)(nil), "proto.GetServicesResponse")
- proto1.RegisterType((*UpdateServicePropsRequest)(nil), "proto.UpdateServicePropsRequest")
- proto1.RegisterType((*UpdateServicePropsResponse)(nil), "proto.UpdateServicePropsResponse")
- proto1.RegisterType((*GetServiceRulesRequest)(nil), "proto.GetServiceRulesRequest")
- proto1.RegisterType((*GetServiceRulesResponse)(nil), "proto.GetServiceRulesResponse")
- proto1.RegisterType((*UpdateServiceRuleRequest)(nil), "proto.UpdateServiceRuleRequest")
- proto1.RegisterType((*UpdateServiceRuleResponse)(nil), "proto.UpdateServiceRuleResponse")
- proto1.RegisterType((*AddServiceRulesRequest)(nil), "proto.AddServiceRulesRequest")
- proto1.RegisterType((*AddServiceRulesResponse)(nil), "proto.AddServiceRulesResponse")
- proto1.RegisterType((*DeleteServiceRulesRequest)(nil), "proto.DeleteServiceRulesRequest")
- proto1.RegisterType((*DeleteServiceRulesResponse)(nil), "proto.DeleteServiceRulesResponse")
- proto1.RegisterType((*GetServiceTagsRequest)(nil), "proto.GetServiceTagsRequest")
- proto1.RegisterType((*GetServiceTagsResponse)(nil), "proto.GetServiceTagsResponse")
- proto1.RegisterType((*UpdateServiceTagRequest)(nil), "proto.UpdateServiceTagRequest")
- proto1.RegisterType((*UpdateServiceTagResponse)(nil), "proto.UpdateServiceTagResponse")
- proto1.RegisterType((*AddServiceTagsRequest)(nil), "proto.AddServiceTagsRequest")
- proto1.RegisterType((*AddServiceTagsResponse)(nil), "proto.AddServiceTagsResponse")
- proto1.RegisterType((*DeleteServiceTagsRequest)(nil), "proto.DeleteServiceTagsRequest")
- proto1.RegisterType((*DeleteServiceTagsResponse)(nil), "proto.DeleteServiceTagsResponse")
- proto1.RegisterType((*HealthCheck)(nil), "proto.HealthCheck")
- proto1.RegisterType((*MicroServiceInstance)(nil), "proto.MicroServiceInstance")
- proto1.RegisterType((*DataCenterInfo)(nil), "proto.DataCenterInfo")
- proto1.RegisterType((*MicroServiceInstanceKey)(nil), "proto.MicroServiceInstanceKey")
- proto1.RegisterType((*RegisterInstanceRequest)(nil), "proto.RegisterInstanceRequest")
- proto1.RegisterType((*RegisterInstanceResponse)(nil), "proto.RegisterInstanceResponse")
- proto1.RegisterType((*UnregisterInstanceRequest)(nil), "proto.UnregisterInstanceRequest")
- proto1.RegisterType((*UnregisterInstanceResponse)(nil), "proto.UnregisterInstanceResponse")
- proto1.RegisterType((*HeartbeatRequest)(nil), "proto.HeartbeatRequest")
- proto1.RegisterType((*HeartbeatResponse)(nil), "proto.HeartbeatResponse")
- proto1.RegisterType((*FindInstancesRequest)(nil), "proto.FindInstancesRequest")
- proto1.RegisterType((*FindInstancesResponse)(nil), "proto.FindInstancesResponse")
- proto1.RegisterType((*GetOneInstanceRequest)(nil), "proto.GetOneInstanceRequest")
- proto1.RegisterType((*GetOneInstanceResponse)(nil), "proto.GetOneInstanceResponse")
- proto1.RegisterType((*GetInstancesRequest)(nil), "proto.GetInstancesRequest")
- proto1.RegisterType((*GetInstancesResponse)(nil), "proto.GetInstancesResponse")
- proto1.RegisterType((*UpdateInstanceStatusRequest)(nil), "proto.UpdateInstanceStatusRequest")
- proto1.RegisterType((*UpdateInstanceStatusResponse)(nil), "proto.UpdateInstanceStatusResponse")
- proto1.RegisterType((*UpdateInstancePropsRequest)(nil), "proto.UpdateInstancePropsRequest")
- proto1.RegisterType((*UpdateInstancePropsResponse)(nil), "proto.UpdateInstancePropsResponse")
- proto1.RegisterType((*WatchInstanceRequest)(nil), "proto.WatchInstanceRequest")
- proto1.RegisterType((*WatchInstanceResponse)(nil), "proto.WatchInstanceResponse")
- proto1.RegisterType((*GetSchemaRequest)(nil), "proto.GetSchemaRequest")
- proto1.RegisterType((*GetAllSchemaRequest)(nil), "proto.GetAllSchemaRequest")
- proto1.RegisterType((*GetSchemaResponse)(nil), "proto.GetSchemaResponse")
- proto1.RegisterType((*GetAllSchemaResponse)(nil), "proto.GetAllSchemaResponse")
- proto1.RegisterType((*DeleteSchemaRequest)(nil), "proto.DeleteSchemaRequest")
- proto1.RegisterType((*DeleteSchemaResponse)(nil), "proto.DeleteSchemaResponse")
- proto1.RegisterType((*ModifySchemaRequest)(nil), "proto.ModifySchemaRequest")
- proto1.RegisterType((*ModifySchemaResponse)(nil), "proto.ModifySchemaResponse")
- proto1.RegisterType((*AddDependenciesRequest)(nil), "proto.AddDependenciesRequest")
- proto1.RegisterType((*AddDependenciesResponse)(nil), "proto.AddDependenciesResponse")
- proto1.RegisterType((*CreateDependenciesRequest)(nil), "proto.CreateDependenciesRequest")
- proto1.RegisterType((*ConsumerDependency)(nil), "proto.ConsumerDependency")
- proto1.RegisterType((*CreateDependenciesResponse)(nil), "proto.CreateDependenciesResponse")
- proto1.RegisterType((*GetDependenciesRequest)(nil), "proto.GetDependenciesRequest")
- proto1.RegisterType((*GetConDependenciesResponse)(nil), "proto.GetConDependenciesResponse")
- proto1.RegisterType((*GetProDependenciesResponse)(nil), "proto.GetProDependenciesResponse")
- proto1.RegisterType((*ServiceDetail)(nil), "proto.ServiceDetail")
- proto1.RegisterType((*GetServiceDetailResponse)(nil), "proto.GetServiceDetailResponse")
- proto1.RegisterType((*DelServicesRequest)(nil), "proto.DelServicesRequest")
- proto1.RegisterType((*DelServicesRspInfo)(nil), "proto.DelServicesRspInfo")
- proto1.RegisterType((*DelServicesResponse)(nil), "proto.DelServicesResponse")
- proto1.RegisterType((*GetAppsRequest)(nil), "proto.GetAppsRequest")
- proto1.RegisterType((*GetAppsResponse)(nil), "proto.GetAppsResponse")
-}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ context.Context
-var _ grpc.ClientConn
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion4
-
-// Client API for ServiceCtrl service
-
-type ServiceCtrlClient interface {
- Exist(ctx context.Context, in *GetExistenceRequest, opts ...grpc.CallOption) (*GetExistenceResponse, error)
- Create(ctx context.Context, in *CreateServiceRequest, opts ...grpc.CallOption) (*CreateServiceResponse, error)
- Delete(ctx context.Context, in *DeleteServiceRequest, opts ...grpc.CallOption) (*DeleteServiceResponse, error)
- GetOne(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*GetServiceResponse, error)
- GetServices(ctx context.Context, in *GetServicesRequest, opts ...grpc.CallOption) (*GetServicesResponse, error)
- UpdateProperties(ctx context.Context, in *UpdateServicePropsRequest, opts ...grpc.CallOption) (*UpdateServicePropsResponse, error)
- AddRule(ctx context.Context, in *AddServiceRulesRequest, opts ...grpc.CallOption) (*AddServiceRulesResponse, error)
- GetRule(ctx context.Context, in *GetServiceRulesRequest, opts ...grpc.CallOption) (*GetServiceRulesResponse, error)
- UpdateRule(ctx context.Context, in *UpdateServiceRuleRequest, opts ...grpc.CallOption) (*UpdateServiceRuleResponse, error)
- DeleteRule(ctx context.Context, in *DeleteServiceRulesRequest, opts ...grpc.CallOption) (*DeleteServiceRulesResponse, error)
- AddTags(ctx context.Context, in *AddServiceTagsRequest, opts ...grpc.CallOption) (*AddServiceTagsResponse, error)
- GetTags(ctx context.Context, in *GetServiceTagsRequest, opts ...grpc.CallOption) (*GetServiceTagsResponse, error)
- UpdateTag(ctx context.Context, in *UpdateServiceTagRequest, opts ...grpc.CallOption) (*UpdateServiceTagResponse, error)
- DeleteTags(ctx context.Context, in *DeleteServiceTagsRequest, opts ...grpc.CallOption) (*DeleteServiceTagsResponse, error)
- GetSchemaInfo(ctx context.Context, in *GetSchemaRequest, opts ...grpc.CallOption) (*GetSchemaResponse, error)
- GetAllSchemaInfo(ctx context.Context, in *GetAllSchemaRequest, opts ...grpc.CallOption) (*GetAllSchemaResponse, error)
- DeleteSchema(ctx context.Context, in *DeleteSchemaRequest, opts ...grpc.CallOption) (*DeleteSchemaResponse, error)
- ModifySchema(ctx context.Context, in *ModifySchemaRequest, opts ...grpc.CallOption) (*ModifySchemaResponse, error)
- ModifySchemas(ctx context.Context, in *ModifySchemasRequest, opts ...grpc.CallOption) (*ModifySchemasResponse, error)
- AddDependenciesForMicroServices(ctx context.Context, in *AddDependenciesRequest, opts ...grpc.CallOption) (*AddDependenciesResponse, error)
- CreateDependenciesForMicroServices(ctx context.Context, in *CreateDependenciesRequest, opts ...grpc.CallOption) (*CreateDependenciesResponse, error)
- GetProviderDependencies(ctx context.Context, in *GetDependenciesRequest, opts ...grpc.CallOption) (*GetProDependenciesResponse, error)
- GetConsumerDependencies(ctx context.Context, in *GetDependenciesRequest, opts ...grpc.CallOption) (*GetConDependenciesResponse, error)
- DeleteServices(ctx context.Context, in *DelServicesRequest, opts ...grpc.CallOption) (*DelServicesResponse, error)
-}
-
-type serviceCtrlClient struct {
- cc *grpc.ClientConn
-}
-
-func NewServiceCtrlClient(cc *grpc.ClientConn) ServiceCtrlClient {
- return &serviceCtrlClient{cc}
-}
-
-func (c *serviceCtrlClient) Exist(ctx context.Context, in *GetExistenceRequest, opts ...grpc.CallOption) (*GetExistenceResponse, error) {
- out := new(GetExistenceResponse)
- err := grpc.Invoke(ctx, "/proto.ServiceCtrl/exist", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceCtrlClient) Create(ctx context.Context, in *CreateServiceRequest, opts ...grpc.CallOption) (*CreateServiceResponse, error) {
- out := new(CreateServiceResponse)
- err := grpc.Invoke(ctx, "/proto.ServiceCtrl/create", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceCtrlClient) Delete(ctx context.Context, in *DeleteServiceRequest, opts ...grpc.CallOption) (*DeleteServiceResponse, error) {
- out := new(DeleteServiceResponse)
- err := grpc.Invoke(ctx, "/proto.ServiceCtrl/delete", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceCtrlClient) GetOne(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*GetServiceResponse, error) {
- out := new(GetServiceResponse)
- err := grpc.Invoke(ctx, "/proto.ServiceCtrl/getOne", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceCtrlClient) GetServices(ctx context.Context, in *GetServicesRequest, opts ...grpc.CallOption) (*GetServicesResponse, error) {
- out := new(GetServicesResponse)
- err := grpc.Invoke(ctx, "/proto.ServiceCtrl/getServices", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceCtrlClient) UpdateProperties(ctx context.Context, in *UpdateServicePropsRequest, opts ...grpc.CallOption) (*UpdateServicePropsResponse, error) {
- out := new(UpdateServicePropsResponse)
- err := grpc.Invoke(ctx, "/proto.ServiceCtrl/updateProperties", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceCtrlClient) AddRule(ctx context.Context, in *AddServiceRulesRequest, opts ...grpc.CallOption) (*AddServiceRulesResponse, error) {
- out := new(AddServiceRulesResponse)
- err := grpc.Invoke(ctx, "/proto.ServiceCtrl/addRule", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceCtrlClient) GetRule(ctx context.Context, in *GetServiceRulesRequest, opts ...grpc.CallOption) (*GetServiceRulesResponse, error) {
- out := new(GetServiceRulesResponse)
- err := grpc.Invoke(ctx, "/proto.ServiceCtrl/getRule", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceCtrlClient) UpdateRule(ctx context.Context, in *UpdateServiceRuleRequest, opts ...grpc.CallOption) (*UpdateServiceRuleResponse, error) {
- out := new(UpdateServiceRuleResponse)
- err := grpc.Invoke(ctx, "/proto.ServiceCtrl/updateRule", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceCtrlClient) DeleteRule(ctx context.Context, in *DeleteServiceRulesRequest, opts ...grpc.CallOption) (*DeleteServiceRulesResponse, error) {
- out := new(DeleteServiceRulesResponse)
- err := grpc.Invoke(ctx, "/proto.ServiceCtrl/deleteRule", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceCtrlClient) AddTags(ctx context.Context, in *AddServiceTagsRequest, opts ...grpc.CallOption) (*AddServiceTagsResponse, error) {
- out := new(AddServiceTagsResponse)
- err := grpc.Invoke(ctx, "/proto.ServiceCtrl/addTags", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceCtrlClient) GetTags(ctx context.Context, in *GetServiceTagsRequest, opts ...grpc.CallOption) (*GetServiceTagsResponse, error) {
- out := new(GetServiceTagsResponse)
- err := grpc.Invoke(ctx, "/proto.ServiceCtrl/getTags", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceCtrlClient) UpdateTag(ctx context.Context, in *UpdateServiceTagRequest, opts ...grpc.CallOption) (*UpdateServiceTagResponse, error) {
- out := new(UpdateServiceTagResponse)
- err := grpc.Invoke(ctx, "/proto.ServiceCtrl/updateTag", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceCtrlClient) DeleteTags(ctx context.Context, in *DeleteServiceTagsRequest, opts ...grpc.CallOption) (*DeleteServiceTagsResponse, error) {
- out := new(DeleteServiceTagsResponse)
- err := grpc.Invoke(ctx, "/proto.ServiceCtrl/deleteTags", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceCtrlClient) GetSchemaInfo(ctx context.Context, in *GetSchemaRequest, opts ...grpc.CallOption) (*GetSchemaResponse, error) {
- out := new(GetSchemaResponse)
- err := grpc.Invoke(ctx, "/proto.ServiceCtrl/getSchemaInfo", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceCtrlClient) GetAllSchemaInfo(ctx context.Context, in *GetAllSchemaRequest, opts ...grpc.CallOption) (*GetAllSchemaResponse, error) {
- out := new(GetAllSchemaResponse)
- err := grpc.Invoke(ctx, "/proto.ServiceCtrl/getAllSchemaInfo", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
+type CreateServiceRequest struct {
+ Service *MicroService `protobuf:"bytes,1,opt,name=service" json:"service,omitempty"`
+ Rules []*AddOrUpdateServiceRule `protobuf:"bytes,2,rep,name=rules" json:"rules,omitempty"`
+ Tags map[string]string `protobuf:"bytes,3,rep,name=tags" json:"tags,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
+ Instances []*MicroServiceInstance `protobuf:"bytes,4,rep,name=instances" json:"instances,omitempty"`
}
-func (c *serviceCtrlClient) DeleteSchema(ctx context.Context, in *DeleteSchemaRequest, opts ...grpc.CallOption) (*DeleteSchemaResponse, error) {
- out := new(DeleteSchemaResponse)
- err := grpc.Invoke(ctx, "/proto.ServiceCtrl/deleteSchema", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
+type CreateServiceResponse struct {
+ Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
+ ServiceId string `protobuf:"bytes,2,opt,name=serviceId" json:"serviceId,omitempty"`
}
-func (c *serviceCtrlClient) ModifySchema(ctx context.Context, in *ModifySchemaRequest, opts ...grpc.CallOption) (*ModifySchemaResponse, error) {
- out := new(ModifySchemaResponse)
- err := grpc.Invoke(ctx, "/proto.ServiceCtrl/modifySchema", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
+type DeleteServiceRequest struct {
+ ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
+ Force bool `protobuf:"varint,2,opt,name=force" json:"force,omitempty"`
}
-func (c *serviceCtrlClient) ModifySchemas(ctx context.Context, in *ModifySchemasRequest, opts ...grpc.CallOption) (*ModifySchemasResponse, error) {
- out := new(ModifySchemasResponse)
- err := grpc.Invoke(ctx, "/proto.ServiceCtrl/modifySchemas", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
+type DeleteServiceResponse struct {
+ Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
}
-func (c *serviceCtrlClient) AddDependenciesForMicroServices(ctx context.Context, in *AddDependenciesRequest, opts ...grpc.CallOption) (*AddDependenciesResponse, error) {
- out := new(AddDependenciesResponse)
- err := grpc.Invoke(ctx, "/proto.ServiceCtrl/addDependenciesForMicroServices", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
+type GetServiceRequest struct {
+ ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
}
-func (c *serviceCtrlClient) CreateDependenciesForMicroServices(ctx context.Context, in *CreateDependenciesRequest, opts ...grpc.CallOption) (*CreateDependenciesResponse, error) {
- out := new(CreateDependenciesResponse)
- err := grpc.Invoke(ctx, "/proto.ServiceCtrl/createDependenciesForMicroServices", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
+type GetServiceResponse struct {
+ Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
+ Service *MicroService `protobuf:"bytes,2,opt,name=service" json:"service,omitempty"`
}
-func (c *serviceCtrlClient) GetProviderDependencies(ctx context.Context, in *GetDependenciesRequest, opts ...grpc.CallOption) (*GetProDependenciesResponse, error) {
- out := new(GetProDependenciesResponse)
- err := grpc.Invoke(ctx, "/proto.ServiceCtrl/getProviderDependencies", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
+type GetServicesRequest struct {
}
-func (c *serviceCtrlClient) GetConsumerDependencies(ctx context.Context, in *GetDependenciesRequest, opts ...grpc.CallOption) (*GetConDependenciesResponse, error) {
- out := new(GetConDependenciesResponse)
- err := grpc.Invoke(ctx, "/proto.ServiceCtrl/getConsumerDependencies", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
+type GetServicesResponse struct {
+ Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
+ Services []*MicroService `protobuf:"bytes,2,rep,name=services" json:"services,omitempty"`
}
-func (c *serviceCtrlClient) DeleteServices(ctx context.Context, in *DelServicesRequest, opts ...grpc.CallOption) (*DelServicesResponse, error) {
- out := new(DelServicesResponse)
- err := grpc.Invoke(ctx, "/proto.ServiceCtrl/deleteServices", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
+type UpdateServicePropsRequest struct {
+ ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
+ Properties map[string]string `protobuf:"bytes,2,rep,name=properties" json:"properties,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
}
-// Server API for ServiceCtrl service
-
-type ServiceCtrlServer interface {
- Exist(context.Context, *GetExistenceRequest) (*GetExistenceResponse, error)
- Create(context.Context, *CreateServiceRequest) (*CreateServiceResponse, error)
- Delete(context.Context, *DeleteServiceRequest) (*DeleteServiceResponse, error)
- GetOne(context.Context, *GetServiceRequest) (*GetServiceResponse, error)
- GetServices(context.Context, *GetServicesRequest) (*GetServicesResponse, error)
- UpdateProperties(context.Context, *UpdateServicePropsRequest) (*UpdateServicePropsResponse, error)
- AddRule(context.Context, *AddServiceRulesRequest) (*AddServiceRulesResponse, error)
- GetRule(context.Context, *GetServiceRulesRequest) (*GetServiceRulesResponse, error)
- UpdateRule(context.Context, *UpdateServiceRuleRequest) (*UpdateServiceRuleResponse, error)
- DeleteRule(context.Context, *DeleteServiceRulesRequest) (*DeleteServiceRulesResponse, error)
- AddTags(context.Context, *AddServiceTagsRequest) (*AddServiceTagsResponse, error)
- GetTags(context.Context, *GetServiceTagsRequest) (*GetServiceTagsResponse, error)
- UpdateTag(context.Context, *UpdateServiceTagRequest) (*UpdateServiceTagResponse, error)
- DeleteTags(context.Context, *DeleteServiceTagsRequest) (*DeleteServiceTagsResponse, error)
- GetSchemaInfo(context.Context, *GetSchemaRequest) (*GetSchemaResponse, error)
- GetAllSchemaInfo(context.Context, *GetAllSchemaRequest) (*GetAllSchemaResponse, error)
- DeleteSchema(context.Context, *DeleteSchemaRequest) (*DeleteSchemaResponse, error)
- ModifySchema(context.Context, *ModifySchemaRequest) (*ModifySchemaResponse, error)
- ModifySchemas(context.Context, *ModifySchemasRequest) (*ModifySchemasResponse, error)
- AddDependenciesForMicroServices(context.Context, *AddDependenciesRequest) (*AddDependenciesResponse, error)
- CreateDependenciesForMicroServices(context.Context, *CreateDependenciesRequest) (*CreateDependenciesResponse, error)
- GetProviderDependencies(context.Context, *GetDependenciesRequest) (*GetProDependenciesResponse, error)
- GetConsumerDependencies(context.Context, *GetDependenciesRequest) (*GetConDependenciesResponse, error)
- DeleteServices(context.Context, *DelServicesRequest) (*DelServicesResponse, error)
+type UpdateServicePropsResponse struct {
+ Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
}
-func RegisterServiceCtrlServer(s *grpc.Server, srv ServiceCtrlServer) {
- s.RegisterService(&_ServiceCtrl_serviceDesc, srv)
+type GetServiceRulesRequest struct {
+ ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
}
-func _ServiceCtrl_Exist_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(GetExistenceRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ServiceCtrlServer).Exist(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.ServiceCtrl/Exist",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ServiceCtrlServer).Exist(ctx, req.(*GetExistenceRequest))
- }
- return interceptor(ctx, in, info, handler)
+type GetServiceRulesResponse struct {
+ Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
+ Rules []*ServiceRule `protobuf:"bytes,2,rep,name=rules" json:"rules,omitempty"`
}
-func _ServiceCtrl_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(CreateServiceRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ServiceCtrlServer).Create(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.ServiceCtrl/Create",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ServiceCtrlServer).Create(ctx, req.(*CreateServiceRequest))
- }
- return interceptor(ctx, in, info, handler)
+type UpdateServiceRuleRequest struct {
+ ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
+ RuleId string `protobuf:"bytes,2,opt,name=ruleId" json:"ruleId,omitempty"`
+ Rule *AddOrUpdateServiceRule `protobuf:"bytes,3,opt,name=rule" json:"rule,omitempty"`
}
-func _ServiceCtrl_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(DeleteServiceRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ServiceCtrlServer).Delete(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.ServiceCtrl/Delete",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ServiceCtrlServer).Delete(ctx, req.(*DeleteServiceRequest))
- }
- return interceptor(ctx, in, info, handler)
+type UpdateServiceRuleResponse struct {
+ Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
}
-func _ServiceCtrl_GetOne_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(GetServiceRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ServiceCtrlServer).GetOne(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.ServiceCtrl/GetOne",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ServiceCtrlServer).GetOne(ctx, req.(*GetServiceRequest))
- }
- return interceptor(ctx, in, info, handler)
+type AddServiceRulesRequest struct {
+ ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
+ Rules []*AddOrUpdateServiceRule `protobuf:"bytes,2,rep,name=rules" json:"rules,omitempty"`
}
-func _ServiceCtrl_GetServices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(GetServicesRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ServiceCtrlServer).GetServices(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.ServiceCtrl/GetServices",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ServiceCtrlServer).GetServices(ctx, req.(*GetServicesRequest))
- }
- return interceptor(ctx, in, info, handler)
+type AddServiceRulesResponse struct {
+ Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
+ RuleIds []string `protobuf:"bytes,2,rep,name=RuleIds" json:"RuleIds,omitempty"`
}
-func _ServiceCtrl_UpdateProperties_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(UpdateServicePropsRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ServiceCtrlServer).UpdateProperties(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.ServiceCtrl/UpdateProperties",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ServiceCtrlServer).UpdateProperties(ctx, req.(*UpdateServicePropsRequest))
- }
- return interceptor(ctx, in, info, handler)
+type DeleteServiceRulesRequest struct {
+ ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
+ RuleIds []string `protobuf:"bytes,2,rep,name=ruleIds" json:"ruleIds,omitempty"`
}
-func _ServiceCtrl_AddRule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(AddServiceRulesRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ServiceCtrlServer).AddRule(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.ServiceCtrl/AddRule",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ServiceCtrlServer).AddRule(ctx, req.(*AddServiceRulesRequest))
- }
- return interceptor(ctx, in, info, handler)
+type DeleteServiceRulesResponse struct {
+ Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
}
-func _ServiceCtrl_GetRule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(GetServiceRulesRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ServiceCtrlServer).GetRule(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.ServiceCtrl/GetRule",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ServiceCtrlServer).GetRule(ctx, req.(*GetServiceRulesRequest))
- }
- return interceptor(ctx, in, info, handler)
+type GetServiceTagsRequest struct {
+ ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
}
-func _ServiceCtrl_UpdateRule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(UpdateServiceRuleRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ServiceCtrlServer).UpdateRule(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.ServiceCtrl/UpdateRule",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ServiceCtrlServer).UpdateRule(ctx, req.(*UpdateServiceRuleRequest))
- }
- return interceptor(ctx, in, info, handler)
+type GetServiceTagsResponse struct {
+ Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
+ Tags map[string]string `protobuf:"bytes,2,rep,name=tags" json:"tags,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
}
-func _ServiceCtrl_DeleteRule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(DeleteServiceRulesRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ServiceCtrlServer).DeleteRule(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.ServiceCtrl/DeleteRule",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ServiceCtrlServer).DeleteRule(ctx, req.(*DeleteServiceRulesRequest))
- }
- return interceptor(ctx, in, info, handler)
+type UpdateServiceTagRequest struct {
+ ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
+ Key string `protobuf:"bytes,2,opt,name=key" json:"key,omitempty"`
+ Value string `protobuf:"bytes,3,opt,name=value" json:"value,omitempty"`
}
-func _ServiceCtrl_AddTags_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(AddServiceTagsRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ServiceCtrlServer).AddTags(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.ServiceCtrl/AddTags",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ServiceCtrlServer).AddTags(ctx, req.(*AddServiceTagsRequest))
- }
- return interceptor(ctx, in, info, handler)
+type UpdateServiceTagResponse struct {
+ Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
}
-func _ServiceCtrl_GetTags_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(GetServiceTagsRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ServiceCtrlServer).GetTags(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.ServiceCtrl/GetTags",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ServiceCtrlServer).GetTags(ctx, req.(*GetServiceTagsRequest))
- }
- return interceptor(ctx, in, info, handler)
+type AddServiceTagsRequest struct {
+ ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
+ Tags map[string]string `protobuf:"bytes,2,rep,name=tags" json:"tags,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
}
-func _ServiceCtrl_UpdateTag_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(UpdateServiceTagRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ServiceCtrlServer).UpdateTag(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.ServiceCtrl/UpdateTag",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ServiceCtrlServer).UpdateTag(ctx, req.(*UpdateServiceTagRequest))
- }
- return interceptor(ctx, in, info, handler)
+type AddServiceTagsResponse struct {
+ Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
}
-func _ServiceCtrl_DeleteTags_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(DeleteServiceTagsRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ServiceCtrlServer).DeleteTags(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.ServiceCtrl/DeleteTags",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ServiceCtrlServer).DeleteTags(ctx, req.(*DeleteServiceTagsRequest))
- }
- return interceptor(ctx, in, info, handler)
+type DeleteServiceTagsRequest struct {
+ ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
+ Keys []string `protobuf:"bytes,2,rep,name=keys" json:"keys,omitempty"`
}
-func _ServiceCtrl_GetSchemaInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(GetSchemaRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ServiceCtrlServer).GetSchemaInfo(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.ServiceCtrl/GetSchemaInfo",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ServiceCtrlServer).GetSchemaInfo(ctx, req.(*GetSchemaRequest))
- }
- return interceptor(ctx, in, info, handler)
+type DeleteServiceTagsResponse struct {
+ Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
}
-func _ServiceCtrl_GetAllSchemaInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(GetAllSchemaRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ServiceCtrlServer).GetAllSchemaInfo(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.ServiceCtrl/GetAllSchemaInfo",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ServiceCtrlServer).GetAllSchemaInfo(ctx, req.(*GetAllSchemaRequest))
- }
- return interceptor(ctx, in, info, handler)
+type HealthCheck struct {
+ Mode string `protobuf:"bytes,1,opt,name=mode" json:"mode,omitempty"`
+ Port int32 `protobuf:"varint,2,opt,name=port" json:"port,omitempty"`
+ Interval int32 `protobuf:"varint,3,opt,name=interval" json:"interval,omitempty"`
+ Times int32 `protobuf:"varint,4,opt,name=times" json:"times,omitempty"`
+ Url string `protobuf:"bytes,5,opt,name=url" json:"url,omitempty"`
}
-func _ServiceCtrl_DeleteSchema_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(DeleteSchemaRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ServiceCtrlServer).DeleteSchema(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.ServiceCtrl/DeleteSchema",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ServiceCtrlServer).DeleteSchema(ctx, req.(*DeleteSchemaRequest))
- }
- return interceptor(ctx, in, info, handler)
+type MicroServiceInstance struct {
+ InstanceId string `protobuf:"bytes,1,opt,name=instanceId" json:"instanceId,omitempty"`
+ ServiceId string `protobuf:"bytes,2,opt,name=serviceId" json:"serviceId,omitempty"`
+ Endpoints []string `protobuf:"bytes,3,rep,name=endpoints" json:"endpoints,omitempty"`
+ HostName string `protobuf:"bytes,4,opt,name=hostName" json:"hostName,omitempty"`
+ Status string `protobuf:"bytes,5,opt,name=status" json:"status,omitempty"`
+ Properties map[string]string `protobuf:"bytes,6,rep,name=properties" json:"properties,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
+ HealthCheck *HealthCheck `protobuf:"bytes,7,opt,name=healthCheck" json:"healthCheck,omitempty"`
+ Timestamp string `protobuf:"bytes,8,opt,name=timestamp" json:"timestamp,omitempty"`
+ DataCenterInfo *DataCenterInfo `protobuf:"bytes,9,opt,name=dataCenterInfo" json:"dataCenterInfo,omitempty"`
+ ModTimestamp string `protobuf:"bytes,10,opt,name=modTimestamp" json:"modTimestamp,omitempty"`
+ Version string `protobuf:"bytes,11,opt,name=version" json:"version,omitempty"`
}
-func _ServiceCtrl_ModifySchema_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(ModifySchemaRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ServiceCtrlServer).ModifySchema(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.ServiceCtrl/ModifySchema",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ServiceCtrlServer).ModifySchema(ctx, req.(*ModifySchemaRequest))
- }
- return interceptor(ctx, in, info, handler)
+type DataCenterInfo struct {
+ Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
+ Region string `protobuf:"bytes,2,opt,name=region" json:"region,omitempty"`
+ AvailableZone string `protobuf:"bytes,3,opt,name=availableZone" json:"availableZone,omitempty"`
}
-func _ServiceCtrl_ModifySchemas_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(ModifySchemasRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ServiceCtrlServer).ModifySchemas(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.ServiceCtrl/ModifySchemas",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ServiceCtrlServer).ModifySchemas(ctx, req.(*ModifySchemasRequest))
- }
- return interceptor(ctx, in, info, handler)
+type MicroServiceInstanceKey struct {
+ InstanceId string `protobuf:"bytes,1,opt,name=instanceId" json:"instanceId,omitempty"`
+ ServiceId string `protobuf:"bytes,2,opt,name=serviceId" json:"serviceId,omitempty"`
}
-func _ServiceCtrl_AddDependenciesForMicroServices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(AddDependenciesRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ServiceCtrlServer).AddDependenciesForMicroServices(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.ServiceCtrl/AddDependenciesForMicroServices",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ServiceCtrlServer).AddDependenciesForMicroServices(ctx, req.(*AddDependenciesRequest))
- }
- return interceptor(ctx, in, info, handler)
+type RegisterInstanceRequest struct {
+ Instance *MicroServiceInstance `protobuf:"bytes,1,opt,name=instance" json:"instance,omitempty"`
}
-func _ServiceCtrl_CreateDependenciesForMicroServices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(CreateDependenciesRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ServiceCtrlServer).CreateDependenciesForMicroServices(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.ServiceCtrl/CreateDependenciesForMicroServices",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ServiceCtrlServer).CreateDependenciesForMicroServices(ctx, req.(*CreateDependenciesRequest))
- }
- return interceptor(ctx, in, info, handler)
+type RegisterInstanceResponse struct {
+ Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
+ InstanceId string `protobuf:"bytes,2,opt,name=instanceId" json:"instanceId,omitempty"`
}
-func _ServiceCtrl_GetProviderDependencies_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(GetDependenciesRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ServiceCtrlServer).GetProviderDependencies(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.ServiceCtrl/GetProviderDependencies",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ServiceCtrlServer).GetProviderDependencies(ctx, req.(*GetDependenciesRequest))
- }
- return interceptor(ctx, in, info, handler)
+type UnregisterInstanceRequest struct {
+ ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
+ InstanceId string `protobuf:"bytes,2,opt,name=instanceId" json:"instanceId,omitempty"`
}
-func _ServiceCtrl_GetConsumerDependencies_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(GetDependenciesRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ServiceCtrlServer).GetConsumerDependencies(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.ServiceCtrl/GetConsumerDependencies",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ServiceCtrlServer).GetConsumerDependencies(ctx, req.(*GetDependenciesRequest))
- }
- return interceptor(ctx, in, info, handler)
+type UnregisterInstanceResponse struct {
+ Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
}
-func _ServiceCtrl_DeleteServices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(DelServicesRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ServiceCtrlServer).DeleteServices(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.ServiceCtrl/DeleteServices",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ServiceCtrlServer).DeleteServices(ctx, req.(*DelServicesRequest))
- }
- return interceptor(ctx, in, info, handler)
+type HeartbeatRequest struct {
+ ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
+ InstanceId string `protobuf:"bytes,2,opt,name=instanceId" json:"instanceId,omitempty"`
}
-var _ServiceCtrl_serviceDesc = grpc.ServiceDesc{
- ServiceName: "proto.ServiceCtrl",
- HandlerType: (*ServiceCtrlServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "exist",
- Handler: _ServiceCtrl_Exist_Handler,
- },
- {
- MethodName: "create",
- Handler: _ServiceCtrl_Create_Handler,
- },
- {
- MethodName: "delete",
- Handler: _ServiceCtrl_Delete_Handler,
- },
- {
- MethodName: "getOne",
- Handler: _ServiceCtrl_GetOne_Handler,
- },
- {
- MethodName: "getServices",
- Handler: _ServiceCtrl_GetServices_Handler,
- },
- {
- MethodName: "updateProperties",
- Handler: _ServiceCtrl_UpdateProperties_Handler,
- },
- {
- MethodName: "addRule",
- Handler: _ServiceCtrl_AddRule_Handler,
- },
- {
- MethodName: "getRule",
- Handler: _ServiceCtrl_GetRule_Handler,
- },
- {
- MethodName: "updateRule",
- Handler: _ServiceCtrl_UpdateRule_Handler,
- },
- {
- MethodName: "deleteRule",
- Handler: _ServiceCtrl_DeleteRule_Handler,
- },
- {
- MethodName: "addTags",
- Handler: _ServiceCtrl_AddTags_Handler,
- },
- {
- MethodName: "getTags",
- Handler: _ServiceCtrl_GetTags_Handler,
- },
- {
- MethodName: "updateTag",
- Handler: _ServiceCtrl_UpdateTag_Handler,
- },
- {
- MethodName: "deleteTags",
- Handler: _ServiceCtrl_DeleteTags_Handler,
- },
- {
- MethodName: "getSchemaInfo",
- Handler: _ServiceCtrl_GetSchemaInfo_Handler,
- },
- {
- MethodName: "getAllSchemaInfo",
- Handler: _ServiceCtrl_GetAllSchemaInfo_Handler,
- },
- {
- MethodName: "deleteSchema",
- Handler: _ServiceCtrl_DeleteSchema_Handler,
- },
- {
- MethodName: "modifySchema",
- Handler: _ServiceCtrl_ModifySchema_Handler,
- },
- {
- MethodName: "modifySchemas",
- Handler: _ServiceCtrl_ModifySchemas_Handler,
- },
- {
- MethodName: "addDependenciesForMicroServices",
- Handler: _ServiceCtrl_AddDependenciesForMicroServices_Handler,
- },
- {
- MethodName: "createDependenciesForMicroServices",
- Handler: _ServiceCtrl_CreateDependenciesForMicroServices_Handler,
- },
- {
- MethodName: "getProviderDependencies",
- Handler: _ServiceCtrl_GetProviderDependencies_Handler,
- },
- {
- MethodName: "getConsumerDependencies",
- Handler: _ServiceCtrl_GetConsumerDependencies_Handler,
- },
- {
- MethodName: "deleteServices",
- Handler: _ServiceCtrl_DeleteServices_Handler,
- },
- },
- Streams: []grpc.StreamDesc{},
- Metadata: "services.proto",
+type HeartbeatResponse struct {
+ Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
}
-// Client API for ServiceInstanceCtrl service
-
-type ServiceInstanceCtrlClient interface {
- Register(ctx context.Context, in *RegisterInstanceRequest, opts ...grpc.CallOption) (*RegisterInstanceResponse, error)
- Unregister(ctx context.Context, in *UnregisterInstanceRequest, opts ...grpc.CallOption) (*UnregisterInstanceResponse, error)
- Heartbeat(ctx context.Context, in *HeartbeatRequest, opts ...grpc.CallOption) (*HeartbeatResponse, error)
- Find(ctx context.Context, in *FindInstancesRequest, opts ...grpc.CallOption) (*FindInstancesResponse, error)
- GetInstances(ctx context.Context, in *GetInstancesRequest, opts ...grpc.CallOption) (*GetInstancesResponse, error)
- GetOneInstance(ctx context.Context, in *GetOneInstanceRequest, opts ...grpc.CallOption) (*GetOneInstanceResponse, error)
- UpdateStatus(ctx context.Context, in *UpdateInstanceStatusRequest, opts ...grpc.CallOption) (*UpdateInstanceStatusResponse, error)
- UpdateInstanceProperties(ctx context.Context, in *UpdateInstancePropsRequest, opts ...grpc.CallOption) (*UpdateInstancePropsResponse, error)
- Watch(ctx context.Context, in *WatchInstanceRequest, opts ...grpc.CallOption) (ServiceInstanceCtrl_WatchClient, error)
- HeartbeatSet(ctx context.Context, in *HeartbeatSetRequest, opts ...grpc.CallOption) (*HeartbeatSetResponse, error)
+type FindInstancesRequest struct {
+ ConsumerServiceId string `protobuf:"bytes,1,opt,name=consumerServiceId" json:"consumerServiceId,omitempty"`
+ AppId string `protobuf:"bytes,2,opt,name=appId" json:"appId,omitempty"`
+ ServiceName string `protobuf:"bytes,3,opt,name=serviceName" json:"serviceName,omitempty"`
+ VersionRule string `protobuf:"bytes,4,opt,name=versionRule" json:"versionRule,omitempty"`
+ Tags []string `protobuf:"bytes,5,rep,name=tags" json:"tags,omitempty"`
+ Environment string `protobuf:"bytes,6,opt,name=environment" json:"environment,omitempty"`
}
-type serviceInstanceCtrlClient struct {
- cc *grpc.ClientConn
+type FindInstancesResponse struct {
+ Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
+ Instances []*MicroServiceInstance `protobuf:"bytes,2,rep,name=instances" json:"instances,omitempty"`
}
-func NewServiceInstanceCtrlClient(cc *grpc.ClientConn) ServiceInstanceCtrlClient {
- return &serviceInstanceCtrlClient{cc}
+type GetOneInstanceRequest struct {
+ ConsumerServiceId string `protobuf:"bytes,1,opt,name=consumerServiceId" json:"consumerServiceId,omitempty"`
+ ProviderServiceId string `protobuf:"bytes,2,opt,name=providerServiceId" json:"providerServiceId,omitempty"`
+ ProviderInstanceId string `protobuf:"bytes,3,opt,name=providerInstanceId" json:"providerInstanceId,omitempty"`
+ Tags []string `protobuf:"bytes,4,rep,name=tags" json:"tags,omitempty"`
}
-func (c *serviceInstanceCtrlClient) Register(ctx context.Context, in *RegisterInstanceRequest, opts ...grpc.CallOption) (*RegisterInstanceResponse, error) {
- out := new(RegisterInstanceResponse)
- err := grpc.Invoke(ctx, "/proto.ServiceInstanceCtrl/register", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
+type GetOneInstanceResponse struct {
+ Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
+ Instance *MicroServiceInstance `protobuf:"bytes,2,opt,name=instance" json:"instance,omitempty"`
}
-func (c *serviceInstanceCtrlClient) Unregister(ctx context.Context, in *UnregisterInstanceRequest, opts ...grpc.CallOption) (*UnregisterInstanceResponse, error) {
- out := new(UnregisterInstanceResponse)
- err := grpc.Invoke(ctx, "/proto.ServiceInstanceCtrl/unregister", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
+type GetInstancesRequest struct {
+ ConsumerServiceId string `protobuf:"bytes,1,opt,name=consumerServiceId" json:"consumerServiceId,omitempty"`
+ ProviderServiceId string `protobuf:"bytes,2,opt,name=providerServiceId" json:"providerServiceId,omitempty"`
+ Tags []string `protobuf:"bytes,3,rep,name=tags" json:"tags,omitempty"`
}
-func (c *serviceInstanceCtrlClient) Heartbeat(ctx context.Context, in *HeartbeatRequest, opts ...grpc.CallOption) (*HeartbeatResponse, error) {
- out := new(HeartbeatResponse)
- err := grpc.Invoke(ctx, "/proto.ServiceInstanceCtrl/heartbeat", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
+type GetInstancesResponse struct {
+ Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
+ Instances []*MicroServiceInstance `protobuf:"bytes,2,rep,name=instances" json:"instances,omitempty"`
}
-func (c *serviceInstanceCtrlClient) Find(ctx context.Context, in *FindInstancesRequest, opts ...grpc.CallOption) (*FindInstancesResponse, error) {
- out := new(FindInstancesResponse)
- err := grpc.Invoke(ctx, "/proto.ServiceInstanceCtrl/find", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
+type UpdateInstanceStatusRequest struct {
+ ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
+ InstanceId string `protobuf:"bytes,2,opt,name=instanceId" json:"instanceId,omitempty"`
+ Status string `protobuf:"bytes,3,opt,name=status" json:"status,omitempty"`
}
-func (c *serviceInstanceCtrlClient) GetInstances(ctx context.Context, in *GetInstancesRequest, opts ...grpc.CallOption) (*GetInstancesResponse, error) {
- out := new(GetInstancesResponse)
- err := grpc.Invoke(ctx, "/proto.ServiceInstanceCtrl/getInstances", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
+type UpdateInstanceStatusResponse struct {
+ Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
}
-func (c *serviceInstanceCtrlClient) GetOneInstance(ctx context.Context, in *GetOneInstanceRequest, opts ...grpc.CallOption) (*GetOneInstanceResponse, error) {
- out := new(GetOneInstanceResponse)
- err := grpc.Invoke(ctx, "/proto.ServiceInstanceCtrl/getOneInstance", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
+type UpdateInstancePropsRequest struct {
+ ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
+ InstanceId string `protobuf:"bytes,2,opt,name=instanceId" json:"instanceId,omitempty"`
+ Properties map[string]string `protobuf:"bytes,3,rep,name=properties" json:"properties,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
}
-func (c *serviceInstanceCtrlClient) UpdateStatus(ctx context.Context, in *UpdateInstanceStatusRequest, opts ...grpc.CallOption) (*UpdateInstanceStatusResponse, error) {
- out := new(UpdateInstanceStatusResponse)
- err := grpc.Invoke(ctx, "/proto.ServiceInstanceCtrl/updateStatus", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
+type UpdateInstancePropsResponse struct {
+ Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
}
-func (c *serviceInstanceCtrlClient) UpdateInstanceProperties(ctx context.Context, in *UpdateInstancePropsRequest, opts ...grpc.CallOption) (*UpdateInstancePropsResponse, error) {
- out := new(UpdateInstancePropsResponse)
- err := grpc.Invoke(ctx, "/proto.ServiceInstanceCtrl/updateInstanceProperties", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
+type WatchInstanceRequest struct {
+ SelfServiceId string `protobuf:"bytes,1,opt,name=selfServiceId" json:"selfServiceId,omitempty"`
}
-func (c *serviceInstanceCtrlClient) Watch(ctx context.Context, in *WatchInstanceRequest, opts ...grpc.CallOption) (ServiceInstanceCtrl_WatchClient, error) {
- stream, err := grpc.NewClientStream(ctx, &_ServiceInstanceCtrl_serviceDesc.Streams[0], c.cc, "/proto.ServiceInstanceCtrl/watch", opts...)
- if err != nil {
- return nil, err
- }
- x := &serviceInstanceCtrlWatchClient{stream}
- if err := x.ClientStream.SendMsg(in); err != nil {
- return nil, err
- }
- if err := x.ClientStream.CloseSend(); err != nil {
- return nil, err
- }
- return x, nil
+type WatchInstanceResponse struct {
+ Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
+ Action string `protobuf:"bytes,2,opt,name=action" json:"action,omitempty"`
+ Key *MicroServiceKey `protobuf:"bytes,3,opt,name=key" json:"key,omitempty"`
+ Instance *MicroServiceInstance `protobuf:"bytes,4,opt,name=instance" json:"instance,omitempty"`
}
-type ServiceInstanceCtrl_WatchClient interface {
- Recv() (*WatchInstanceResponse, error)
- grpc.ClientStream
+type GetSchemaRequest struct {
+ ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
+ SchemaId string `protobuf:"bytes,2,opt,name=schemaId" json:"schemaId,omitempty"`
}
-type serviceInstanceCtrlWatchClient struct {
- grpc.ClientStream
+type GetAllSchemaRequest struct {
+ ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
+ WithSchema bool `protobuf:"varint,2,opt,name=withSchema" json:"withSchema,omitempty"`
}
-func (x *serviceInstanceCtrlWatchClient) Recv() (*WatchInstanceResponse, error) {
- m := new(WatchInstanceResponse)
- if err := x.ClientStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
+type GetSchemaResponse struct {
+ Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
+ Schema string `protobuf:"bytes,2,opt,name=schema" json:"schema,omitempty"`
+ SchemaSummary string `protobuf:"bytes,3,opt,name=schemaSummary" json:"schemaSummary,omitempty"`
}
-func (c *serviceInstanceCtrlClient) HeartbeatSet(ctx context.Context, in *HeartbeatSetRequest, opts ...grpc.CallOption) (*HeartbeatSetResponse, error) {
- out := new(HeartbeatSetResponse)
- err := grpc.Invoke(ctx, "/proto.ServiceInstanceCtrl/heartbeatSet", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
+type GetAllSchemaResponse struct {
+ Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
+ Schemas []*Schema `protobuf:"bytes,2,rep,name=schemas" json:"schemas,omitempty"`
}
-// Server API for ServiceInstanceCtrl service
-
-type ServiceInstanceCtrlServer interface {
- Register(context.Context, *RegisterInstanceRequest) (*RegisterInstanceResponse, error)
- Unregister(context.Context, *UnregisterInstanceRequest) (*UnregisterInstanceResponse, error)
- Heartbeat(context.Context, *HeartbeatRequest) (*HeartbeatResponse, error)
- Find(context.Context, *FindInstancesRequest) (*FindInstancesResponse, error)
- GetInstances(context.Context, *GetInstancesRequest) (*GetInstancesResponse, error)
- GetOneInstance(context.Context, *GetOneInstanceRequest) (*GetOneInstanceResponse, error)
- UpdateStatus(context.Context, *UpdateInstanceStatusRequest) (*UpdateInstanceStatusResponse, error)
- UpdateInstanceProperties(context.Context, *UpdateInstancePropsRequest) (*UpdateInstancePropsResponse, error)
- Watch(*WatchInstanceRequest, ServiceInstanceCtrl_WatchServer) error
- HeartbeatSet(context.Context, *HeartbeatSetRequest) (*HeartbeatSetResponse, error)
+type DeleteSchemaRequest struct {
+ ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
+ SchemaId string `protobuf:"bytes,2,opt,name=schemaId" json:"schemaId,omitempty"`
}
-func RegisterServiceInstanceCtrlServer(s *grpc.Server, srv ServiceInstanceCtrlServer) {
- s.RegisterService(&_ServiceInstanceCtrl_serviceDesc, srv)
+type DeleteSchemaResponse struct {
+ Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
}
-func _ServiceInstanceCtrl_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(RegisterInstanceRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ServiceInstanceCtrlServer).Register(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.ServiceInstanceCtrl/Register",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ServiceInstanceCtrlServer).Register(ctx, req.(*RegisterInstanceRequest))
- }
- return interceptor(ctx, in, info, handler)
+type ModifySchemaRequest struct {
+ ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
+ SchemaId string `protobuf:"bytes,2,opt,name=schemaId" json:"schemaId,omitempty"`
+ Schema string `protobuf:"bytes,3,opt,name=schema" json:"schema,omitempty"`
+ Summary string `protobuf:"bytes,4,opt,name=summary" json:"summary,omitempty"`
}
-func _ServiceInstanceCtrl_Unregister_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(UnregisterInstanceRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ServiceInstanceCtrlServer).Unregister(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.ServiceInstanceCtrl/Unregister",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ServiceInstanceCtrlServer).Unregister(ctx, req.(*UnregisterInstanceRequest))
- }
- return interceptor(ctx, in, info, handler)
+type ModifySchemaResponse struct {
+ Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
}
-func _ServiceInstanceCtrl_Heartbeat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(HeartbeatRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ServiceInstanceCtrlServer).Heartbeat(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.ServiceInstanceCtrl/Heartbeat",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ServiceInstanceCtrlServer).Heartbeat(ctx, req.(*HeartbeatRequest))
- }
- return interceptor(ctx, in, info, handler)
+type AddDependenciesRequest struct {
+ Dependencies []*ConsumerDependency `protobuf:"bytes,1,rep,name=dependencies" json:"dependencies,omitempty"`
}
-func _ServiceInstanceCtrl_Find_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(FindInstancesRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ServiceInstanceCtrlServer).Find(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.ServiceInstanceCtrl/Find",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ServiceInstanceCtrlServer).Find(ctx, req.(*FindInstancesRequest))
- }
- return interceptor(ctx, in, info, handler)
+type AddDependenciesResponse struct {
+ Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
}
-func _ServiceInstanceCtrl_GetInstances_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(GetInstancesRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ServiceInstanceCtrlServer).GetInstances(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.ServiceInstanceCtrl/GetInstances",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ServiceInstanceCtrlServer).GetInstances(ctx, req.(*GetInstancesRequest))
- }
- return interceptor(ctx, in, info, handler)
+type CreateDependenciesRequest struct {
+ Dependencies []*ConsumerDependency `protobuf:"bytes,1,rep,name=dependencies" json:"dependencies,omitempty"`
}
-func _ServiceInstanceCtrl_GetOneInstance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(GetOneInstanceRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ServiceInstanceCtrlServer).GetOneInstance(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.ServiceInstanceCtrl/GetOneInstance",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ServiceInstanceCtrlServer).GetOneInstance(ctx, req.(*GetOneInstanceRequest))
- }
- return interceptor(ctx, in, info, handler)
+type ConsumerDependency struct {
+ Consumer *MicroServiceKey `protobuf:"bytes,1,opt,name=consumer" json:"consumer,omitempty"`
+ Providers []*MicroServiceKey `protobuf:"bytes,2,rep,name=providers" json:"providers,omitempty"`
+ Override bool `protobuf:"varint,3,opt,name=override" json:"override,omitempty"`
}
-func _ServiceInstanceCtrl_UpdateStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(UpdateInstanceStatusRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ServiceInstanceCtrlServer).UpdateStatus(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.ServiceInstanceCtrl/UpdateStatus",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ServiceInstanceCtrlServer).UpdateStatus(ctx, req.(*UpdateInstanceStatusRequest))
- }
- return interceptor(ctx, in, info, handler)
+type CreateDependenciesResponse struct {
+ Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
}
-func _ServiceInstanceCtrl_UpdateInstanceProperties_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(UpdateInstancePropsRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ServiceInstanceCtrlServer).UpdateInstanceProperties(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.ServiceInstanceCtrl/UpdateInstanceProperties",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ServiceInstanceCtrlServer).UpdateInstanceProperties(ctx, req.(*UpdateInstancePropsRequest))
- }
- return interceptor(ctx, in, info, handler)
+type GetDependenciesRequest struct {
+ ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
+ SameDomain bool `protobuf:"varint,2,opt,name=sameDomain" json:"sameDomain,omitempty"`
+ NoSelf bool `protobuf:"varint,3,opt,name=noSelf" json:"noSelf,omitempty"`
}
-func _ServiceInstanceCtrl_Watch_Handler(srv interface{}, stream grpc.ServerStream) error {
- m := new(WatchInstanceRequest)
- if err := stream.RecvMsg(m); err != nil {
- return err
- }
- return srv.(ServiceInstanceCtrlServer).Watch(m, &serviceInstanceCtrlWatchServer{stream})
+type GetConDependenciesResponse struct {
+ Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
+ Providers []*MicroService `protobuf:"bytes,2,rep,name=providers" json:"providers,omitempty"`
}
-type ServiceInstanceCtrl_WatchServer interface {
- Send(*WatchInstanceResponse) error
- grpc.ServerStream
+type GetProDependenciesResponse struct {
+ Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
+ Consumers []*MicroService `protobuf:"bytes,2,rep,name=consumers" json:"consumers,omitempty"`
}
-type serviceInstanceCtrlWatchServer struct {
- grpc.ServerStream
+// 服务详情
+type ServiceDetail struct {
+ MicroService *MicroService `protobuf:"bytes,1,opt,name=microService" json:"microService,omitempty"`
+ Instances []*MicroServiceInstance `protobuf:"bytes,2,rep,name=instances" json:"instances,omitempty"`
+ SchemaInfos []*Schema `protobuf:"bytes,3,rep,name=schemaInfos" json:"schemaInfos,omitempty"`
+ Rules []*ServiceRule `protobuf:"bytes,4,rep,name=rules" json:"rules,omitempty"`
+ Providers []*MicroService `protobuf:"bytes,5,rep,name=providers" json:"providers,omitempty"`
+ Consumers []*MicroService `protobuf:"bytes,6,rep,name=consumers" json:"consumers,omitempty"`
+ Tags map[string]string `protobuf:"bytes,7,rep,name=tags" json:"tags,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
+ MicroServiceVersions []string `protobuf:"bytes,8,rep,name=microServiceVersions" json:"microServiceVersions,omitempty"`
+ Statics *Statistics `protobuf:"bytes,9,opt,name=statics" json:"statics,omitempty"`
}
-func (x *serviceInstanceCtrlWatchServer) Send(m *WatchInstanceResponse) error {
- return x.ServerStream.SendMsg(m)
+// 服务详情返回信息
+type GetServiceDetailResponse struct {
+ Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
+ Service *ServiceDetail `protobuf:"bytes,2,opt,name=service" json:"service,omitempty"`
}
-func _ServiceInstanceCtrl_HeartbeatSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(HeartbeatSetRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ServiceInstanceCtrlServer).HeartbeatSet(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.ServiceInstanceCtrl/HeartbeatSet",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ServiceInstanceCtrlServer).HeartbeatSet(ctx, req.(*HeartbeatSetRequest))
- }
- return interceptor(ctx, in, info, handler)
+// 删除服务请求
+type DelServicesRequest struct {
+ ServiceIds []string `protobuf:"bytes,1,rep,name=serviceIds" json:"serviceIds,omitempty"`
+ Force bool `protobuf:"varint,2,opt,name=force" json:"force,omitempty"`
}
-var _ServiceInstanceCtrl_serviceDesc = grpc.ServiceDesc{
- ServiceName: "proto.ServiceInstanceCtrl",
- HandlerType: (*ServiceInstanceCtrlServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "register",
- Handler: _ServiceInstanceCtrl_Register_Handler,
- },
- {
- MethodName: "unregister",
- Handler: _ServiceInstanceCtrl_Unregister_Handler,
- },
- {
- MethodName: "heartbeat",
- Handler: _ServiceInstanceCtrl_Heartbeat_Handler,
- },
- {
- MethodName: "find",
- Handler: _ServiceInstanceCtrl_Find_Handler,
- },
- {
- MethodName: "getInstances",
- Handler: _ServiceInstanceCtrl_GetInstances_Handler,
- },
- {
- MethodName: "getOneInstance",
- Handler: _ServiceInstanceCtrl_GetOneInstance_Handler,
- },
- {
- MethodName: "updateStatus",
- Handler: _ServiceInstanceCtrl_UpdateStatus_Handler,
- },
- {
- MethodName: "updateInstanceProperties",
- Handler: _ServiceInstanceCtrl_UpdateInstanceProperties_Handler,
- },
- {
- MethodName: "heartbeatSet",
- Handler: _ServiceInstanceCtrl_HeartbeatSet_Handler,
- },
- },
- Streams: []grpc.StreamDesc{
- {
- StreamName: "watch",
- Handler: _ServiceInstanceCtrl_Watch_Handler,
- ServerStreams: true,
- },
- },
- Metadata: "services.proto",
+// 删除服务响应内容
+type DelServicesRspInfo struct {
+ ErrMessage string `protobuf:"bytes,1,opt,name=errMessage" json:"errMessage,omitempty"`
+ ServiceId string `protobuf:"bytes,2,opt,name=serviceId" json:"serviceId,omitempty"`
}
-// Client API for GovernServiceCtrl service
-
-type GovernServiceCtrlClient interface {
- GetServiceDetail(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*GetServiceDetailResponse, error)
- GetServicesInfo(ctx context.Context, in *GetServicesInfoRequest, opts ...grpc.CallOption) (*GetServicesInfoResponse, error)
- GetApplications(ctx context.Context, in *GetAppsRequest, opts ...grpc.CallOption) (*GetAppsResponse, error)
+// 删除服务响应
+type DelServicesResponse struct {
+ Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
+ Services []*DelServicesRspInfo `protobuf:"bytes,2,rep,name=services" json:"services,omitempty"`
}
-type governServiceCtrlClient struct {
- cc *grpc.ClientConn
+type GetAppsRequest struct {
+ Environment string `protobuf:"bytes,1,opt,name=environment" json:"environment,omitempty"`
+ WithShared bool `protobuf:"varint,2,opt,name=withShared" json:"withShared,omitempty"`
}
-func NewGovernServiceCtrlClient(cc *grpc.ClientConn) GovernServiceCtrlClient {
- return &governServiceCtrlClient{cc}
+type GetAppsResponse struct {
+ Response *Response `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
+ AppIds []string `protobuf:"bytes,2,rep,name=appIds" json:"appIds,omitempty"`
}
-
-func (c *governServiceCtrlClient) GetServiceDetail(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*GetServiceDetailResponse, error) {
- out := new(GetServiceDetailResponse)
- err := grpc.Invoke(ctx, "/proto.GovernServiceCtrl/getServiceDetail", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
+type ServiceCtrlServer interface {
+ Exist(context.Context, *GetExistenceRequest) (*GetExistenceResponse, error)
+ Create(context.Context, *CreateServiceRequest) (*CreateServiceResponse, error)
+ Delete(context.Context, *DeleteServiceRequest) (*DeleteServiceResponse, error)
+ GetOne(context.Context, *GetServiceRequest) (*GetServiceResponse, error)
+ GetServices(context.Context, *GetServicesRequest) (*GetServicesResponse, error)
+ UpdateProperties(context.Context, *UpdateServicePropsRequest) (*UpdateServicePropsResponse, error)
+ AddRule(context.Context, *AddServiceRulesRequest) (*AddServiceRulesResponse, error)
+ GetRule(context.Context, *GetServiceRulesRequest) (*GetServiceRulesResponse, error)
+ UpdateRule(context.Context, *UpdateServiceRuleRequest) (*UpdateServiceRuleResponse, error)
+ DeleteRule(context.Context, *DeleteServiceRulesRequest) (*DeleteServiceRulesResponse, error)
+ AddTags(context.Context, *AddServiceTagsRequest) (*AddServiceTagsResponse, error)
+ GetTags(context.Context, *GetServiceTagsRequest) (*GetServiceTagsResponse, error)
+ UpdateTag(context.Context, *UpdateServiceTagRequest) (*UpdateServiceTagResponse, error)
+ DeleteTags(context.Context, *DeleteServiceTagsRequest) (*DeleteServiceTagsResponse, error)
+ GetSchemaInfo(context.Context, *GetSchemaRequest) (*GetSchemaResponse, error)
+ GetAllSchemaInfo(context.Context, *GetAllSchemaRequest) (*GetAllSchemaResponse, error)
+ DeleteSchema(context.Context, *DeleteSchemaRequest) (*DeleteSchemaResponse, error)
+ ModifySchema(context.Context, *ModifySchemaRequest) (*ModifySchemaResponse, error)
+ ModifySchemas(context.Context, *ModifySchemasRequest) (*ModifySchemasResponse, error)
+ AddDependenciesForMicroServices(context.Context, *AddDependenciesRequest) (*AddDependenciesResponse, error)
+ CreateDependenciesForMicroServices(context.Context, *CreateDependenciesRequest) (*CreateDependenciesResponse, error)
+ GetProviderDependencies(context.Context, *GetDependenciesRequest) (*GetProDependenciesResponse, error)
+ GetConsumerDependencies(context.Context, *GetDependenciesRequest) (*GetConDependenciesResponse, error)
+ DeleteServices(context.Context, *DelServicesRequest) (*DelServicesResponse, error)
}
-
-func (c *governServiceCtrlClient) GetServicesInfo(ctx context.Context, in *GetServicesInfoRequest, opts ...grpc.CallOption) (*GetServicesInfoResponse, error) {
- out := new(GetServicesInfoResponse)
- err := grpc.Invoke(ctx, "/proto.GovernServiceCtrl/getServicesInfo", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
+type ServiceInstanceCtrlServer interface {
+ Register(context.Context, *RegisterInstanceRequest) (*RegisterInstanceResponse, error)
+ Unregister(context.Context, *UnregisterInstanceRequest) (*UnregisterInstanceResponse, error)
+ Heartbeat(context.Context, *HeartbeatRequest) (*HeartbeatResponse, error)
+ Find(context.Context, *FindInstancesRequest) (*FindInstancesResponse, error)
+ GetInstances(context.Context, *GetInstancesRequest) (*GetInstancesResponse, error)
+ GetOneInstance(context.Context, *GetOneInstanceRequest) (*GetOneInstanceResponse, error)
+ UpdateStatus(context.Context, *UpdateInstanceStatusRequest) (*UpdateInstanceStatusResponse, error)
+ UpdateInstanceProperties(context.Context, *UpdateInstancePropsRequest) (*UpdateInstancePropsResponse, error)
+ Watch(*WatchInstanceRequest, ServiceInstanceCtrl_WatchServer) error
+ HeartbeatSet(context.Context, *HeartbeatSetRequest) (*HeartbeatSetResponse, error)
}
-
-func (c *governServiceCtrlClient) GetApplications(ctx context.Context, in *GetAppsRequest, opts ...grpc.CallOption) (*GetAppsResponse, error) {
- out := new(GetAppsResponse)
- err := grpc.Invoke(ctx, "/proto.GovernServiceCtrl/getApplications", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
+type ServiceInstanceCtrl_WatchServer interface {
+ Send(*WatchInstanceResponse) error
+ grpc.ServerStream
}
-
-// Server API for GovernServiceCtrl service
-
type GovernServiceCtrlServer interface {
GetServiceDetail(context.Context, *GetServiceRequest) (*GetServiceDetailResponse, error)
GetServicesInfo(context.Context, *GetServicesInfoRequest) (*GetServicesInfoResponse, error)
GetApplications(context.Context, *GetAppsRequest) (*GetAppsResponse, error)
}
-
-func RegisterGovernServiceCtrlServer(s *grpc.Server, srv GovernServiceCtrlServer) {
- s.RegisterService(&_GovernServiceCtrl_serviceDesc, srv)
-}
-
-func _GovernServiceCtrl_GetServiceDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(GetServiceRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(GovernServiceCtrlServer).GetServiceDetail(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.GovernServiceCtrl/GetServiceDetail",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(GovernServiceCtrlServer).GetServiceDetail(ctx, req.(*GetServiceRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _GovernServiceCtrl_GetServicesInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(GetServicesInfoRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(GovernServiceCtrlServer).GetServicesInfo(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.GovernServiceCtrl/GetServicesInfo",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(GovernServiceCtrlServer).GetServicesInfo(ctx, req.(*GetServicesInfoRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _GovernServiceCtrl_GetApplications_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(GetAppsRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(GovernServiceCtrlServer).GetApplications(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.GovernServiceCtrl/GetApplications",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(GovernServiceCtrlServer).GetApplications(ctx, req.(*GetAppsRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-var _GovernServiceCtrl_serviceDesc = grpc.ServiceDesc{
- ServiceName: "proto.GovernServiceCtrl",
- HandlerType: (*GovernServiceCtrlServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "getServiceDetail",
- Handler: _GovernServiceCtrl_GetServiceDetail_Handler,
- },
- {
- MethodName: "getServicesInfo",
- Handler: _GovernServiceCtrl_GetServicesInfo_Handler,
- },
- {
- MethodName: "getApplications",
- Handler: _GovernServiceCtrl_GetApplications_Handler,
- },
- },
- Streams: []grpc.StreamDesc{},
- Metadata: "services.proto",
-}
-
-func init() { proto1.RegisterFile("services.proto", fileDescriptor0) }
-
-var fileDescriptor0 = []byte{
- // 3330 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00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x9d, 0x8e, 0xcd, 0xff, 0x53,
- 0xb5, 0x2e, 0x5d, 0x59, 0x99, 0xe3, 0xdf, 0xba, 0x90, 0xef, 0xe6, 0x18, 0x6e, 0xbf, 0x01, 0xaf,
- 0x74, 0xfc, 0xc1, 0x56, 0x7f, 0x68, 0x3f, 0x27, 0xce, 0x56, 0x60, 0xdb, 0xd1, 0x56, 0x27, 0x22,
- 0x5b, 0x22, 0x84, 0xe0, 0xa7, 0x32, 0x1c, 0x6d, 0xd9, 0x81, 0xf3, 0x39, 0xff, 0xcb, 0xe6, 0xd1,
- 0x3c, 0xfb, 0x79, 0xf3, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x98, 0xc3, 0x2f, 0x48, 0xd2, 0x39,
- 0x00, 0x00,
-}
diff --git a/server/core/proto/services.proto b/server/core/proto/services.proto
deleted file mode 100644
index ff8f739..0000000
--- a/server/core/proto/services.proto
+++ /dev/null
@@ -1,613 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed //under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-syntax = "proto3";
-
-package proto;
-
-option go_package = "proto";
-option java_package = "com.huawei.paas.cse.serviceregistry.api";
-
-service ServiceCtrl {
- rpc exist (GetExistenceRequest) returns (GetExistenceResponse);
- rpc create (CreateServiceRequest) returns (CreateServiceResponse);
- rpc delete (DeleteServiceRequest) returns (DeleteServiceResponse);
- rpc getOne (GetServiceRequest) returns (GetServiceResponse);
- rpc getServices (GetServicesRequest) returns (GetServicesResponse);
- rpc updateProperties (UpdateServicePropsRequest) returns (UpdateServicePropsResponse);
-
- rpc addRule (AddServiceRulesRequest) returns (AddServiceRulesResponse);
- rpc getRule (GetServiceRulesRequest) returns (GetServiceRulesResponse);
- rpc updateRule (UpdateServiceRuleRequest) returns (UpdateServiceRuleResponse);
- rpc deleteRule (DeleteServiceRulesRequest) returns (DeleteServiceRulesResponse);
-
- rpc addTags (AddServiceTagsRequest) returns (AddServiceTagsResponse);
- rpc getTags (GetServiceTagsRequest) returns (GetServiceTagsResponse);
- rpc updateTag (UpdateServiceTagRequest) returns (UpdateServiceTagResponse);
- rpc deleteTags (DeleteServiceTagsRequest) returns (DeleteServiceTagsResponse);
-
- rpc getSchemaInfo (GetSchemaRequest) returns (GetSchemaResponse);
- rpc getAllSchemaInfo (GetAllSchemaRequest) returns (GetAllSchemaResponse);
- rpc deleteSchema (DeleteSchemaRequest) returns (DeleteSchemaResponse);
- rpc modifySchema (ModifySchemaRequest) returns (ModifySchemaResponse);
- rpc modifySchemas (ModifySchemasRequest) returns (ModifySchemasResponse);
-
- rpc addDependenciesForMicroServices (AddDependenciesRequest) returns (AddDependenciesResponse);
- rpc createDependenciesForMicroServices (CreateDependenciesRequest) returns (CreateDependenciesResponse);
- rpc getProviderDependencies (GetDependenciesRequest) returns (GetProDependenciesResponse);
- rpc getConsumerDependencies (GetDependenciesRequest) returns (GetConDependenciesResponse);
-
- rpc deleteServices (DelServicesRequest) returns (DelServicesResponse);
-}
-
-service ServiceInstanceCtrl {
- rpc register (RegisterInstanceRequest) returns (RegisterInstanceResponse);
- rpc unregister (UnregisterInstanceRequest) returns (UnregisterInstanceResponse);
- rpc heartbeat (HeartbeatRequest) returns (HeartbeatResponse);
- rpc find (FindInstancesRequest) returns (FindInstancesResponse);
- rpc getInstances (GetInstancesRequest) returns (GetInstancesResponse);
- rpc getOneInstance (GetOneInstanceRequest) returns (GetOneInstanceResponse);
- rpc updateStatus (UpdateInstanceStatusRequest) returns (UpdateInstanceStatusResponse);
- rpc updateInstanceProperties (UpdateInstancePropsRequest) returns (UpdateInstancePropsResponse);
- rpc watch (WatchInstanceRequest) returns (stream WatchInstanceResponse);
- rpc heartbeatSet (HeartbeatSetRequest) returns (HeartbeatSetResponse);
-}
-
-//治理相关的接口和数据结构
-service GovernServiceCtrl {
- rpc getServiceDetail (GetServiceRequest) returns (GetServiceDetailResponse);
- rpc getServicesInfo (GetServicesInfoRequest) returns (GetServicesInfoResponse);
- rpc getApplications (GetAppsRequest) returns (GetAppsResponse);
-}
-
-message ModifySchemasRequest {
- string serviceId = 1;
- repeated Schema schemas = 2;
-}
-
-message Schema {
- string schemaId = 1;
- string summary = 2;
- string schema = 3;
-}
-
-message ModifySchemasResponse {
- Response response = 1;
-}
-
-message HeartbeatSetRequest {
- repeated HeartbeatSetElement instances = 1;
-}
-
-message HeartbeatSetElement {
- string serviceId = 1;
- string instanceId = 2;
-}
-
-message HeartbeatSetResponse {
- Response response = 1;
- repeated InstanceHbRst instances = 2;
-}
-
-message InstanceHbRst {
- string serviceId = 1;
- string instanceId = 2;
- string errMessage = 3;
-}
-
-message StService {
- int64 count = 1;
- int64 onlineCount = 2;
-}
-
-message StInstance {
- int64 count = 1;
- int64 countByDomain = 2;
-}
-
-message StApp {
- int64 count = 1;
-}
-
-message Statistics {
- StService services = 1;
- StInstance instances = 2;
- StApp apps = 3;
-}
-
-message GetServicesInfoRequest {
- repeated string options = 1;
- string appId = 2;
- string serviceName = 3;
- bool countOnly = 4;
- bool withShared = 5;
-}
-
-message GetServicesInfoResponse {
- Response response = 1;
- repeated ServiceDetail allServicesDetail = 2;
- Statistics statistics = 3;
-
-}
-
-message MicroServiceKey {
- string tenant = 1;
- string project = 2;
- string appId = 3;
- string serviceName = 4;
- string version = 5;
- string environment = 6;
- string alias = 7;
-}
-
-// Micro service
-
-message MicroService {
- string serviceId = 1;
- string appId = 2;
- string serviceName = 3;
- string version = 4;
- string description = 5;
- string level = 6; // custom
- repeated string schemas = 7;
- repeated ServicePath paths = 10;
- string status = 8; // UP|DOWN
- map<string, string> properties = 9;
- string timestamp = 11;
- repeated MicroServiceKey providers = 12;
- string alias = 13;
- map<string, string> LBStrategy = 14;
- string modTimestamp = 15;
- string environment = 16;
- string registerBy = 17;
- FrameWorkProperty framework = 18;
-}
-
-message FrameWorkProperty {
- string name = 1;
- string version = 2;
-}
-
-message ServiceRule {
- string ruleId = 1;
- string ruleType = 2; // WHITE|BACK
- string attribute = 3;
- string pattern = 4;
- string description = 5;
- string timestamp = 6;
- string modTimestamp = 7;
-}
-
-message AddOrUpdateServiceRule {
- string ruleType = 1; // WHITE|BACK
- string attribute = 2;
- string pattern = 3;
- string description = 4;
-}
-
-message ServicePath {
- string path = 1;
- map<string, string> property = 2;
-}
-
-message Response {
- int32 code = 1;
- string message = 2;
-}
-
-message GetExistenceRequest {
- string type = 1;
- string appId = 2;
- string serviceName = 3;
- string version = 4;
- string serviceId = 5;
- string schemaId = 6;
- string environment = 7;
-}
-
-message GetExistenceResponse {
- Response response = 1;
- string serviceId = 2;
- string schemaId = 3;
- string summary = 4;
-}
-
-message CreateServiceRequest {
- MicroService service = 1;
- repeated AddOrUpdateServiceRule rules = 2;
- map<string, string> tags = 3;
- repeated MicroServiceInstance instances = 4;
-}
-
-message CreateServiceResponse {
- Response response = 1;
- string serviceId = 2;
-}
-
-message DeleteServiceRequest {
- string serviceId = 1;
- bool force = 2;
-}
-
-message DeleteServiceResponse {
- Response response = 1;
-}
-
-message GetServiceRequest {
- string serviceId = 1;
-}
-
-message GetServiceResponse {
- Response response = 1;
- MicroService service = 2;
-}
-
-message GetServicesRequest {
-}
-
-message GetServicesResponse {
- Response response = 1;
- repeated MicroService services = 2;
-}
-
-message UpdateServicePropsRequest {
- string serviceId = 1;
- map<string, string> properties = 2;
-}
-
-message UpdateServicePropsResponse {
- Response response = 1;
-}
-
-message GetServiceRulesRequest {
- string serviceId = 1;
-}
-
-message GetServiceRulesResponse {
- Response response = 1;
- repeated ServiceRule rules = 2;
-}
-
-message UpdateServiceRuleRequest {
- string serviceId = 1;
- string ruleId = 2;
- AddOrUpdateServiceRule rule = 3;
-}
-
-message UpdateServiceRuleResponse {
- Response response = 1;
-}
-
-message AddServiceRulesRequest {
- string serviceId = 1;
- repeated AddOrUpdateServiceRule rules = 2;
-}
-
-message AddServiceRulesResponse {
- Response response = 1;
- repeated string RuleIds = 2;
-}
-
-message DeleteServiceRulesRequest {
- string serviceId = 1;
- repeated string ruleIds = 2;
-}
-
-message DeleteServiceRulesResponse {
- Response response = 1;
-}
-
-message GetServiceTagsRequest {
- string serviceId = 1;
-}
-
-message GetServiceTagsResponse {
- Response response = 1;
- map<string, string> tags = 2;
-}
-
-message UpdateServiceTagRequest {
- string serviceId = 1;
- string key = 2;
- string value = 3;
-}
-
-message UpdateServiceTagResponse {
- Response response = 1;
-}
-
-message AddServiceTagsRequest {
- string serviceId = 1;
- map<string, string> tags = 2;
-}
-
-message AddServiceTagsResponse {
- Response response = 1;
-}
-
-message DeleteServiceTagsRequest {
- string serviceId = 1;
- repeated string keys = 2;
-}
-
-message DeleteServiceTagsResponse {
- Response response = 1;
-}
-
-// Micro service process instance
-
-message HealthCheck {
- string mode = 1;
- int32 port = 2;
- int32 interval = 3;
- int32 times = 4;
- string url = 5;
-}
-
-message MicroServiceInstance {
- string instanceId = 1;
- string serviceId = 2;
-
- repeated string endpoints = 3;
-
- string hostName = 4;
-
- string status = 5; // UP|DOWN|STARTING|OUTOFSERVICE
-
- map<string, string> properties = 6; // reserved key list: region|az|stage|group
-
- HealthCheck healthCheck = 7;
-
- string timestamp = 8;
-
- DataCenterInfo dataCenterInfo = 9;
-
- string modTimestamp = 10;
-
- string version = 11;
-}
-
-message DataCenterInfo {
- string name = 1;
- string region = 2;
- string availableZone = 3;
-}
-
-message MicroServiceInstanceKey {
- string instanceId = 1;
- string serviceId = 2;
-}
-
-message RegisterInstanceRequest {
- MicroServiceInstance instance = 1;
-}
-
-message RegisterInstanceResponse {
- Response response = 1;
- string instanceId = 2;
-}
-
-message UnregisterInstanceRequest {
- string serviceId = 1;
- string instanceId = 2;
-}
-
-message UnregisterInstanceResponse {
- Response response = 1;
-}
-
-message HeartbeatRequest {
- string serviceId = 1;
- string instanceId = 2;
-}
-
-message HeartbeatResponse {
- Response response = 1;
-}
-
-message FindInstancesRequest {
- string consumerServiceId = 1;
- string appId = 2;
- string serviceName = 3;
- string versionRule = 4; // version rule
- repeated string tags = 5;
- string environment = 6;
-}
-
-message FindInstancesResponse {
- Response response = 1;
- repeated MicroServiceInstance instances = 2;
-}
-
-message GetOneInstanceRequest {
- string consumerServiceId = 1;
- string providerServiceId = 2;
- string providerInstanceId = 3;
- repeated string tags = 4;
-}
-
-message GetOneInstanceResponse {
- Response response = 1;
- MicroServiceInstance instance = 2;
-}
-
-message GetInstancesRequest {
- string consumerServiceId = 1;
- string providerServiceId = 2;
- repeated string tags = 3;
-}
-
-message GetInstancesResponse {
- Response response = 1;
- repeated MicroServiceInstance instances = 2;
-}
-
-message UpdateInstanceStatusRequest {
- string serviceId = 1;
- string instanceId = 2;
- string status = 3;
-}
-
-message UpdateInstanceStatusResponse {
- Response response = 1;
-}
-
-message UpdateInstancePropsRequest {
- string serviceId = 1;
- string instanceId = 2;
- map<string, string> properties = 3; // reserved key list: region|az|stage|group
-}
-
-message UpdateInstancePropsResponse {
- Response response = 1;
-}
-
-message WatchInstanceRequest {
- string selfServiceId = 1;
-}
-
-message WatchInstanceResponse {
- Response response = 1;
- string action = 2; // UPDATE|DELETE|CREATE
- MicroServiceKey key = 3;
- MicroServiceInstance instance = 4;
-}
-
-message GetSchemaRequest {
- string serviceId = 1;
- string schemaId = 2;
-}
-
-message GetAllSchemaRequest {
- string serviceId = 1;
- bool withSchema = 2;
-}
-
-message GetSchemaResponse {
- Response response = 1;
- string schema = 2;
- string schemaSummary = 3;
-}
-
-message GetAllSchemaResponse {
- Response response = 1;
- repeated Schema schemas = 2;
-}
-
-message DeleteSchemaRequest {
- string serviceId = 1;
- string schemaId = 2;
-}
-
-message DeleteSchemaResponse {
- Response response = 1;
-}
-
-message ModifySchemaRequest {
- string serviceId = 1;
- string schemaId = 2;
- string schema = 3;
- string summary = 4;
-}
-
-message ModifySchemaResponse {
- Response response = 1;
-}
-
-message AddDependenciesRequest {
- repeated ConsumerDependency dependencies = 1;
-}
-
-message AddDependenciesResponse {
- Response response = 1;
-}
-
-message CreateDependenciesRequest {
- repeated ConsumerDependency dependencies = 1;
-}
-
-message ConsumerDependency {
- MicroServiceKey consumer = 1;
- repeated MicroServiceKey providers = 2;
- bool override = 3;
-}
-
-message CreateDependenciesResponse {
- Response response = 1;
-}
-
-message GetDependenciesRequest {
- string serviceId = 1;
- bool sameDomain = 2;
- bool noSelf = 3;
-}
-
-message GetConDependenciesResponse {
- Response response = 1;
- repeated MicroService providers = 2;
-}
-
-message GetProDependenciesResponse {
- Response response = 1;
- repeated MicroService consumers = 2;
-}
-
-//服务详情
-message ServiceDetail {
- MicroService microService = 1;
- repeated MicroServiceInstance instances = 2;
- repeated Schema schemaInfos = 3;
- repeated ServiceRule rules = 4;
- repeated MicroService providers = 5;
- repeated MicroService consumers = 6;
- map<string, string> tags = 7;
- repeated string microServiceVersions = 8;
- Statistics statics = 9;
-}
-
-//服务详情返回信息
-message GetServiceDetailResponse {
- Response response = 1;
- ServiceDetail service = 2;
-}
-
-//删除服务请求
-message DelServicesRequest {
- repeated string serviceIds = 1;
- bool force = 2;
-}
-//删除服务响应内容
-message DelServicesRspInfo {
- string errMessage = 1;
- string serviceId = 2;
-}
-
-//删除服务响应
-message DelServicesResponse {
- Response response = 1;
- repeated DelServicesRspInfo services = 2;
-}
-
-message GetAppsRequest {
- string environment = 1;
- bool withShared = 2;
-}
-
-message GetAppsResponse {
- Response response = 1;
- repeated string appIds = 2;
-}
diff --git a/server/plugin/auth/buildin/buidlin_test.go b/server/plugin/auth/buildin/buidlin_test.go
index d1b5a99..f6953da 100644
--- a/server/plugin/auth/buildin/buidlin_test.go
+++ b/server/plugin/auth/buildin/buidlin_test.go
@@ -69,7 +69,7 @@ func TestTokenAuthenticator_Identify(t *testing.T) {
err = ioutil.WriteFile("./rbac.pub", b, 0600)
assert.NoError(t, err)
- archaius.Set(rbac.InitPassword, "root")
+ archaius.Set(rbac.InitPassword, "Complicated_password1")
rbac.Init()
})
@@ -100,17 +100,17 @@ func TestTokenAuthenticator_Identify(t *testing.T) {
})
t.Run("valid admin token, should be able to operate account", func(t *testing.T) {
r := httptest.NewRequest(http.MethodGet, "/v4/account", nil)
- to, err := authr.Login(context.TODO(), "root", "root")
+ to, err := authr.Login(context.TODO(), "root", "Complicated_password1")
assert.NoError(t, err)
r.Header.Set(restful.HeaderAuth, "Bear "+to)
err = ta.Identify(r)
assert.NoError(t, err)
})
t.Run("valid normal token, should no be able to operate account", func(t *testing.T) {
- err := dao.CreateAccount(context.TODO(), &rbacframe.Account{Name: "non-admin", Password: "123", Role: "developer"})
+ err := dao.CreateAccount(context.TODO(), &rbacframe.Account{Name: "non-admin", Password: "Complicated_password1", Role: "developer"})
assert.NoError(t, err)
r := httptest.NewRequest(http.MethodGet, "/v4/account", nil)
- to, err := authr.Login(context.TODO(), "non-admin", "123")
+ to, err := authr.Login(context.TODO(), "non-admin", "Complicated_password1")
assert.NoError(t, err)
r.Header.Set(restful.HeaderAuth, "Bear "+to)
err = ta.Identify(r)
diff --git a/server/plugin/registry/etcd/etcd_test.go b/server/plugin/registry/etcd/etcd_test.go
index 6e6e384..8edc293 100644
--- a/server/plugin/registry/etcd/etcd_test.go
+++ b/server/plugin/registry/etcd/etcd_test.go
@@ -25,22 +25,18 @@ import _ "github.com/apache/servicecomb-service-center/server/plugin/tls/buildin
import (
context2 "context"
"fmt"
- "os"
"strconv"
"strings"
"sync"
"testing"
"time"
- "github.com/apache/servicecomb-service-center/server/core"
"github.com/apache/servicecomb-service-center/server/plugin/registry"
- "github.com/apache/servicecomb-service-center/server/rpc"
"context"
"github.com/coreos/etcd/clientv3"
"github.com/coreos/etcd/etcdserver/etcdserverpb"
"github.com/coreos/etcd/mvcc/mvccpb"
- "google.golang.org/grpc/status"
)
const (
@@ -854,35 +850,3 @@ func TestNewRegistry(t *testing.T) {
t.Fatalf("TestEtcdClient failed, %#v", err)
}
}
-
-func TestWithTLS(t *testing.T) {
- sslRoot := "../../../../examples/service_center/ssl/"
- os.Setenv("SSL_ROOT", sslRoot)
-
- core.ServerInfo.Config.SslEnabled = true
- registry.Configuration().SslEnabled = true
- defer func() {
- core.ServerInfo.Config.SslEnabled = false
- registry.Configuration().SslEnabled = false
- os.Setenv("SSL_ROOT", "")
- }()
-
- svr, err := rpc.NewServer("127.0.0.1:0")
- go func() {
- svr.Serve()
- }()
- defer svr.Stop()
-
- etcd := &Client{
- DialTimeout: dialTimeout,
- Endpoints: []string{svr.Listener.Addr().String()},
- }
-
- err = etcd.Initialize()
- // initialize the etcd client will check member list firstly,
- // so will raise an grpc error but not TLS errors.
- if _, ok := status.FromError(err); !ok {
- t.Fatalf("TestEtcdClient failed, %#v", err)
- }
- defer etcd.Close()
-}
diff --git a/server/rest/controller/v4/auth_resource.go b/server/rest/controller/v4/auth_resource.go
index 8e0e1e6..6c9d446 100644
--- a/server/rest/controller/v4/auth_resource.go
+++ b/server/rest/controller/v4/auth_resource.go
@@ -42,7 +42,7 @@ func (r *AuthResource) URLPatterns() []rest.Route {
return []rest.Route{
{Method: http.MethodPost, Path: "/v4/token", Func: r.Login},
{Method: http.MethodPost, Path: "/v4/account", Func: r.CreateAccount},
- {Method: http.MethodPut, Path: "/v4/account-password", Func: r.ChangePassword},
+ {Method: http.MethodPut, Path: "/v4/reset-password", Func: r.ChangePassword},
}
}
func (r *AuthResource) CreateAccount(w http.ResponseWriter, req *http.Request) {
@@ -65,6 +65,10 @@ func (r *AuthResource) CreateAccount(w http.ResponseWriter, req *http.Request) {
}
err = dao.CreateAccount(context.TODO(), a)
if err != nil {
+ if err == dao.ErrDuplicated {
+ controller.WriteError(w, scerror.ErrConflictAccount, "")
+ return
+ }
log.Error(errorsEx.ErrMsgCreateAccount, err)
controller.WriteError(w, scerror.ErrInternal, errorsEx.ErrMsgCreateAccount)
return
@@ -95,6 +99,12 @@ func (r *AuthResource) ChangePassword(w http.ResponseWriter, req *http.Request)
}
err = rbac.ChangePassword(context.TODO(), changer.Role, changer.Name, a)
if err != nil {
+ if err == rbac.ErrSamePassword ||
+ err == rbac.ErrWrongPassword || err == rbac.ErrEmptyCurrentPassword ||
+ err == rbac.ErrNoPermChangeAccount {
+ controller.WriteError(w, scerror.ErrInvalidParams, err.Error())
+ return
+ }
log.Error("change password failed", err)
controller.WriteError(w, scerror.ErrInternal, err.Error())
return
diff --git a/server/rest/controller/v4/auth_resource_test.go b/server/rest/controller/v4/auth_resource_test.go
new file mode 100644
index 0000000..9e414ee
--- /dev/null
+++ b/server/rest/controller/v4/auth_resource_test.go
@@ -0,0 +1,83 @@
+package v4_test
+
+import (
+ "bytes"
+ "context"
+ "encoding/json"
+ "github.com/apache/servicecomb-service-center/pkg/rbacframe"
+ "github.com/apache/servicecomb-service-center/pkg/rest"
+ v4 "github.com/apache/servicecomb-service-center/server/rest/controller/v4"
+ "github.com/apache/servicecomb-service-center/server/service/rbac"
+ "github.com/apache/servicecomb-service-center/server/service/rbac/dao"
+ "github.com/astaxie/beego"
+ "github.com/go-chassis/go-archaius"
+ "github.com/go-chassis/go-chassis/security/secret"
+ "github.com/stretchr/testify/assert"
+ "io/ioutil"
+ "net/http"
+ "net/http/httptest"
+ "testing"
+
+ _ "github.com/apache/servicecomb-service-center/test"
+)
+
+func init() {
+ beego.AppConfig.Set("rbac_enabled", "true")
+ beego.AppConfig.Set(rbac.PubFilePath, "./rbac.pub")
+ beego.AppConfig.Set("rbac_rsa_private_key_file", "./private.key")
+}
+func TestAuthResource_Login(t *testing.T) {
+ err := archaius.Init(archaius.WithMemorySource(), archaius.WithENVSource())
+ assert.NoError(t, err)
+
+ pri, pub, err := secret.GenRSAKeyPair(4096)
+ assert.NoError(t, err)
+
+ b, err := secret.RSAPrivate2Bytes(pri)
+ assert.NoError(t, err)
+ ioutil.WriteFile("./private.key", b, 0600)
+ b, err = secret.RSAPublicKey2Bytes(pub)
+ err = ioutil.WriteFile("./rbac.pub", b, 0600)
+ assert.NoError(t, err)
+
+ archaius.Set(rbac.InitPassword, "Complicated_password1")
+
+ ctx := context.TODO()
+ dao.DeleteAccount(ctx, "root")
+ archaius.Init(archaius.WithMemorySource())
+
+ rbac.Init()
+ rest.RegisterServant(&v4.AuthResource{})
+
+ dao.DeleteAccount(ctx, "dev_account")
+
+ t.Run("invalid user login", func(t *testing.T) {
+ b, _ := json.Marshal(&rbacframe.Account{Name: "dev_account", Password: "Complicated_password1"})
+
+ r, _ := http.NewRequest(http.MethodPost, "/v4/token", bytes.NewBuffer(b))
+ w := httptest.NewRecorder()
+ rest.GetRouter().ServeHTTP(w, r)
+ assert.NotEqual(t, http.StatusOK, w.Code)
+ })
+ err = dao.CreateAccount(ctx, &rbacframe.Account{Name: "dev_account",
+ Password: "Complicated_password1",
+ Role: "developer"})
+ assert.NoError(t, err)
+
+ t.Run("root login", func(t *testing.T) {
+ b, _ := json.Marshal(&rbacframe.Account{Name: "root", Password: "Complicated_password1"})
+
+ r, _ := http.NewRequest(http.MethodPost, "/v4/token", bytes.NewBuffer(b))
+ w := httptest.NewRecorder()
+ rest.GetRouter().ServeHTTP(w, r)
+ assert.Equal(t, http.StatusOK, w.Code)
+ })
+ t.Run("dev_account login", func(t *testing.T) {
+ b, _ := json.Marshal(&rbacframe.Account{Name: "dev_account", Password: "Complicated_password1"})
+
+ r, _ := http.NewRequest(http.MethodPost, "/v4/token", bytes.NewBuffer(b))
+ w := httptest.NewRecorder()
+ rest.GetRouter().ServeHTTP(w, r)
+ assert.Equal(t, http.StatusOK, w.Code)
+ })
+}
diff --git a/server/rest/controller/v4/instance_controller.go b/server/rest/controller/v4/instance_controller.go
index 57442a5..2efbe5c 100644
--- a/server/rest/controller/v4/instance_controller.go
+++ b/server/rest/controller/v4/instance_controller.go
@@ -65,7 +65,7 @@ func (s *MicroServiceInstanceService) RegisterInstance(w http.ResponseWriter, r
controller.WriteError(w, scerr.ErrInvalidParams, "Unmarshal error")
return
}
- if request.GetInstance() != nil {
+ if request.Instance != nil {
request.Instance.ServiceId = r.URL.Query().Get(":serviceId")
}
diff --git a/server/rest/govern/controller_v4.go b/server/rest/govern/controller_v4.go
index 371b690..3f0a334 100644
--- a/server/rest/govern/controller_v4.go
+++ b/server/rest/govern/controller_v4.go
@@ -60,7 +60,7 @@ func (governService *ResourceV4) GetGraph(w http.ResponseWriter, r *http.Request
controller.WriteError(w, scerr.ErrInternal, err.Error())
return
}
- services := resp.GetServices()
+ services := resp.Services
if len(services) <= 0 {
return
}
diff --git a/server/rest/govern/govern.go b/server/rest/govern/govern.go
index 63bd5bb..d07aa82 100644
--- a/server/rest/govern/govern.go
+++ b/server/rest/govern/govern.go
@@ -19,23 +19,12 @@ package govern
import (
roa "github.com/apache/servicecomb-service-center/pkg/rest"
- "github.com/apache/servicecomb-service-center/pkg/rpc"
- pb "github.com/apache/servicecomb-service-center/server/core/proto"
- "google.golang.org/grpc"
)
func init() {
- registerGRPC()
-
registerREST()
}
-func registerGRPC() {
- rpc.RegisterService(func(s *grpc.Server) {
- pb.RegisterGovernServiceCtrlServer(s, ServiceAPI)
- })
-}
-
func registerREST() {
roa.RegisterServant(&ResourceV3{})
roa.RegisterServant(&ResourceV4{})
diff --git a/server/rpc/server.go b/server/rpc/server.go
deleted file mode 100644
index 33c60b0..0000000
--- a/server/rpc/server.go
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package rpc
-
-import (
- "github.com/apache/servicecomb-service-center/pkg/log"
- "github.com/apache/servicecomb-service-center/pkg/rpc"
- "github.com/apache/servicecomb-service-center/server/core"
- "github.com/apache/servicecomb-service-center/server/plugin"
- "google.golang.org/grpc"
- "google.golang.org/grpc/credentials"
- "net"
-)
-
-type Server struct {
- *grpc.Server
- Listener net.Listener
-}
-
-func (srv *Server) Serve() error {
- return srv.Server.Serve(srv.Listener)
-}
-
-func NewServer(ipAddr string) (_ *Server, err error) {
- var grpcSrv *grpc.Server
- if core.ServerInfo.Config.SslEnabled {
- tlsConfig, err := plugin.Plugins().TLS().ServerConfig()
- if err != nil {
- log.Error("error to get server tls config", err)
- return nil, err
- }
- creds := credentials.NewTLS(tlsConfig)
- grpcSrv = grpc.NewServer(grpc.Creds(creds))
- } else {
- grpcSrv = grpc.NewServer()
- }
-
- rpc.RegisterGRpcServer(grpcSrv)
-
- ls, err := net.Listen("tcp", ipAddr)
- if err != nil {
- log.Error("error to start Grpc API server "+ipAddr, err)
- return
- }
-
- return &Server{
- Server: grpcSrv,
- Listener: ls,
- }, nil
-}
diff --git a/server/scerror/error.go b/server/scerror/error.go
index 2b208d8..0607e4c 100644
--- a/server/scerror/error.go
+++ b/server/scerror/error.go
@@ -48,6 +48,7 @@ var errors = map[int32]string{
ErrUnavailableQuota: "Quota service is unavailable",
ErrEndpointAlreadyExists: "Endpoint is already belong to other service",
ErrForbidden: "Forbidden",
+ ErrConflictAccount: "account name is duplicated",
}
const (
@@ -70,11 +71,16 @@ const (
ErrEndpointAlreadyExists int32 = 400025
ErrServiceVersionNotExists int32 = 400026
ErrNotEnoughQuota int32 = 400100
- ErrUnauthorized int32 = 401002
- ErrForbidden int32 = 403001
- ErrInternal int32 = 500003
- ErrUnavailableBackend int32 = 500011
- ErrUnavailableQuota int32 = 500101
+
+ ErrUnauthorized int32 = 401002
+
+ ErrForbidden int32 = 403001
+
+ ErrConflictAccount int32 = 409001
+
+ ErrInternal int32 = 500003
+ ErrUnavailableBackend int32 = 500011
+ ErrUnavailableQuota int32 = 500101
)
type Error struct {
diff --git a/server/service/instance.go b/server/service/instance.go
index 3596aec..22d376b 100644
--- a/server/service/instance.go
+++ b/server/service/instance.go
@@ -63,7 +63,7 @@ func (s *InstanceService) preProcessRegisterInstance(ctx context.Context, instan
// 这里应该根据租约计时
renewalInterval := apt.RegistryDefaultLeaseRenewalinterval
retryTimes := apt.RegistryDefaultLeaseRetrytimes
- if instance.GetHealthCheck() == nil {
+ if instance.HealthCheck == nil {
instance.HealthCheck = &pb.HealthCheck{
Mode: pb.CHECK_BY_HEARTBEAT,
Interval: renewalInterval,
@@ -103,7 +103,7 @@ func (s *InstanceService) Register(ctx context.Context, in *pb.RegisterInstanceR
}, nil
}
- instance := in.GetInstance()
+ instance := in.Instance
//允许自定义id
if len(instance.InstanceId) > 0 {
@@ -119,7 +119,7 @@ func (s *InstanceService) Register(ctx context.Context, in *pb.RegisterInstanceR
log.Infof("register instance successful, reuse instance[%s/%s], operator %s",
instance.ServiceId, instance.InstanceId, remoteIP)
return &pb.RegisterInstanceResponse{
- Response: resp.GetResponse(),
+ Response: resp.Response,
InstanceId: instance.InstanceId,
}, nil
case scerr.ErrInstanceNotExists:
@@ -128,7 +128,7 @@ func (s *InstanceService) Register(ctx context.Context, in *pb.RegisterInstanceR
log.Errorf(err, "register instance failed, reuse instance[%s/%s], operator %s",
instance.ServiceId, instance.InstanceId, remoteIP)
return &pb.RegisterInstanceResponse{
- Response: resp.GetResponse(),
+ Response: resp.Response,
}, err
}
}
@@ -746,11 +746,11 @@ func (s *InstanceService) batchFindServices(ctx context.Context, in *pb.BatchFin
if err != nil {
return nil, err
}
- failed, ok := failedResult[resp.GetResponse().GetCode()]
- serviceUtil.AppendFindResponse(findCtx, int64(index), resp.GetResponse(), resp.GetInstances(),
+ failed, ok := failedResult[resp.Response.GetCode()]
+ serviceUtil.AppendFindResponse(findCtx, int64(index), resp.Response, resp.Instances,
&services.Updated, &services.NotModified, &failed)
if !ok && failed != nil {
- failedResult[resp.GetResponse().GetCode()] = failed
+ failedResult[resp.Response.GetCode()] = failed
}
}
for _, result := range failedResult {
@@ -779,11 +779,11 @@ func (s *InstanceService) batchFindInstances(ctx context.Context, in *pb.BatchFi
if err != nil {
return nil, err
}
- failed, ok := failedResult[resp.GetResponse().GetCode()]
- serviceUtil.AppendFindResponse(getCtx, int64(index), resp.GetResponse(), []*pb.MicroServiceInstance{resp.GetInstance()},
+ failed, ok := failedResult[resp.Response.GetCode()]
+ serviceUtil.AppendFindResponse(getCtx, int64(index), resp.Response, []*pb.MicroServiceInstance{resp.Instance},
&instances.Updated, &instances.NotModified, &failed)
if !ok && failed != nil {
- failedResult[resp.GetResponse().GetCode()] = failed
+ failedResult[resp.Response.GetCode()] = failed
}
}
for _, result := range failedResult {
diff --git a/server/service/rbac/authr_plugin.go b/server/service/rbac/authr_plugin.go
index 65ed1ce..84e6e4a 100644
--- a/server/service/rbac/authr_plugin.go
+++ b/server/service/rbac/authr_plugin.go
@@ -22,7 +22,6 @@ import (
"errors"
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/rbacframe"
- "github.com/apache/servicecomb-service-center/server/service/cipher"
"github.com/apache/servicecomb-service-center/server/service/rbac/dao"
"github.com/dgrijalva/jwt-go"
"github.com/go-chassis/go-chassis/security/authr"
@@ -44,15 +43,21 @@ func (a *EmbeddedAuthenticator) Login(ctx context.Context, user string, password
if user == "default" {
return "", ErrUnauthorized
}
- account, err := dao.GetAccount(ctx, user)
+ exist, err := dao.AccountExist(ctx, user)
if err != nil {
+ log.Error("check account err", err)
return "", err
}
- account.Password, err = cipher.Decrypt(account.Password)
+ if !exist {
+ return "", ErrUnauthorized
+ }
+ account, err := dao.GetAccount(ctx, user)
if err != nil {
+ log.Error("get account err", err)
return "", err
}
- if user == account.Name && password == account.Password {
+ same := SamePassword(account.Password, password)
+ if user == account.Name && same {
secret, err := GetPrivateKey()
if err != nil {
return "", err
diff --git a/server/service/rbac/dao/account_dao.go b/server/service/rbac/dao/account_dao.go
index 4287949..cf47b76 100644
--- a/server/service/rbac/dao/account_dao.go
+++ b/server/service/rbac/dao/account_dao.go
@@ -28,6 +28,8 @@ import (
"github.com/apache/servicecomb-service-center/pkg/rbacframe"
"github.com/apache/servicecomb-service-center/server/core"
"github.com/apache/servicecomb-service-center/server/service/kv"
+ stringutil "github.com/go-chassis/foundation/string"
+ "golang.org/x/crypto/bcrypt"
)
var ErrDuplicated = errors.New("account is duplicated")
@@ -55,7 +57,12 @@ func CreateAccount(ctx context.Context, a *rbacframe.Account) error {
if exist {
return ErrDuplicated
}
-
+ hash, err := bcrypt.GenerateFromPassword([]byte(a.Password), 14)
+ if err != nil {
+ log.Errorf(err, "pwd hash failed")
+ return err
+ }
+ a.Password = stringutil.Bytes2str(hash)
value, err := json.Marshal(a)
if err != nil {
log.Errorf(err, "account info is invalid")
@@ -80,7 +87,7 @@ func GetAccount(ctx context.Context, name string) (*rbacframe.Account, error) {
a := &rbacframe.Account{}
err = json.Unmarshal(r.Value, a)
if err != nil {
- log.Errorf(err, "account info is invalid")
+ log.Errorf(err, "account info is invalid format")
return nil, err
}
return a, nil
diff --git a/server/service/rbac/dao/account_dao_test.go b/server/service/rbac/dao/account_dao_test.go
index 31b3e74..454c883 100644
--- a/server/service/rbac/dao/account_dao_test.go
+++ b/server/service/rbac/dao/account_dao_test.go
@@ -27,6 +27,7 @@ import (
"github.com/apache/servicecomb-service-center/server/service/rbac/dao"
"github.com/astaxie/beego"
"github.com/stretchr/testify/assert"
+ "golang.org/x/crypto/bcrypt"
"testing"
)
@@ -39,11 +40,14 @@ func init() {
}
func TestAccountDao_CreateAccount(t *testing.T) {
+ dao.DeleteAccount(context.TODO(), "admin")
_ = dao.CreateAccount(context.Background(), &rbacframe.Account{Name: "admin", Password: "pwd"})
t.Run("get account", func(t *testing.T) {
r, err := dao.GetAccount(context.Background(), "admin")
assert.NoError(t, err)
assert.Equal(t, "admin", r.Name)
- assert.Equal(t, "pwd", r.Password)
+ hash, err := bcrypt.GenerateFromPassword([]byte("pwd"), 14)
+ err = bcrypt.CompareHashAndPassword(hash, []byte("pwd"))
+ assert.NoError(t, err)
})
}
diff --git a/server/service/rbac/password.go b/server/service/rbac/password.go
index 6e10702..1fcbd2b 100644
--- a/server/service/rbac/password.go
+++ b/server/service/rbac/password.go
@@ -19,8 +19,9 @@ package rbac
import (
"context"
- "errors"
"github.com/apache/servicecomb-service-center/pkg/rbacframe"
+ stringutil "github.com/go-chassis/foundation/string"
+ "golang.org/x/crypto/bcrypt"
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/server/service/rbac/dao"
@@ -30,13 +31,13 @@ func ChangePassword(ctx context.Context, changerRole, changerName string, a *rba
if a.Name != "" {
if changerRole != rbacframe.RoleAdmin { //need to check password mismatch. but admin role can change any user password without supply current password
log.Error("can not change other account pwd", nil)
- return ErrInputChangeAccount
+ return ErrNoPermChangeAccount
}
return changePasswordForcibly(ctx, a.Name, a.Password)
}
if a.CurrentPassword == "" {
log.Error("current pwd is empty", nil)
- return ErrInputCurrentPassword
+ return ErrEmptyCurrentPassword
}
return changePassword(ctx, changerName, a.CurrentPassword, a.Password)
@@ -47,28 +48,40 @@ func changePasswordForcibly(ctx context.Context, name, pwd string) error {
log.Error("can not change pwd", err)
return err
}
- old.Password = pwd
- err = dao.EditAccount(ctx, old)
+ err = doChangePassword(ctx, old, pwd)
if err != nil {
- log.Error("can not change pwd", err)
return err
}
return nil
}
func changePassword(ctx context.Context, name, currentPassword, pwd string) error {
+ if currentPassword == pwd {
+ return ErrSamePassword
+ }
old, err := dao.GetAccount(ctx, name)
if err != nil {
log.Error("can not change pwd", err)
return err
}
- if old.Password != currentPassword {
+ same := SamePassword(old.Password, currentPassword)
+ if !same {
log.Error("current pwd is wrong", nil)
- return errors.New("can not change pwd")
+ return ErrWrongPassword
}
- if currentPassword == pwd {
- return errors.New("the password can not be same as old one")
+ err = doChangePassword(ctx, old, pwd)
+ if err != nil {
+ return err
}
- old.Password = pwd
+ return nil
+}
+
+func doChangePassword(ctx context.Context, old *rbacframe.Account, pwd string) error {
+ hash, err := bcrypt.GenerateFromPassword([]byte(pwd), 14)
+ if err != nil {
+ log.Error("pwd hash failed", err)
+ return err
+ }
+ old.Password = stringutil.Bytes2str(hash)
err = dao.EditAccount(ctx, old)
if err != nil {
log.Error("can not change pwd", err)
@@ -76,3 +89,8 @@ func changePassword(ctx context.Context, name, currentPassword, pwd string) erro
}
return nil
}
+
+func SamePassword(hashedPwd, pwd string) bool {
+ err := bcrypt.CompareHashAndPassword([]byte(hashedPwd), []byte(pwd))
+ return err == nil
+}
diff --git a/server/service/rbac/rbac.go b/server/service/rbac/rbac.go
index 95f34f1..eb32c6e 100644
--- a/server/service/rbac/rbac.go
+++ b/server/service/rbac/rbac.go
@@ -23,6 +23,7 @@ import (
"errors"
"github.com/apache/servicecomb-service-center/pkg/log"
"github.com/apache/servicecomb-service-center/pkg/rbacframe"
+ "github.com/apache/servicecomb-service-center/server/service"
"github.com/apache/servicecomb-service-center/server/service/cipher"
"github.com/apache/servicecomb-service-center/server/service/rbac/dao"
"github.com/astaxie/beego"
@@ -39,8 +40,10 @@ const (
)
var (
- ErrInputCurrentPassword = errors.New("current password should not be empty")
- ErrInputChangeAccount = errors.New("can not change other account password")
+ ErrEmptyCurrentPassword = errors.New("current password should not be empty")
+ ErrNoPermChangeAccount = errors.New("can not change other account password")
+ ErrWrongPassword = errors.New("current pwd is wrong")
+ ErrSamePassword = errors.New("the password can not be same as old one")
)
//Init decide whether enable rbac function and save root account to db
@@ -104,11 +107,17 @@ func initFirstTime(admin string) {
if pwd == "" {
log.Fatal("can not enable rbac, password is empty", nil)
}
- if err := dao.CreateAccount(context.Background(), &rbacframe.Account{
+ a := &rbacframe.Account{
Name: admin,
Password: pwd,
Role: rbacframe.RoleAdmin,
- }); err != nil {
+ }
+ err := service.ValidateCreateAccount(a)
+ if err != nil {
+ log.Fatal("invalid pwd", err)
+ return
+ }
+ if err := dao.CreateAccount(context.Background(), a); err != nil {
if err == dao.ErrDuplicated {
log.Info("rbac is enabled")
return
diff --git a/server/service/rbac/rbca_test.go b/server/service/rbac/rbca_test.go
index 6481535..6c2596f 100644
--- a/server/service/rbac/rbca_test.go
+++ b/server/service/rbac/rbca_test.go
@@ -21,13 +21,9 @@ import (
"context"
"fmt"
"github.com/apache/servicecomb-service-center/pkg/rbacframe"
- mgr "github.com/apache/servicecomb-service-center/server/plugin"
- "github.com/apache/servicecomb-service-center/server/plugin/discovery/etcd"
- etcd2 "github.com/apache/servicecomb-service-center/server/plugin/registry/etcd"
- "github.com/apache/servicecomb-service-center/server/plugin/security/buildin"
- "github.com/apache/servicecomb-service-center/server/plugin/tracing/pzipkin"
"github.com/apache/servicecomb-service-center/server/service/rbac"
"github.com/apache/servicecomb-service-center/server/service/rbac/dao"
+ _ "github.com/apache/servicecomb-service-center/test"
"github.com/astaxie/beego"
"github.com/go-chassis/go-archaius"
"github.com/go-chassis/go-chassis/security/authr"
@@ -38,15 +34,9 @@ import (
)
func init() {
- beego.AppConfig.Set("registry_plugin", "etcd")
beego.AppConfig.Set("rbac_enabled", "true")
beego.AppConfig.Set(rbac.PubFilePath, "./rbac.pub")
beego.AppConfig.Set("rbac_rsa_private_key_file", "./private.key")
- mgr.RegisterPlugin(mgr.Plugin{mgr.REGISTRY, "etcd", etcd2.NewRegistry})
- mgr.RegisterPlugin(mgr.Plugin{mgr.DISCOVERY, "buildin", etcd.NewRepository})
- mgr.RegisterPlugin(mgr.Plugin{mgr.DISCOVERY, "etcd", etcd.NewRepository})
- mgr.RegisterPlugin(mgr.Plugin{mgr.CIPHER, "buildin", plain.New})
- mgr.RegisterPlugin(mgr.Plugin{mgr.TRACING, "buildin", pzipkin.New})
}
func TestInitRBAC(t *testing.T) {
@@ -63,9 +53,10 @@ func TestInitRBAC(t *testing.T) {
err = ioutil.WriteFile("./rbac.pub", b, 0600)
assert.NoError(t, err)
- archaius.Set(rbac.InitPassword, "root")
+ archaius.Set(rbac.InitPassword, "Complicated_password1")
dao.DeleteAccount(context.Background(), "root")
+ dao.DeleteAccount(context.Background(), "a")
dao.DeleteAccount(context.Background(), "b")
rbac.Init()
@@ -74,7 +65,7 @@ func TestInitRBAC(t *testing.T) {
assert.Equal(t, "root", a.Name)
t.Run("login and authenticate", func(t *testing.T) {
- token, err := authr.Login(context.Background(), "root", "root")
+ token, err := authr.Login(context.Background(), "root", "Complicated_password1")
assert.NoError(t, err)
fmt.Println("err:", err)
fmt.Println("token:", token)
@@ -88,20 +79,23 @@ func TestInitRBAC(t *testing.T) {
})
t.Run("change pwd,admin can change any one password", func(t *testing.T) {
- dao.CreateAccount(context.Background(), &rbacframe.Account{Name: "a", Password: "123"})
- err := rbac.ChangePassword(context.Background(), rbacframe.RoleAdmin, "admin", &rbacframe.Account{Name: "a", Password: "1234"})
+ persisted := &rbacframe.Account{Name: "a", Password: "Complicated_password1"}
+ err := dao.CreateAccount(context.Background(), persisted)
+ assert.NoError(t, err)
+ err = rbac.ChangePassword(context.Background(), rbacframe.RoleAdmin, "admin", &rbacframe.Account{Name: "a", Password: "Complicated_password2"})
assert.NoError(t, err)
a, err := dao.GetAccount(context.Background(), "a")
assert.NoError(t, err)
- assert.Equal(t, "1234", a.Password)
+ assert.True(t, rbac.SamePassword(a.Password, "Complicated_password2"))
})
t.Run("change self password", func(t *testing.T) {
- dao.CreateAccount(context.Background(), &rbacframe.Account{Name: "b", Password: "123"})
- err := rbac.ChangePassword(context.Background(), "", "b", &rbacframe.Account{CurrentPassword: "123", Password: "1234"})
+ err := dao.CreateAccount(context.Background(), &rbacframe.Account{Name: "b", Password: "Complicated_password1"})
+ assert.NoError(t, err)
+ err = rbac.ChangePassword(context.Background(), "", "b", &rbacframe.Account{CurrentPassword: "Complicated_password1", Password: "Complicated_password2"})
assert.NoError(t, err)
a, err := dao.GetAccount(context.Background(), "b")
assert.NoError(t, err)
- assert.Equal(t, "1234", a.Password)
+ assert.True(t, rbac.SamePassword(a.Password, "Complicated_password2"))
})
diff --git a/server/service/rule.go b/server/service/rule.go
index 6e4d650..12f7161 100644
--- a/server/service/rule.go
+++ b/server/service/rule.go
@@ -216,16 +216,16 @@ func (s *MicroServiceService) UpdateRule(ctx context.Context, in *pb.UpdateServi
oldRulePatten := copyRuleRef.Pattern
oldRuleAttr := copyRuleRef.Attribute
isChangeIndex := false
- if copyRuleRef.Attribute != in.GetRule().Attribute {
+ if copyRuleRef.Attribute != in.Rule.Attribute {
isChangeIndex = true
- copyRuleRef.Attribute = in.GetRule().Attribute
+ copyRuleRef.Attribute = in.Rule.Attribute
}
- if copyRuleRef.Pattern != in.GetRule().Pattern {
+ if copyRuleRef.Pattern != in.Rule.Pattern {
isChangeIndex = true
- copyRuleRef.Pattern = in.GetRule().Pattern
+ copyRuleRef.Pattern = in.Rule.Pattern
}
- copyRuleRef.RuleType = in.GetRule().RuleType
- copyRuleRef.Description = in.GetRule().Description
+ copyRuleRef.RuleType = in.Rule.RuleType
+ copyRuleRef.Description = in.Rule.Description
copyRuleRef.ModTimestamp = strconv.FormatInt(time.Now().Unix(), 10)
key := apt.GenerateServiceRuleKey(domainProject, in.ServiceId, in.RuleId)
diff --git a/server/service/service.go b/server/service/service.go
index 524e851..6fc6eeb 100644
--- a/server/service/service.go
+++ b/server/service/service.go
@@ -20,10 +20,7 @@ package service
import (
"os"
- "github.com/apache/servicecomb-service-center/pkg/rpc"
pb "github.com/apache/servicecomb-service-center/server/core/proto"
-
- "google.golang.org/grpc"
)
var (
@@ -34,12 +31,6 @@ var (
func init() {
instanceService = &InstanceService{}
serviceService = NewMicroServiceService(os.Getenv("SCHEMA_EDITABLE") == "true", instanceService)
- rpc.RegisterService(RegisterGrpcServices)
-}
-
-func RegisterGrpcServices(s *grpc.Server) {
- pb.RegisterServiceCtrlServer(s, serviceService)
- pb.RegisterServiceInstanceCtrlServer(s, instanceService)
}
func AssembleResources() (pb.ServiceCtrlServer, pb.ServiceInstanceCtrlServerEx) {
diff --git a/server/service/service_suite_test.go b/server/service/service_suite_test.go
index 84b22aa..33162c8 100644
--- a/server/service/service_suite_test.go
+++ b/server/service/service_suite_test.go
@@ -62,5 +62,4 @@ func TestRegisterGrpcServices(t *testing.T) {
defer func() {
recover()
}()
- service.RegisterGrpcServices(nil)
}
diff --git a/server/service/util/instance_util_test.go b/server/service/util/instance_util_test.go
index 80918a7..39138ac 100644
--- a/server/service/util/instance_util_test.go
+++ b/server/service/util/instance_util_test.go
@@ -101,7 +101,7 @@ func TestAppendFindResponse(t *testing.T) {
notModifiedResult []int64
failedResult *pb.FindFailedResult
)
- AppendFindResponse(ctx, 1, find.GetResponse(), find.Instances, &updatedResult, ¬ModifiedResult, &failedResult)
+ AppendFindResponse(ctx, 1, find.Response, find.Instances, &updatedResult, ¬ModifiedResult, &failedResult)
if updatedResult == nil || notModifiedResult != nil || failedResult != nil {
t.Fatal("TestAppendFindResponse failed")
}
@@ -111,7 +111,7 @@ func TestAppendFindResponse(t *testing.T) {
updatedResult = nil
cloneCtx := context.WithValue(ctx, util.CtxResponseRevision, "1")
- AppendFindResponse(cloneCtx, 1, find.GetResponse(), find.Instances, &updatedResult, ¬ModifiedResult, &failedResult)
+ AppendFindResponse(cloneCtx, 1, find.Response, find.Instances, &updatedResult, ¬ModifiedResult, &failedResult)
if updatedResult == nil || notModifiedResult != nil || failedResult != nil {
t.Fatal("TestAppendFindResponse failed")
}
@@ -122,7 +122,7 @@ func TestAppendFindResponse(t *testing.T) {
updatedResult = nil
cloneCtx = context.WithValue(ctx, util.CtxRequestRevision, "1")
cloneCtx = context.WithValue(cloneCtx, util.CtxResponseRevision, "1")
- AppendFindResponse(cloneCtx, 1, find.GetResponse(), find.Instances, &updatedResult, ¬ModifiedResult, &failedResult)
+ AppendFindResponse(cloneCtx, 1, find.Response, find.Instances, &updatedResult, ¬ModifiedResult, &failedResult)
if updatedResult != nil || notModifiedResult == nil || failedResult != nil {
t.Fatal("TestAppendFindResponse failed")
}
@@ -132,7 +132,7 @@ func TestAppendFindResponse(t *testing.T) {
notModifiedResult = nil
find.Response = pb.CreateResponse(scerr.ErrInternal, "test")
- AppendFindResponse(ctx, 1, find.GetResponse(), find.Instances, &updatedResult, ¬ModifiedResult, &failedResult)
+ AppendFindResponse(ctx, 1, find.Response, find.Instances, &updatedResult, ¬ModifiedResult, &failedResult)
if updatedResult != nil || notModifiedResult != nil || failedResult == nil {
t.Fatal("TestAppendFindResponse failed")
}
@@ -140,7 +140,7 @@ func TestAppendFindResponse(t *testing.T) {
t.Fatal("TestAppendFindResponse failed")
}
find.Response = pb.CreateResponse(scerr.ErrInvalidParams, "test")
- AppendFindResponse(ctx, 2, find.GetResponse(), find.Instances, &updatedResult, ¬ModifiedResult, &failedResult)
+ AppendFindResponse(ctx, 2, find.Response, find.Instances, &updatedResult, ¬ModifiedResult, &failedResult)
if updatedResult != nil || notModifiedResult != nil || failedResult == nil {
t.Fatal("TestAppendFindResponse failed")
}
@@ -150,15 +150,15 @@ func TestAppendFindResponse(t *testing.T) {
failedResult = nil
find.Response = nil
- AppendFindResponse(ctx, 1, find.GetResponse(), find.Instances, &updatedResult, ¬ModifiedResult, &failedResult)
- AppendFindResponse(ctx, 2, find.GetResponse(), find.Instances, &updatedResult, ¬ModifiedResult, &failedResult)
+ AppendFindResponse(ctx, 1, find.Response, find.Instances, &updatedResult, ¬ModifiedResult, &failedResult)
+ AppendFindResponse(ctx, 2, find.Response, find.Instances, &updatedResult, ¬ModifiedResult, &failedResult)
cloneCtx = context.WithValue(ctx, util.CtxRequestRevision, "1")
cloneCtx = context.WithValue(cloneCtx, util.CtxResponseRevision, "1")
- AppendFindResponse(cloneCtx, 3, find.GetResponse(), find.Instances, &updatedResult, ¬ModifiedResult, &failedResult)
- AppendFindResponse(cloneCtx, 4, find.GetResponse(), find.Instances, &updatedResult, ¬ModifiedResult, &failedResult)
+ AppendFindResponse(cloneCtx, 3, find.Response, find.Instances, &updatedResult, ¬ModifiedResult, &failedResult)
+ AppendFindResponse(cloneCtx, 4, find.Response, find.Instances, &updatedResult, ¬ModifiedResult, &failedResult)
find.Response = pb.CreateResponse(scerr.ErrInternal, "test")
- AppendFindResponse(ctx, 5, find.GetResponse(), find.Instances, &updatedResult, ¬ModifiedResult, &failedResult)
- AppendFindResponse(ctx, 6, find.GetResponse(), find.Instances, &updatedResult, ¬ModifiedResult, &failedResult)
+ AppendFindResponse(ctx, 5, find.Response, find.Instances, &updatedResult, ¬ModifiedResult, &failedResult)
+ AppendFindResponse(ctx, 6, find.Response, find.Instances, &updatedResult, ¬ModifiedResult, &failedResult)
if updatedResult == nil || notModifiedResult == nil || failedResult == nil {
t.Fatal("TestAppendFindResponse failed")
}
diff --git a/server/service/validate.go b/server/service/validate.go
index 1f83ec2..1c8e10c 100644
--- a/server/service/validate.go
+++ b/server/service/validate.go
@@ -32,7 +32,7 @@ var changePWDValidator = &validate.Validator{}
func init() {
var roleRegex, _ = regexp.Compile(`^$|^(admin|developer)$`)
- var accountRegex, _ = regexp.Compile(`^[a-zA-Z]\w{5,15}$`)
+ var accountRegex, _ = regexp.Compile(`^[a-zA-Z]\w{3,15}$`)
createAccountValidator.AddRule("Name", &validate.Rule{Regexp: accountRegex})
createAccountValidator.AddRule("Role", &validate.Rule{Regexp: roleRegex})
createAccountValidator.AddRule("Password", &validate.Rule{Regexp: &validate.PasswordChecker{}})
diff --git a/syncer/plugins/servicecenter/instance.go b/syncer/plugins/servicecenter/instance.go
deleted file mode 100644
index 74d80b0..0000000
--- a/syncer/plugins/servicecenter/instance.go
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package servicecenter
-
-import (
- "context"
-
- pb "github.com/apache/servicecomb-service-center/syncer/proto"
-)
-
-// RegisterInstance register instance to servicecenter
-func (c *Client) RegisterInstance(ctx context.Context, domainProject, serviceId string, syncInstance *pb.SyncInstance) (string, error) {
- instance := toInstance(syncInstance)
- instance.InstanceId = ""
- instance.ServiceId = serviceId
- instanceID, err := c.cli.RegisterInstance(ctx, domainProject, serviceId, instance)
- if err != nil {
- return "", err
- }
- return instanceID, nil
-}
-
-// UnregisterInstance unregister instance from servicecenter
-func (c *Client) UnregisterInstance(ctx context.Context, domainProject, serviceId, instanceId string) error {
- err := c.cli.UnregisterInstance(ctx, domainProject, serviceId, instanceId)
- if err != nil {
- return err
- }
- return nil
-}
-
-// Heartbeat sends heartbeat to servicecenter
-func (c *Client) Heartbeat(ctx context.Context, domainProject, serviceId, instanceId string) error {
- err := c.cli.Heartbeat(ctx, domainProject, serviceId, instanceId)
- if err != nil {
- return err
- }
- return nil
-}
diff --git a/syncer/plugins/servicecenter/instance_test.go b/syncer/plugins/servicecenter/instance_test.go
deleted file mode 100644
index 726eca3..0000000
--- a/syncer/plugins/servicecenter/instance_test.go
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package servicecenter
-
-import (
- "context"
- "testing"
-
- pb "github.com/apache/servicecomb-service-center/syncer/proto"
-)
-
-func TestClient_RegisterInstance(t *testing.T) {
- svr, repo := newServiceCenter(t)
- _, err := repo.RegisterInstance(context.Background(), "default/deault",
- "4042a6a3e5a2893698ae363ea99a69eb63fc51cd", &pb.SyncInstance{})
- if err != nil {
- t.Errorf("register instance failed, error: %s", err)
- }
-
- svr.Close()
- _, err = repo.RegisterInstance(context.Background(), "default/deault",
- "4042a6a3e5a2893698ae363ea99a69eb63fc51cd", &pb.SyncInstance{})
- if err != nil {
- t.Logf("register instance failed, error: %s", err)
- }
-}
-
-func TestClient_UnregisterInstance(t *testing.T) {
- svr, repo := newServiceCenter(t)
- err := repo.UnregisterInstance(context.Background(), "default/deault",
- "4042a6a3e5a2893698ae363ea99a69eb63fc51cd", "7a6be9f861a811e9b3f6fa163eca30e0")
- if err != nil {
- t.Errorf("unregister instance failed, error: %s", err)
- }
-
- svr.Close()
- err = repo.UnregisterInstance(context.Background(), "default/deault",
- "4042a6a3e5a2893698ae363ea99a69eb63fc51cd", "7a6be9f861a811e9b3f6fa163eca30e0")
- if err != nil {
- t.Logf("unregister instance failed, error: %s", err)
- }
-}
-
-func TestClient_Heartbeat(t *testing.T) {
- svr, repo := newServiceCenter(t)
- err := repo.Heartbeat(context.Background(), "default/deault",
- "4042a6a3e5a2893698ae363ea99a69eb63fc51cd", "7a6be9f861a811e9b3f6fa163eca30e0")
- if err != nil {
- t.Errorf("send instance heartbeat failed, error: %s", err)
- }
-
- svr.Close()
- err = repo.Heartbeat(context.Background(), "default/deault",
- "4042a6a3e5a2893698ae363ea99a69eb63fc51cd", "7a6be9f861a811e9b3f6fa163eca30e0")
- if err != nil {
- t.Logf("send instance heartbeat, error: %s", err)
- }
-}
diff --git a/syncer/plugins/servicecenter/schemas.go b/syncer/plugins/servicecenter/schemas.go
deleted file mode 100644
index 6c8c074..0000000
--- a/syncer/plugins/servicecenter/schemas.go
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package servicecenter
-
-import (
- "context"
-
- pb "github.com/apache/servicecomb-service-center/server/core/proto"
-)
-
-// CreateSchemas Create schemas to servicecenter
-func (c *Client) CreateSchemas(ctx context.Context, domainProject, serviceId string, schemas []*pb.Schema) error {
- err := c.cli.CreateSchemas(ctx, domainProject, serviceId, schemas)
- if err != nil {
- return err
- }
- return nil
-}
-
-// GetSchemasByServiceID Get schemas by serviceId from servicecenter
-func (c *Client) GetSchemasByServiceId(ctx context.Context, domainProject, serviceId string) ([]*pb.Schema, error) {
- schemas, err := c.cli.GetSchemasByServiceID(ctx, domainProject, serviceId)
- if err != nil {
- return nil, err
- }
- return schemas, nil
-}
diff --git a/syncer/plugins/servicecenter/service.go b/syncer/plugins/servicecenter/service.go
deleted file mode 100644
index a402d7d..0000000
--- a/syncer/plugins/servicecenter/service.go
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package servicecenter
-
-import (
- "context"
-
- "github.com/apache/servicecomb-service-center/pkg/log"
- scpb "github.com/apache/servicecomb-service-center/server/core/proto"
- pb "github.com/apache/servicecomb-service-center/syncer/proto"
- "github.com/gogo/protobuf/proto"
-)
-
-// CreateService creates the service of servicecenter
-func (c *Client) CreateService(ctx context.Context, domainProject string, syncService *pb.SyncService) (string, error) {
- service := toService(syncService)
- service.ServiceId = ""
- serviceID, err := c.cli.CreateService(ctx, domainProject, service)
- if err != nil {
- log.Debugf("create service err %v", err)
- return "", err
- }
-
- matches := pb.Expansions(syncService.Expansions).Find(expansionSchema, map[string]string{})
- if len(matches) > 0 {
- schemas := make([]*scpb.Schema, 0, len(matches))
- for _, expansion := range matches {
- schema := &scpb.Schema{}
- err1 := proto.Unmarshal(expansion.Bytes, schema)
- if err1 != nil {
- log.Errorf(err1, "proto unmarshal %s service schema, serviceID = %s, kind = %v, content = %v failed",
- PluginName, serviceID, expansion.Kind, expansion.Bytes)
- }
- schemas = append(schemas, schema)
- }
- err2 := c.CreateSchemas(ctx, domainProject, serviceID, schemas)
- if err2 != nil {
- log.Errorf(err2, "create service schemas failed, serviceID = %s", serviceID)
- }
- }
-
- return serviceID, nil
-}
-
-// DeleteService deletes service from servicecenter
-func (c *Client) DeleteService(ctx context.Context, domainProject, serviceId string) error {
- err := c.cli.DeleteService(ctx, domainProject, serviceId)
- if err != nil {
- return err
- }
- return nil
-}
-
-// ServiceExistence Checkes service exists in servicecenter
-func (c *Client) ServiceExistence(ctx context.Context, domainProject string, syncService *pb.SyncService) (string, error) {
- service := toService(syncService)
- serviceID, err := c.cli.ServiceExistence(ctx, domainProject, service.AppId, service.ServiceName, service.Version, service.Environment)
- if err != nil {
- return "", err
- }
- return serviceID, nil
-}
diff --git a/syncer/plugins/servicecenter/service_test.go b/syncer/plugins/servicecenter/service_test.go
deleted file mode 100644
index b8d10f3..0000000
--- a/syncer/plugins/servicecenter/service_test.go
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package servicecenter
-
-import (
- "context"
- "testing"
-
- pb "github.com/apache/servicecomb-service-center/syncer/proto"
-)
-
-func TestClient_CreateService(t *testing.T) {
- svr, repo := newServiceCenter(t)
- _, err := repo.CreateService(context.Background(), "default/deault", &pb.SyncService{})
- if err != nil {
- t.Errorf("create service failed, error: %s", err)
- }
-
- svr.Close()
- _, err = repo.CreateService(context.Background(), "default/deault", &pb.SyncService{})
- if err != nil {
- t.Logf("create service failed, error: %s", err)
- }
-}
-
-func TestClient_ServiceExistence(t *testing.T) {
- svr, repo := newServiceCenter(t)
- _, err := repo.ServiceExistence(context.Background(), "default/deault", &pb.SyncService{})
- if err != nil {
- t.Errorf("check service existence failed, error: %s", err)
- }
-
- svr.Close()
- _, err = repo.ServiceExistence(context.Background(), "default/deault", &pb.SyncService{})
- if err != nil {
- t.Logf("check service existence failed, error: %s", err)
- }
-}
-
-func TestClient_DeleteService(t *testing.T) {
- svr, repo := newServiceCenter(t)
- err := repo.DeleteService(context.Background(), "default/deault",
- "4042a6a3e5a2893698ae363ea99a69eb63fc51cd")
- if err != nil {
- t.Errorf("delete service failed, error: %s", err)
- }
-
- svr.Close()
- err = repo.DeleteService(context.Background(), "default/deault",
- "4042a6a3e5a2893698ae363ea99a69eb63fc51cd")
- if err != nil {
- t.Logf("delete service failed, error: %s", err)
- }
-}
diff --git a/syncer/plugins/servicecenter/servicecenter.go b/syncer/plugins/servicecenter/servicecenter.go
deleted file mode 100644
index cec9758..0000000
--- a/syncer/plugins/servicecenter/servicecenter.go
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package servicecenter
-
-import (
- "context"
- "github.com/apache/servicecomb-service-center/pkg/client/sc"
-
- "github.com/apache/servicecomb-service-center/pkg/log"
- scpb "github.com/apache/servicecomb-service-center/server/core/proto"
- "github.com/apache/servicecomb-service-center/syncer/plugins"
- pb "github.com/apache/servicecomb-service-center/syncer/proto"
-)
-
-const PluginName = "servicecenter"
-
-func init() {
- // Register self as a repository plugin
- plugins.RegisterPlugin(&plugins.Plugin{
- Kind: plugins.PluginServicecenter,
- Name: PluginName,
- New: New,
- })
-}
-
-type adaptor struct{}
-
-func New() plugins.PluginInstance {
- return &adaptor{}
-}
-
-// New repository with endpoints
-func (*adaptor) New(opts ...plugins.SCConfigOption) (plugins.Servicecenter, error) {
- cli, err := sc.NewSCClient(plugins.ToSCConfig(opts...))
- if err != nil {
- return nil, err
- }
- return &Client{cli: cli}, nil
-}
-
-type Client struct {
- cli *sc.Client
-}
-
-// GetAll get and transform servicecenter data to SyncData
-func (c *Client) GetAll(ctx context.Context) (*pb.SyncData, error) {
- cache, err := c.cli.GetScCache(ctx)
- if err != nil {
- return nil, err
- }
-
- schemas := make([]*scpb.Schema, 0, len(cache.Microservices))
- for _, service := range cache.Microservices {
- if len(service.Value.Schemas) == 0 {
- continue
- }
-
- domainProject := getDomainProjectFromServiceKey(service.Key)
- if domainProject == "" {
- continue
- }
-
- ss, err := c.cli.GetSchemasByServiceID(ctx, domainProject, service.Value.ServiceId)
- if err != nil {
- log.Warnf("get schemas by serviceId failed: %s", err)
- continue
- }
- schemas = append(schemas, ss...)
- }
- return toSyncData(cache, schemas), nil
-}
diff --git a/syncer/plugins/servicecenter/servicecenter_test.go b/syncer/plugins/servicecenter/servicecenter_test.go
deleted file mode 100644
index 5ce8460..0000000
--- a/syncer/plugins/servicecenter/servicecenter_test.go
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package servicecenter
-
-import (
- "context"
- "net/http/httptest"
- "testing"
-
- "github.com/apache/servicecomb-service-center/syncer/pkg/mock/mockservicecenter"
- "github.com/apache/servicecomb-service-center/syncer/plugins"
-)
-
-func TestClient_GetAll(t *testing.T) {
- _, sc := newServiceCenter(t)
- _, err := sc.GetAll(context.Background())
- if err != nil {
- t.Errorf("get all from %s server failed, error: %s", PluginName, err)
- }
-
- _, err = sc.GetAll(context.Background())
- if err != nil {
- t.Logf("get all from %s server failed, error: %s", PluginName, err)
- }
-}
-
-func newServiceCenter(t *testing.T) (*httptest.Server, plugins.Servicecenter) {
- plugins.SetPluginConfig(plugins.PluginServicecenter.String(), PluginName)
- adaptor := plugins.Plugins().Servicecenter()
- if adaptor == nil {
- t.Errorf("get repository adaptor %s failed", PluginName)
- }
- svr := mockservicecenter.NewMockServer()
- if svr == nil {
- t.Error("new httptest server failed")
- }
-
- repo, err := adaptor.New(plugins.WithEndpoints([]string{svr.URL}))
- if err != nil {
- t.Errorf("new repository %s failed, error: %s", PluginName, err)
- }
- return svr, repo
-}
diff --git a/syncer/plugins/servicecenter/transform.go b/syncer/plugins/servicecenter/transform.go
deleted file mode 100644
index f60c3b3..0000000
--- a/syncer/plugins/servicecenter/transform.go
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package servicecenter
-
-import (
- "github.com/apache/servicecomb-service-center/pkg/model"
- "net/url"
- "strconv"
- "strings"
-
- "github.com/apache/servicecomb-service-center/pkg/log"
- scpb "github.com/apache/servicecomb-service-center/server/core/proto"
- pb "github.com/apache/servicecomb-service-center/syncer/proto"
- "github.com/gogo/protobuf/proto"
-)
-
-const (
- expansionDatasource = "datasource"
- expansionSchema = "schema"
-)
-
-// toSyncData transform service-center service cache to SyncData
-func toSyncData(cache *model.Cache, schemas []*scpb.Schema) (data *pb.SyncData) {
- data = &pb.SyncData{
- Services: make([]*pb.SyncService, 0, len(cache.Microservices)),
- Instances: make([]*pb.SyncInstance, 0, len(cache.Instances)),
- }
-
- for _, service := range cache.Microservices {
- domainProject := getDomainProjectFromServiceKey(service.Key)
- if domainProject == "" {
- continue
- }
- syncService := toSyncService(service.Value)
- syncService.DomainProject = domainProject
- syncService.Expansions = append(syncService.Expansions, schemaExpansions(service.Value, schemas)...)
-
- syncInstances := toSyncInstances(syncService.ServiceId, cache.Instances)
- if len(syncInstances) == 0 {
- continue
- }
-
- data.Services = append(data.Services, syncService)
- data.Instances = append(data.Instances, syncInstances...)
- }
- return
-}
-
-// toSyncService transform service-center service to SyncService
-func toSyncService(service *scpb.MicroService) (syncService *pb.SyncService) {
- syncService = &pb.SyncService{
- ServiceId: service.ServiceId,
- App: service.AppId,
- Name: service.ServiceName,
- Version: service.Version,
- Environment: service.Environment,
- PluginName: PluginName,
- }
- switch service.Status {
- case scpb.MS_UP:
- syncService.Status = pb.SyncService_UP
- case scpb.MS_DOWN:
- syncService.Status = pb.SyncService_DOWN
- default:
- syncService.Status = pb.SyncService_UNKNOWN
- }
-
- content, err := proto.Marshal(service)
- if err != nil {
- log.Errorf(err, "transform sc service to syncer service failed: %s", err)
- return
- }
-
- syncService.Expansions = []*pb.Expansion{{
- Kind: expansionDatasource,
- Bytes: content,
- Labels: map[string]string{},
- }}
- return
-}
-
-// toSyncInstances transform service-center instances to SyncInstances
-func toSyncInstances(serviceID string, instances []*model.Instance) (syncInstances []*pb.SyncInstance) {
- for _, inst := range instances {
- if inst.Value.Status != scpb.MSI_UP {
- continue
- }
-
- if inst.Value.ServiceId == serviceID {
- syncInstances = append(syncInstances, toSyncInstance(serviceID, inst.Value))
- }
- }
- return
-}
-
-// toSyncInstance transform service-center instance to SyncInstance
-func toSyncInstance(serviceID string, instance *scpb.MicroServiceInstance) (syncInstance *pb.SyncInstance) {
- syncInstance = &pb.SyncInstance{
- InstanceId: instance.InstanceId,
- ServiceId: serviceID,
- Endpoints: make([]string, 0, len(instance.Endpoints)),
- HostName: instance.HostName,
- Version: instance.Version,
- PluginName: PluginName,
- }
- switch instance.Status {
- case scpb.MSI_UP:
- syncInstance.Status = pb.SyncInstance_UP
- case scpb.MSI_DOWN:
- syncInstance.Status = pb.SyncInstance_DOWN
- case scpb.MSI_STARTING:
- syncInstance.Status = pb.SyncInstance_STARTING
- case scpb.MSI_OUTOFSERVICE:
- syncInstance.Status = pb.SyncInstance_OUTOFSERVICE
- default:
- syncInstance.Status = pb.SyncInstance_UNKNOWN
- }
-
- for _, ep := range instance.Endpoints {
- endpoint := ep
- addr, err := url.Parse(ep)
- if err != nil {
- log.Errorf(err, "parse sc instance endpoint failed: %s", err)
- continue
- }
- if addr.Scheme == "rest" {
- prefix := "http://"
- b, _ := strconv.ParseBool(addr.Query().Get("sslEnabled"))
- if b {
- prefix = "https://"
- }
- endpoint = strings.Replace(ep, addr.Scheme+"://", prefix, 1)
- }
- syncInstance.Endpoints = append(syncInstance.Endpoints, endpoint)
- }
-
- if instance.HealthCheck != nil {
- syncInstance.HealthCheck = &pb.HealthCheck{
- Port: instance.HealthCheck.Port,
- Interval: instance.HealthCheck.Interval,
- Times: instance.HealthCheck.Times,
- Url: instance.HealthCheck.Url,
- }
- }
-
- content, err := proto.Marshal(instance)
- if err != nil {
- log.Errorf(err, "transform sc instance to syncer instance failed: %s", err)
- return
- }
-
- syncInstance.Expansions = []*pb.Expansion{{
- Kind: expansionDatasource,
- Bytes: content,
- Labels: map[string]string{},
- }}
- return
-}
-
-func schemaExpansions(service *scpb.MicroService, schemas []*scpb.Schema) (expansions []*pb.Expansion) {
- for _, val := range schemas {
- if !inSlice(service.Schemas, val.SchemaId) {
- continue
- }
-
- content, err := proto.Marshal(val)
- if err != nil {
- log.Errorf(err, "proto marshal schemas failed, app = %s, service = %s, version = %s datasource = %s",
- service.AppId, service.ServiceName, service.Version, expansionSchema)
- continue
- }
- expansions = append(expansions, &pb.Expansion{
- Kind: expansionSchema,
- Bytes: content,
- Labels: map[string]string{},
- })
- }
- return
-}
-
-// toService transform SyncService to service-center service
-func toService(syncService *pb.SyncService) (service *scpb.MicroService) {
- service = &scpb.MicroService{}
- var err error
- if syncService.PluginName == PluginName && len(syncService.Expansions) > 0 {
- matches := pb.Expansions(syncService.Expansions).Find(expansionDatasource, map[string]string{})
- if len(matches) > 0 {
- err = proto.Unmarshal(matches[0].Bytes, service)
- if err == nil {
- service.ServiceId = syncService.ServiceId
- return
- }
- log.Errorf(err, "proto unmarshal %s service, serviceID = %s, kind = %v, content = %v failed",
- PluginName, service.ServiceId, matches[0].Kind, matches[0].Bytes)
- }
- }
- service.AppId = syncService.App
- service.ServiceId = syncService.ServiceId
- service.ServiceName = syncService.Name
- service.Version = syncService.Version
- service.Status = pb.SyncService_Status_name[int32(syncService.Status)]
- service.Environment = syncService.Environment
- return
-}
-
-// toInstance transform SyncInstance to service-center instance
-func toInstance(syncInstance *pb.SyncInstance) (instance *scpb.MicroServiceInstance) {
- instance = &scpb.MicroServiceInstance{}
- if syncInstance.PluginName == PluginName && len(syncInstance.Expansions) > 0 {
- matches := pb.Expansions(syncInstance.Expansions).Find(expansionDatasource, map[string]string{})
- if len(matches) > 0 {
- err := proto.Unmarshal(matches[0].Bytes, instance)
- if err == nil {
- instance.InstanceId = syncInstance.InstanceId
- instance.ServiceId = syncInstance.ServiceId
- return
- }
- log.Errorf(err, "proto unmarshal %s instance, instanceID = %s, kind = %v, content = %v failed",
- PluginName, instance.InstanceId, matches[0].Kind, matches[0].Bytes)
-
- }
- }
- instance.InstanceId = syncInstance.InstanceId
- instance.ServiceId = syncInstance.ServiceId
- instance.Endpoints = make([]string, 0, len(syncInstance.Endpoints))
- instance.HostName = syncInstance.HostName
- instance.Version = syncInstance.Version
- instance.Status = pb.SyncInstance_Status_name[int32(syncInstance.Status)]
-
- for _, ep := range syncInstance.Endpoints {
- addr, err := url.Parse(ep)
- if err != nil {
- log.Errorf(err, "parse sc instance endpoint failed: %s", err)
- continue
- }
- endpoint := ""
- switch addr.Scheme {
- case "http":
- endpoint = strings.Replace(ep, "http://", "rest://", 1)
- case "https":
- endpoint = strings.Replace(ep, "https://", "rest://", 1) + "?sslEnabled=true"
- case "rest", "highway":
- endpoint = ep
- }
- instance.Endpoints = append(instance.Endpoints, endpoint)
- }
-
- if syncInstance.HealthCheck != nil && syncInstance.HealthCheck.Mode != pb.HealthCheck_UNKNOWN {
- instance.HealthCheck = &scpb.HealthCheck{
- Mode: pb.HealthCheck_Modes_name[int32(syncInstance.HealthCheck.Mode)],
- Port: syncInstance.HealthCheck.Port,
- Interval: syncInstance.HealthCheck.Interval,
- Times: syncInstance.HealthCheck.Times,
- Url: syncInstance.HealthCheck.Url,
- }
- }
- return
-}
-
-func getDomainProjectFromServiceKey(serviceKey string) string {
- tenant := strings.Split(serviceKey, "/")
- if len(tenant) < 6 {
- return ""
- }
- return strings.Join(tenant[4:6], "/")
-}
-
-func inSlice(slice []string, val string) bool {
- for _, item := range slice {
- if item == val {
- return true
- }
- }
- return false
-}
diff --git a/syncer/server/server.go b/syncer/server/server.go
index 4a0941f..6364273 100644
--- a/syncer/server/server.go
+++ b/syncer/server/server.go
@@ -40,7 +40,6 @@ import (
// import plugins
_ "github.com/apache/servicecomb-service-center/syncer/plugins/eureka"
- _ "github.com/apache/servicecomb-service-center/syncer/plugins/servicecenter"
// import task
_ "github.com/apache/servicecomb-service-center/syncer/task/idle"
diff --git a/server/service/rbac/dao/account_dao_test.go b/test/test.go
similarity index 72%
copy from server/service/rbac/dao/account_dao_test.go
copy to test/test.go
index 31b3e74..650bab0 100644
--- a/server/service/rbac/dao/account_dao_test.go
+++ b/test/test.go
@@ -15,19 +15,16 @@
* limitations under the License.
*/
-package dao_test
+//Package test prepare service center required module before UT
+package test
import (
- "context"
- "github.com/apache/servicecomb-service-center/pkg/rbacframe"
mgr "github.com/apache/servicecomb-service-center/server/plugin"
"github.com/apache/servicecomb-service-center/server/plugin/discovery/etcd"
etcd2 "github.com/apache/servicecomb-service-center/server/plugin/registry/etcd"
+ plain "github.com/apache/servicecomb-service-center/server/plugin/security/buildin"
"github.com/apache/servicecomb-service-center/server/plugin/tracing/pzipkin"
- "github.com/apache/servicecomb-service-center/server/service/rbac/dao"
"github.com/astaxie/beego"
- "github.com/stretchr/testify/assert"
- "testing"
)
func init() {
@@ -35,15 +32,6 @@ func init() {
mgr.RegisterPlugin(mgr.Plugin{mgr.REGISTRY, "etcd", etcd2.NewRegistry})
mgr.RegisterPlugin(mgr.Plugin{mgr.DISCOVERY, "buildin", etcd.NewRepository})
mgr.RegisterPlugin(mgr.Plugin{mgr.DISCOVERY, "etcd", etcd.NewRepository})
+ mgr.RegisterPlugin(mgr.Plugin{mgr.CIPHER, "buildin", plain.New})
mgr.RegisterPlugin(mgr.Plugin{mgr.TRACING, "buildin", pzipkin.New})
-
-}
-func TestAccountDao_CreateAccount(t *testing.T) {
- _ = dao.CreateAccount(context.Background(), &rbacframe.Account{Name: "admin", Password: "pwd"})
- t.Run("get account", func(t *testing.T) {
- r, err := dao.GetAccount(context.Background(), "admin")
- assert.NoError(t, err)
- assert.Equal(t, "admin", r.Name)
- assert.Equal(t, "pwd", r.Password)
- })
}