From f7cb3a8a06f9ef7e2b9d39390c792d2933d4a663 Mon Sep 17 00:00:00 2001 From: venkat k Date: Sun, 19 May 2024 17:53:35 +0530 Subject: [PATCH] handling plugin store mgmt apis on capten agent --- .gitignore | 1 + Makefile | 4 + capten/agent/internal/api/agent.go | 23 +- capten/agent/internal/api/app_values_util.go | 1 - .../agent/internal/api/plugin_store_apis.go | 203 ++ capten/agent/internal/app/app.go | 2 + .../cluster_plugin_config_store.go | 3 - .../capten-store/crossplane_project.go | 1 - .../capten-store/integration_store_test.go | 194 +- .../capten-store/managed_cluster.go | 1 - capten/common-pkg/capten-store/model.go | 39 +- .../capten-store/plugin_store_config_store.go | 56 + .../capten-store/plugin_store_date_store.go | 103 + .../pb/pluginstorepb/plugin_store.pb.go | 1835 +++++++++++++++++ .../pb/pluginstorepb/plugin_store_grpc.pb.go | 368 ++++ capten/common-pkg/plugin-store/git.go | 147 ++ capten/common-pkg/plugin-store/model.go | 67 + .../plugin-store/plugin_store_handler.go | 525 +++++ .../migrations/001_git_project.down.sql | 1 - .../migrations/001_git_project.up.sql | 6 - .../migrations/001_onboard_resources.down.sql | 3 + .../migrations/001_onboard_resources.up.sql | 21 + .../migrations/002_cloud_provider.down.sql | 1 - .../migrations/002_cloud_provider.up.sql | 6 - .../002_cluster_plugin_data.down.sql | 2 + ....up.sql => 002_cluster_plugin_data.up.sql} | 22 + .../003_container_registry.down.sql | 1 - .../migrations/003_container_registry.up.sql | 7 - .../003_crossplane_plugin_data.down.sql | 3 + .../003_crossplane_plugin_data.up.sql | 25 + .../migrations/004_app_config.down.sql | 1 - .../004_tekton_plugin_data.down.sql | 1 + ...a.up.sql => 004_tekton_plugin_data.up.sql} | 0 .../migrations/005_plugin_config.down.sql | 1 - .../migrations/005_plugin_config.up.sql | 21 - .../migrations/005_plugin_store_data.down.sql | 2 + .../migrations/005_plugin_store_data.up.sql | 19 + .../migrations/006_managed_clusters.down.sql | 1 - .../migrations/006_managed_clusters.up.sql | 8 - .../007_tekton_project_data.down.sql | 1 - .../008_crossplane_project.down.sql | 1 - .../migrations/008_crossplane_project.up.sql | 7 - .../009_crossplane_provider.down.sql | 1 - .../migrations/009_crossplane_provider.up.sql | 8 - proto/plugin_store.proto | 5 +- .../pkg/pb/pluginstorepb/plugin_store.pb.go | 138 +- 46 files changed, 3717 insertions(+), 169 deletions(-) create mode 100644 capten/agent/internal/api/plugin_store_apis.go create mode 100644 capten/common-pkg/capten-store/plugin_store_config_store.go create mode 100644 capten/common-pkg/capten-store/plugin_store_date_store.go create mode 100644 capten/common-pkg/pb/pluginstorepb/plugin_store.pb.go create mode 100644 capten/common-pkg/pb/pluginstorepb/plugin_store_grpc.pb.go create mode 100644 capten/common-pkg/plugin-store/git.go create mode 100644 capten/common-pkg/plugin-store/model.go create mode 100644 capten/common-pkg/plugin-store/plugin_store_handler.go delete mode 100644 capten/database/postgres/migrations/001_git_project.down.sql delete mode 100644 capten/database/postgres/migrations/001_git_project.up.sql create mode 100644 capten/database/postgres/migrations/001_onboard_resources.down.sql create mode 100644 capten/database/postgres/migrations/001_onboard_resources.up.sql delete mode 100644 capten/database/postgres/migrations/002_cloud_provider.down.sql delete mode 100644 capten/database/postgres/migrations/002_cloud_provider.up.sql create mode 100644 capten/database/postgres/migrations/002_cluster_plugin_data.down.sql rename capten/database/postgres/migrations/{004_app_config.up.sql => 002_cluster_plugin_data.up.sql} (51%) delete mode 100644 capten/database/postgres/migrations/003_container_registry.down.sql delete mode 100644 capten/database/postgres/migrations/003_container_registry.up.sql create mode 100644 capten/database/postgres/migrations/003_crossplane_plugin_data.down.sql create mode 100644 capten/database/postgres/migrations/003_crossplane_plugin_data.up.sql delete mode 100644 capten/database/postgres/migrations/004_app_config.down.sql create mode 100644 capten/database/postgres/migrations/004_tekton_plugin_data.down.sql rename capten/database/postgres/migrations/{007_tekton_project_data.up.sql => 004_tekton_plugin_data.up.sql} (100%) delete mode 100644 capten/database/postgres/migrations/005_plugin_config.down.sql delete mode 100644 capten/database/postgres/migrations/005_plugin_config.up.sql create mode 100644 capten/database/postgres/migrations/005_plugin_store_data.down.sql create mode 100644 capten/database/postgres/migrations/005_plugin_store_data.up.sql delete mode 100644 capten/database/postgres/migrations/006_managed_clusters.down.sql delete mode 100644 capten/database/postgres/migrations/006_managed_clusters.up.sql delete mode 100644 capten/database/postgres/migrations/007_tekton_project_data.down.sql delete mode 100644 capten/database/postgres/migrations/008_crossplane_project.down.sql delete mode 100644 capten/database/postgres/migrations/008_crossplane_project.up.sql delete mode 100644 capten/database/postgres/migrations/009_crossplane_provider.down.sql delete mode 100644 capten/database/postgres/migrations/009_crossplane_provider.up.sql diff --git a/.gitignore b/.gitignore index 8aa4912b..84eac734 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ vendor .idea info.txt Dockerfile +.vscode diff --git a/Makefile b/Makefile index c6d310a8..112d2bca 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,7 @@ gen-protoc: mkdir -p capten/common-pkg/pb/agentpb mkdir -p capten/common-pkg/pb/clusterpluginspb mkdir -p server/pkg/pb/clusterpluginspb + mkdir -p capten/common-pkg/pb/pluginstorepb cd proto && protoc --go_out=../server/pkg/pb/serverpb/ --go_opt=paths=source_relative \ --go-grpc_out=../server/pkg/pb/serverpb --go-grpc_opt=paths=source_relative \ @@ -45,6 +46,9 @@ gen-protoc: --go-grpc_out=../server/pkg/pb/pluginstorepb --go-grpc_opt=paths=source_relative \ ./plugin_store.proto + cd proto && protoc --go_out=../capten/common-pkg/pb/pluginstorepb --go_opt=paths=source_relative \ + --go-grpc_out=../capten/common-pkg/pb/pluginstorepb --go-grpc_opt=paths=source_relative \ + ./plugin_store.proto cd proto && protoc --go_out=../capten/common-pkg/pb/clusterpluginspb --go_opt=paths=source_relative \ --go-grpc_out=../capten/common-pkg/pb/clusterpluginspb --go-grpc_opt=paths=source_relative \ ./cluster_plugins.proto diff --git a/capten/agent/internal/api/agent.go b/capten/agent/internal/api/agent.go index 1d1a2c82..ff878d25 100644 --- a/capten/agent/internal/api/agent.go +++ b/capten/agent/internal/api/agent.go @@ -11,22 +11,38 @@ import ( "github.com/kube-tarian/kad/capten/common-pkg/pb/agentpb" "github.com/kube-tarian/kad/capten/common-pkg/pb/captenpluginspb" "github.com/kube-tarian/kad/capten/common-pkg/pb/clusterpluginspb" + "github.com/kube-tarian/kad/capten/common-pkg/pb/pluginstorepb" + pluginstore "github.com/kube-tarian/kad/capten/common-pkg/plugin-store" ) var _ agentpb.AgentServer = &Agent{} +type pluginStore interface { + ConfigureStore(config *pluginstorepb.PluginStoreConfig) error + GetStoreConfig(storeType pluginstorepb.StoreType) (*pluginstorepb.PluginStoreConfig, error) + SyncPlugins(storeType pluginstorepb.StoreType) error + GetPlugins(storeType pluginstorepb.StoreType) ([]*pluginstorepb.Plugin, error) + GetPluginData(storeType pluginstorepb.StoreType, pluginName string) (*pluginstorepb.PluginData, error) + GetPluginValues(storeType pluginstorepb.StoreType, pluginName, version string) ([]byte, error) + DeployPlugin(storeType pluginstorepb.StoreType, pluginName, version string, values []byte) error + UnDeployPlugin(storeType pluginstorepb.StoreType, pluginName string) error +} + type Agent struct { agentpb.UnimplementedAgentServer captenpluginspb.UnimplementedCaptenPluginsServer clusterpluginspb.UnimplementedClusterPluginsServer + pluginstorepb.UnimplementedPluginStoreServer tc *temporalclient.Client as *captenstore.Store log logging.Logger cfg *config.SericeConfig + plugin pluginStore createPr bool } -func NewAgent(log logging.Logger, cfg *config.SericeConfig, as *captenstore.Store) (*Agent, error) { +func NewAgent(log logging.Logger, cfg *config.SericeConfig, + as *captenstore.Store) (*Agent, error) { var tc *temporalclient.Client var err error @@ -41,6 +57,11 @@ func NewAgent(log logging.Logger, cfg *config.SericeConfig, as *captenstore.Stor cfg: cfg, log: log, } + + agent.plugin, err = pluginstore.NewPluginStore(log, as, agent) + if err != nil { + return nil, err + } return agent, nil } diff --git a/capten/agent/internal/api/app_values_util.go b/capten/agent/internal/api/app_values_util.go index 97b1237a..62a69013 100644 --- a/capten/agent/internal/api/app_values_util.go +++ b/capten/agent/internal/api/app_values_util.go @@ -45,7 +45,6 @@ func populateTemplateValues(appConfig *agentpb.SyncAppData, newOverrideValues, l newAppConfig.Values.OverrideValues = finalOverrideMappingBytes // replace template with new override values from the request - //fmt.Printf("template: %s\n", string(appConfig.Values.TemplateValues)) log.Debugf("finalOverrideMapping: %s\n", string(finalOverrideMappingBytes)) populatedTemplateValuesMapping, err := deriveTemplateValuesMapping(finalOverrideMappingBytes, appConfig.Values.TemplateValues) if err != nil { diff --git a/capten/agent/internal/api/plugin_store_apis.go b/capten/agent/internal/api/plugin_store_apis.go new file mode 100644 index 00000000..18d013d2 --- /dev/null +++ b/capten/agent/internal/api/plugin_store_apis.go @@ -0,0 +1,203 @@ +package api + +import ( + "context" + + "github.com/kube-tarian/kad/capten/common-pkg/pb/pluginstorepb" +) + +func (a *Agent) ConfigurePluginStore(ctx context.Context, request *pluginstorepb.ConfigurePluginStoreRequest) ( + *pluginstorepb.ConfigurePluginStoreResponse, error) { + if err := validateArgs(request.Config.GitProjectId, request.Config.GitProjectURL); err != nil { + a.log.Infof("request validation failed", err) + return &pluginstorepb.ConfigurePluginStoreResponse{ + Status: pluginstorepb.StatusCode_INVALID_ARGUMENT, + StatusMessage: "request validation failed", + }, err + } + a.log.Infof("Configure plugin store request recieved for store type %d", request.Config.StoreType) + err := a.plugin.ConfigureStore(request.Config) + if err != nil { + a.log.Errorf("Configure plugin store request failed, %w", err) + return &pluginstorepb.ConfigurePluginStoreResponse{ + Status: pluginstorepb.StatusCode_INTERNRAL_ERROR, + StatusMessage: "failed to configuere plugin store", + }, err + } + + a.log.Infof("Plugin store request processed") + return &pluginstorepb.ConfigurePluginStoreResponse{ + Status: pluginstorepb.StatusCode_OK, + }, nil +} + +func (a *Agent) GetPluginStoreConfig(ctx context.Context, request *pluginstorepb.GetPluginStoreConfigRequest) ( + *pluginstorepb.GetPluginStoreConfigResponse, error) { + a.log.Infof("Get plugin store config request recieved for store type %d", request.StoreType) + + config, err := a.plugin.GetStoreConfig(request.StoreType) + if err != nil { + a.log.Errorf("Get plugin store config request failed, %w", err) + return &pluginstorepb.GetPluginStoreConfigResponse{ + Status: pluginstorepb.StatusCode_INTERNRAL_ERROR, + StatusMessage: "failed to get plugin store config", + }, err + } + + a.log.Infof("Get plugin store config request processed") + return &pluginstorepb.GetPluginStoreConfigResponse{ + Status: pluginstorepb.StatusCode_OK, + Config: config, + }, nil +} + +func (a *Agent) SyncPluginStore(ctx context.Context, request *pluginstorepb.SyncPluginStoreRequest) ( + *pluginstorepb.SyncPluginStoreResponse, error) { + a.log.Infof("Sync plugin store request recieved for store type %d", request.StoreType) + + err := a.plugin.SyncPlugins(request.StoreType) + if err != nil { + a.log.Errorf("Sync plugin store request failed, %w", err) + return &pluginstorepb.SyncPluginStoreResponse{ + Status: pluginstorepb.StatusCode_INTERNRAL_ERROR, + StatusMessage: err.Error(), + }, err + } + + a.log.Infof("Sync plugin store request processed") + return &pluginstorepb.SyncPluginStoreResponse{ + Status: pluginstorepb.StatusCode_OK, + }, nil +} + +func (a *Agent) GetPlugins(ctx context.Context, request *pluginstorepb.GetPluginsRequest) ( + *pluginstorepb.GetPluginsResponse, error) { + a.log.Infof("Get plugins request recieved") + + plugins, err := a.plugin.GetPlugins(request.StoreType) + if err != nil { + a.log.Errorf("Get plugins request failed, %w", err) + return &pluginstorepb.GetPluginsResponse{ + Status: pluginstorepb.StatusCode_INTERNRAL_ERROR, + StatusMessage: "failed to get plugins", + }, err + } + + a.log.Infof("Get plugins request processed") + return &pluginstorepb.GetPluginsResponse{ + Status: pluginstorepb.StatusCode_OK, + Plugins: plugins, + }, nil +} + +func (a *Agent) GetPluginValues(ctx context.Context, request *pluginstorepb.GetPluginValuesRequest) ( + *pluginstorepb.GetPluginValuesResponse, error) { + err := validateArgs(request.PluginName, request.Version) + if err != nil { + a.log.Infof("request validation failed", err) + return &pluginstorepb.GetPluginValuesResponse{ + Status: pluginstorepb.StatusCode_INVALID_ARGUMENT, + StatusMessage: "request validation failed", + }, err + } + a.log.Infof("Get plugin values request recieved for plugin %s-%s", request.PluginName, request.Version) + + values, err := a.plugin.GetPluginValues(request.StoreType, request.PluginName, request.Version) + if err != nil { + a.log.Errorf("Get plugin values request failed for plugin %s-%s, %w", + request.PluginName, request.Version, err) + return &pluginstorepb.GetPluginValuesResponse{ + Status: pluginstorepb.StatusCode_INTERNRAL_ERROR, + StatusMessage: "failed to get plugins", + }, err + } + + a.log.Infof("Get plugin values request processed for plugin %s-%s", + request.PluginName, request.Version) + return &pluginstorepb.GetPluginValuesResponse{ + Status: pluginstorepb.StatusCode_OK, + Values: values, + }, nil +} + +func (a *Agent) GetPluginData(ctx context.Context, request *pluginstorepb.GetPluginDataRequest) ( + *pluginstorepb.GetPluginDataResponse, error) { + err := validateArgs(request.PluginName) + if err != nil { + a.log.Infof("request validation failed", err) + return &pluginstorepb.GetPluginDataResponse{ + Status: pluginstorepb.StatusCode_INVALID_ARGUMENT, + StatusMessage: "request validation failed", + }, err + } + a.log.Infof("Get plugin data request recieved for plugin %s", request.PluginName) + + pluginData, err := a.plugin.GetPluginData(request.StoreType, request.PluginName) + if err != nil { + a.log.Errorf("Get plugin data request failed for plugin %s, %w", request.PluginName, err) + return &pluginstorepb.GetPluginDataResponse{ + Status: pluginstorepb.StatusCode_INTERNRAL_ERROR, + StatusMessage: "failed to get plugins", + }, err + } + + a.log.Infof("Get plugin data request processed for plugin %s", request.PluginName) + return &pluginstorepb.GetPluginDataResponse{ + Status: pluginstorepb.StatusCode_OK, + PluginData: pluginData, + }, nil +} + +func (a *Agent) DeployPlugin(ctx context.Context, request *pluginstorepb.DeployPluginRequest) ( + *pluginstorepb.DeployPluginResponse, error) { + err := validateArgs(request.PluginName) + if err != nil { + a.log.Infof("request validation failed", err) + return &pluginstorepb.DeployPluginResponse{ + Status: pluginstorepb.StatusCode_INVALID_ARGUMENT, + StatusMessage: "request validation failed", + }, err + } + a.log.Infof("Deploy plugin request recieved for plugin %s-%s", request.PluginName, request.Version) + + err = a.plugin.DeployPlugin(request.StoreType, request.PluginName, request.Version, request.Values) + if err != nil { + a.log.Errorf("Deploy plugin request failed for plugin %s-%s, %v", request.PluginName, request.Version, err) + return &pluginstorepb.DeployPluginResponse{ + Status: pluginstorepb.StatusCode_INTERNRAL_ERROR, + StatusMessage: "failed to deploy plugin", + }, err + } + + a.log.Infof("Deploy plugin request processed for plugin %s-%s", request.PluginName, request.Version) + return &pluginstorepb.DeployPluginResponse{ + Status: pluginstorepb.StatusCode_OK, + }, nil +} + +func (a *Agent) UnDeployPlugin(ctx context.Context, request *pluginstorepb.UnDeployPluginRequest) ( + *pluginstorepb.UnDeployPluginResponse, error) { + err := validateArgs(request.PluginName) + if err != nil { + a.log.Infof("request validation failed", err) + return &pluginstorepb.UnDeployPluginResponse{ + Status: pluginstorepb.StatusCode_INVALID_ARGUMENT, + StatusMessage: "request validation failed", + }, err + } + a.log.Infof("UnDeploy plugin request recieved for plugin %s", request.PluginName) + + err = a.plugin.UnDeployPlugin(request.StoreType, request.PluginName) + if err != nil { + a.log.Errorf("UnDeploy plugin request failed for plugin %s, %v", request.PluginName, err) + return &pluginstorepb.UnDeployPluginResponse{ + Status: pluginstorepb.StatusCode_INTERNRAL_ERROR, + StatusMessage: "failed to undeploy plugin", + }, err + } + + a.log.Infof("UnDeploy plugin request processed for plugin %s", request.PluginName) + return &pluginstorepb.UnDeployPluginResponse{ + Status: pluginstorepb.StatusCode_OK, + }, nil +} diff --git a/capten/agent/internal/app/app.go b/capten/agent/internal/app/app.go index 0e6a14b9..038cd063 100644 --- a/capten/agent/internal/app/app.go +++ b/capten/agent/internal/app/app.go @@ -17,6 +17,7 @@ import ( "github.com/kube-tarian/kad/capten/common-pkg/pb/agentpb" "github.com/kube-tarian/kad/capten/common-pkg/pb/captenpluginspb" "github.com/kube-tarian/kad/capten/common-pkg/pb/clusterpluginspb" + "github.com/kube-tarian/kad/capten/common-pkg/pb/pluginstorepb" dbinit "github.com/kube-tarian/kad/capten/common-pkg/postgres/db-init" "github.com/pkg/errors" "google.golang.org/grpc" @@ -69,6 +70,7 @@ func Start() { agentpb.RegisterAgentServer(grpcServer, rpcapi) captenpluginspb.RegisterCaptenPluginsServer(grpcServer, rpcapi) clusterpluginspb.RegisterClusterPluginsServer(grpcServer, rpcapi) + pluginstorepb.RegisterPluginStoreServer(grpcServer, rpcapi) log.Infof("Agent listening at %v", listener.Addr()) reflection.Register(grpcServer) diff --git a/capten/common-pkg/capten-store/cluster_plugin_config_store.go b/capten/common-pkg/capten-store/cluster_plugin_config_store.go index 4e4e87f9..720e3a3e 100644 --- a/capten/common-pkg/capten-store/cluster_plugin_config_store.go +++ b/capten/common-pkg/capten-store/cluster_plugin_config_store.go @@ -26,7 +26,6 @@ func (a *Store) UpsertClusterPluginConfig(pluginConfig *clusterpluginspb.Plugin) } err = nil recordFound = false - fmt.Println("not found") } else if plugin.PluginName == "" { recordFound = false } @@ -52,10 +51,8 @@ func (a *Store) UpsertClusterPluginConfig(pluginConfig *clusterpluginspb.Plugin) if !recordFound { err = a.dbClient.Create(plugin) - fmt.Println("created") } else { err = a.dbClient.Update(plugin, ClusterPluginConfig{PluginName: pluginConfig.PluginName}) - fmt.Println("updated") } return err } diff --git a/capten/common-pkg/capten-store/crossplane_project.go b/capten/common-pkg/capten-store/crossplane_project.go index 0e72fcbe..49aaa840 100644 --- a/capten/common-pkg/capten-store/crossplane_project.go +++ b/capten/common-pkg/capten-store/crossplane_project.go @@ -112,7 +112,6 @@ func (a *Store) updateCrossplaneProject() (*model.CrossplaneProject, error) { GitProjectURL: crosplaneGitProject.ProjectUrl, Status: crossplaneProject.Status, LastUpdateTime: time.Now()} - err = a.dbClient.Update(&project, CrossplaneProject{ID: 1}) if err != nil { return nil, err diff --git a/capten/common-pkg/capten-store/integration_store_test.go b/capten/common-pkg/capten-store/integration_store_test.go index dabe87e6..b649e6a7 100644 --- a/capten/common-pkg/capten-store/integration_store_test.go +++ b/capten/common-pkg/capten-store/integration_store_test.go @@ -4,10 +4,12 @@ import ( "os" "testing" + "github.com/google/uuid" "github.com/intelops/go-common/logging" "github.com/kube-tarian/kad/capten/common-pkg/pb/agentpb" "github.com/kube-tarian/kad/capten/common-pkg/pb/captenpluginspb" "github.com/kube-tarian/kad/capten/common-pkg/pb/clusterpluginspb" + "github.com/kube-tarian/kad/capten/common-pkg/pb/pluginstorepb" dbinit "github.com/kube-tarian/kad/capten/common-pkg/postgres/db-init" "github.com/kube-tarian/kad/capten/model" "github.com/stretchr/testify/assert" @@ -15,11 +17,21 @@ import ( var log = logging.NewLogger() +func setEnvConfig() { + os.Setenv("PG_DB_HOST", "127.0.0.1") + os.Setenv("PG_DB_PORT", "5432") + os.Setenv("PG_DB_SERVICE_USERNAME", "capten") + os.Setenv("PG_DB_SERVICE_USERPASSWORD", "test123!") + os.Setenv("PG_DB_ADMIN_PASSWORD", "mysecretpassword") + os.Setenv("PG_DB_DEFAULT_NAME", "postgres") + os.Setenv("PG_DB_NAME", "captendb") + os.Setenv("PG_SOURCE_URI", "file://../../database/postgres/migrations") +} + func TestDBCreate(t *testing.T) { setEnvConfig() if err := dbinit.CreatedDatabase(log); err != nil { t.Error(err) - t.Error(err) } if err := dbinit.RunMigrations(dbinit.UP); err != nil { @@ -632,7 +644,7 @@ func TestCrossplaneProject(t *testing.T) { assert.Equal(t, tektonProject.GitProjectId, projects[0].Id) assert.Equal(t, tektonProject.GitProjectUrl, "https://github.com/kube-tarian/kad") - err = store.UpsertTektonProject(&model.TektonProject{ + err = store.UpsertCrossplaneProject(&model.CrossplaneProject{ Id: "1", GitProjectId: projects[0].Id, GitProjectUrl: "git url1", @@ -653,10 +665,7 @@ func TestCrossplaneProject(t *testing.T) { assert.Equal(t, tektonProject.Status, "status1") err = store.DeleteCrossplaneProject("1") - if !assert.Nil(t, err) { - t.Logf("delete crossplane project error, %v", err) - return - } + assert.Nil(t, err) err = store.DeleteGitProjectById(tektonProject.GitProjectId) assert.Nil(t, err) @@ -732,13 +741,168 @@ func TestManagedCluster(t *testing.T) { } } -func setEnvConfig() { - os.Setenv("PG_DB_HOST", "127.0.0.1") - os.Setenv("PG_DB_PORT", "5432") - os.Setenv("PG_DB_SERVICE_USERNAME", "capten") - os.Setenv("PG_DB_SERVICE_USERPASSWORD", "test123!") - os.Setenv("PG_DB_ADMIN_PASSWORD", "mysecretpassword") - os.Setenv("PG_DB_DEFAULT_NAME", "postgres") - os.Setenv("PG_DB_NAME", "captendb") - os.Setenv("PG_SOURCE_URI", "file://../../database/postgres/migrations") +func TestPluginStoreConfig(t *testing.T) { + setEnvConfig() + + store, err := NewStore(log) + if !assert.Nil(t, err) { + t.Logf("store create error, %v", err) + return + } + + gitProjectId := uuid.New().String() + err = store.UpsertPluginStoreConfig(&pluginstorepb.PluginStoreConfig{ + StoreType: pluginstorepb.StoreType_CENTRAL_STORE, + GitProjectId: gitProjectId, + GitProjectURL: "url1", + }) + if !assert.Nil(t, err) { + t.Logf("add plugin store config error, %v", err) + return + } + + config, err := store.GetPluginStoreConfig(pluginstorepb.StoreType_CENTRAL_STORE) + if !assert.Nil(t, err) { + t.Logf("get plugin store config error, %v", err) + return + } + assert.Equal(t, config.GitProjectId, gitProjectId) + assert.Equal(t, config.GitProjectURL, "url1") + + err = store.UpsertPluginStoreConfig(&pluginstorepb.PluginStoreConfig{ + StoreType: pluginstorepb.StoreType_CENTRAL_STORE, + GitProjectId: gitProjectId, + GitProjectURL: "url2", + }) + if !assert.Nil(t, err) { + t.Logf("add plugin store config error, %v", err) + return + } + + config, err = store.GetPluginStoreConfig(pluginstorepb.StoreType_CENTRAL_STORE) + if !assert.Nil(t, err) { + t.Logf("get plugin store config error, %v", err) + return + } + assert.Equal(t, config.GitProjectURL, "url2") + + err = store.UpsertPluginStoreConfig(&pluginstorepb.PluginStoreConfig{ + StoreType: pluginstorepb.StoreType_LOCAL_STORE, + GitProjectId: gitProjectId, + GitProjectURL: "url2", + }) + if !assert.Nil(t, err) { + t.Logf("add plugin store config error, %v", err) + return + } + + config, err = store.GetPluginStoreConfig(pluginstorepb.StoreType_LOCAL_STORE) + if !assert.Nil(t, err) { + t.Logf("get plugin store config error, %v", err) + return + } + assert.Equal(t, config.GitProjectURL, "url2") + + err = store.DeletePluginStoreConfig(pluginstorepb.StoreType_CENTRAL_STORE) + if !assert.Nil(t, err) { + t.Logf("delete plugin store config error, %v", err) + return + } + + err = store.DeletePluginStoreConfig(pluginstorepb.StoreType_LOCAL_STORE) + if !assert.Nil(t, err) { + t.Logf("delete plugin store config error, %v", err) + return + } + + config, err = store.GetPluginStoreConfig(pluginstorepb.StoreType_CENTRAL_STORE) + if !assert.Nil(t, err) { + t.Logf("get plugin store config error, %v", err) + return + } + assert.Equal(t, config.GitProjectURL, "") +} + +func TestPluginStoreData(t *testing.T) { + setEnvConfig() + + store, err := NewStore(log) + if !assert.Nil(t, err) { + t.Logf("store create error, %v", err) + return + } + + gitProjectId := uuid.New().String() + err = store.UpsertPluginStoreData(gitProjectId, &pluginstorepb.PluginData{ + StoreType: pluginstorepb.StoreType_LOCAL_STORE, + PluginName: "plugin1", + Description: "value1", + Category: "category1", + Versions: []string{"v1", "v2"}, + Icon: []byte("icon1"), + }) + if !assert.Nil(t, err) { + t.Logf("add plugin store data error, %v", err) + return + } + + err = store.UpsertPluginStoreData(gitProjectId, &pluginstorepb.PluginData{ + StoreType: pluginstorepb.StoreType_CENTRAL_STORE, + PluginName: "plugin1", + Description: "value1", + Category: "category2", + Versions: []string{"v1", "v2"}, + Icon: []byte("icon1"), + }) + if !assert.Nil(t, err) { + t.Logf("add plugin store data error, %v", err) + return + } + + pluginData, err := store.GetPluginStoreData(pluginstorepb.StoreType_LOCAL_STORE, gitProjectId, "plugin1") + if !assert.Nil(t, err) { + t.Logf("get plugin store data error, %v", err) + return + } + + assert.Equal(t, pluginData.StoreType, pluginstorepb.StoreType_LOCAL_STORE) + assert.Equal(t, pluginData.PluginName, "plugin1") + assert.Equal(t, pluginData.Description, "value1") + assert.Equal(t, pluginData.Category, "category1") + assert.Equal(t, pluginData.Versions, []string{"v1", "v2"}) + assert.Equal(t, pluginData.Icon, []byte("icon1")) + + pluginData, err = store.GetPluginStoreData(pluginstorepb.StoreType_CENTRAL_STORE, gitProjectId, "plugin1") + if !assert.Nil(t, err) { + t.Logf("get plugin store data error, %v", err) + return + } + assert.Equal(t, pluginData.StoreType, pluginstorepb.StoreType_CENTRAL_STORE) + assert.Equal(t, pluginData.PluginName, "plugin1") + assert.Equal(t, pluginData.Category, "category2") + assert.Equal(t, pluginData.Icon, []byte("icon1")) + + plugins, err := store.GetPlugins(gitProjectId) + if !assert.Nil(t, err) { + t.Logf("get plugins error, %v", err) + return + } + assert.Equal(t, len(plugins), 2) + assert.Equal(t, plugins[0].PluginName, "plugin1") + assert.Equal(t, pluginData.Category, "category2") + + err = store.DeletePluginStoreData(pluginstorepb.StoreType_CENTRAL_STORE, gitProjectId, "plugin1") + if !assert.Nil(t, err) { + t.Logf("delete plugin store data error, %v", err) + return + } + + err = store.DeletePluginStoreData(pluginstorepb.StoreType_LOCAL_STORE, gitProjectId, "plugin1") + if !assert.Nil(t, err) { + t.Logf("delete plugin store data error, %v", err) + return + } + + _, err = store.GetPluginStoreData(pluginstorepb.StoreType_LOCAL_STORE, gitProjectId, "plugin1") + assert.Error(t, err) } diff --git a/capten/common-pkg/capten-store/managed_cluster.go b/capten/common-pkg/capten-store/managed_cluster.go index 29894fb2..47a395a1 100644 --- a/capten/common-pkg/capten-store/managed_cluster.go +++ b/capten/common-pkg/capten-store/managed_cluster.go @@ -46,7 +46,6 @@ func (a *Store) GetManagedClusterForID(id string) (*captenpluginspb.ManagedClust if err != nil { return nil, err } else if cluster.ID == uuid.Nil { - fmt.Printf("cluster %s, %v", id, cluster) return nil, gorm.ErrRecordNotFound } diff --git a/capten/common-pkg/capten-store/model.go b/capten/common-pkg/capten-store/model.go index 62ee1a70..be084dba 100644 --- a/capten/common-pkg/capten-store/model.go +++ b/capten/common-pkg/capten-store/model.go @@ -148,7 +148,7 @@ type ManagedCluster struct { } func (ManagedCluster) TableName() string { - return "managed_clusters" + return "managed_cluster" } type TektonProject struct { @@ -177,13 +177,40 @@ func (CrossplaneProvider) TableName() string { } type CrossplaneProject struct { - ID int `json:"id"` - GitProjectID uuid.UUID `json:"git_project_id"` - GitProjectURL string `json:"git_project_url"` - Status string `json:"status"` - LastUpdateTime time.Time `json:"last_update_time"` + ID int `json:"id" gorm:"column:id;primaryKey"` + GitProjectID uuid.UUID `json:"git_project_id" gorm:"column:git_project_id"` + GitProjectURL string `json:"git_project_url" gorm:"column:git_project_url"` + Status string `json:"status" gorm:"column:status"` + LastUpdateTime time.Time `json:"last_update_time" gorm:"column:last_update_time"` } func (CrossplaneProject) TableName() string { return "crossplane_project" } + +type PluginStoreConfig struct { + StoreType int `json:"id" gorm:"column:store_type;primaryKey"` + GitProjectID uuid.UUID `json:"git_project_id" gorm:"column:git_project_id"` + GitProjectURL string `json:"git_project_url" gorm:"column:git_project_url"` + Status string `json:"status" gorm:"column:status"` + LastUpdateTime time.Time `json:"last_update_time" gorm:"column:last_update_time"` +} + +func (PluginStoreConfig) TableName() string { + return "plugin_store_config" +} + +type PluginStoreData struct { + StoreType int `json:"id" gorm:"column:store_type;primaryKey"` + GitProjectID uuid.UUID `json:"git_project_id" gorm:"column:git_project_id"` + PluginName string `json:"plugin_name" gorm:"column:plugin_name"` + Category string `json:"category" gorm:"column:category"` + Versions StringArray `json:"versions" gorm:"column:versions;type:text[]"` + Icon []byte `json:"icon" gorm:"column:icon"` + Description string `json:"description" gorm:"column:description"` + LastUpdateTime time.Time `json:"last_update_time" gorm:"column:last_update_time"` +} + +func (PluginStoreData) TableName() string { + return "plugin_store_data" +} diff --git a/capten/common-pkg/capten-store/plugin_store_config_store.go b/capten/common-pkg/capten-store/plugin_store_config_store.go new file mode 100644 index 00000000..5aa715db --- /dev/null +++ b/capten/common-pkg/capten-store/plugin_store_config_store.go @@ -0,0 +1,56 @@ +package captenstore + +import ( + "fmt" + "time" + + "github.com/google/uuid" + "github.com/kube-tarian/kad/capten/common-pkg/gerrors" + "github.com/kube-tarian/kad/capten/common-pkg/pb/pluginstorepb" + postgresdb "github.com/kube-tarian/kad/capten/common-pkg/postgres" +) + +func (a *Store) UpsertPluginStoreConfig(config *pluginstorepb.PluginStoreConfig) error { + pluginStoreConfig := &PluginStoreConfig{} + recordFound := true + err := a.dbClient.Find(pluginStoreConfig, PluginStoreConfig{StoreType: int(config.StoreType)}) + if err != nil { + if gerrors.GetErrorType(err) != postgresdb.ObjectNotExist { + return prepareError(err, fmt.Sprintf("%d", config.StoreType), "Fetch") + } + err = nil + recordFound = false + } else if pluginStoreConfig.StoreType == 0 { + recordFound = false + } + + pluginStoreConfig.StoreType = int(config.StoreType) + pluginStoreConfig.GitProjectID = uuid.MustParse(config.GitProjectId) + pluginStoreConfig.GitProjectURL = config.GitProjectURL + pluginStoreConfig.LastUpdateTime = time.Now() + + if !recordFound { + err = a.dbClient.Create(pluginStoreConfig) + } else { + err = a.dbClient.Update(pluginStoreConfig, PluginStoreConfig{StoreType: int(config.StoreType)}) + } + return err +} + +func (a *Store) GetPluginStoreConfig(storeType pluginstorepb.StoreType) (*pluginstorepb.PluginStoreConfig, error) { + pluginStoreConfig := &PluginStoreConfig{} + err := a.dbClient.Find(pluginStoreConfig, PluginStoreConfig{StoreType: int(storeType)}) + if err != nil { + return nil, prepareError(err, fmt.Sprintf("%d", storeType), "Fetch") + } + + return &pluginstorepb.PluginStoreConfig{ + StoreType: pluginstorepb.StoreType(pluginStoreConfig.StoreType), + GitProjectId: pluginStoreConfig.GitProjectID.String(), + GitProjectURL: pluginStoreConfig.GitProjectURL, + }, nil +} + +func (a *Store) DeletePluginStoreConfig(storeType pluginstorepb.StoreType) error { + return a.dbClient.Delete(PluginStoreConfig{}, PluginStoreConfig{StoreType: int(storeType)}) +} diff --git a/capten/common-pkg/capten-store/plugin_store_date_store.go b/capten/common-pkg/capten-store/plugin_store_date_store.go new file mode 100644 index 00000000..293ff323 --- /dev/null +++ b/capten/common-pkg/capten-store/plugin_store_date_store.go @@ -0,0 +1,103 @@ +package captenstore + +import ( + "fmt" + "time" + + "github.com/google/uuid" + "github.com/kube-tarian/kad/capten/common-pkg/gerrors" + "github.com/kube-tarian/kad/capten/common-pkg/pb/pluginstorepb" + postgresdb "github.com/kube-tarian/kad/capten/common-pkg/postgres" + "gorm.io/gorm" +) + +func (a *Store) UpsertPluginStoreData(gitProjectID string, pluginData *pluginstorepb.PluginData) error { + pluginStoreData := &PluginStoreData{} + recordFound := true + err := a.dbClient.Find(pluginStoreData, PluginStoreData{ + StoreType: int(pluginData.StoreType), + GitProjectID: uuid.MustParse(gitProjectID), + PluginName: pluginData.PluginName}) + if err != nil { + if gerrors.GetErrorType(err) != postgresdb.ObjectNotExist { + return prepareError(err, fmt.Sprintf("%d/%s/%s", + pluginData.StoreType, gitProjectID, pluginData.PluginName), "Fetch") + } + err = nil + recordFound = false + } else if pluginStoreData.StoreType == 0 { + recordFound = false + } + + pluginStoreData.StoreType = int(pluginData.StoreType) + pluginStoreData.GitProjectID = uuid.MustParse(gitProjectID) + pluginStoreData.PluginName = pluginData.PluginName + pluginStoreData.Category = pluginData.Category + pluginStoreData.Versions = pluginData.Versions + pluginStoreData.Icon = pluginData.Icon + pluginStoreData.Description = pluginData.Description + pluginStoreData.LastUpdateTime = time.Now() + + if !recordFound { + err = a.dbClient.Create(pluginStoreData) + } else { + err = a.dbClient.Update(pluginStoreData, PluginStoreData{ + StoreType: int(pluginData.StoreType), + GitProjectID: uuid.MustParse(gitProjectID), + PluginName: pluginData.PluginName}) + } + return err +} + +func (a *Store) GetPluginStoreData(storeType pluginstorepb.StoreType, gitProjectId, pluginName string) (*pluginstorepb.PluginData, error) { + pluginStoreData := &PluginStoreData{} + err := a.dbClient.Find(pluginStoreData, PluginStoreData{ + StoreType: int(storeType), + GitProjectID: uuid.MustParse(gitProjectId), + PluginName: pluginName, + }) + if err != nil { + return nil, prepareError(err, fmt.Sprintf("%s/%s/%s", gitProjectId, gitProjectId, pluginName), "Fetch") + } else if pluginStoreData.StoreType == 0 { + return nil, gorm.ErrRecordNotFound + } + + pluginData := &pluginstorepb.PluginData{ + StoreType: pluginstorepb.StoreType(pluginStoreData.StoreType), + PluginName: pluginStoreData.PluginName, + Category: pluginStoreData.Category, + Versions: pluginStoreData.Versions, + Icon: pluginStoreData.Icon, + Description: pluginStoreData.Description, + } + return pluginData, nil +} + +func (a *Store) GetPlugins(gitProjectId string) ([]*pluginstorepb.Plugin, error) { + pluginDataSet := []PluginStoreData{} + err := a.dbClient.Find(&pluginDataSet, PluginStoreData{GitProjectID: uuid.MustParse(gitProjectId)}) + if err != nil { + return nil, prepareError(err, gitProjectId, "Fetch") + } + + plugins := []*pluginstorepb.Plugin{} + for _, pluginData := range pluginDataSet { + plugins = append(plugins, &pluginstorepb.Plugin{ + StoreType: pluginstorepb.StoreType(pluginData.StoreType), + PluginName: pluginData.PluginName, + Category: pluginData.Category, + Versions: pluginData.Versions, + Icon: pluginData.Icon, + Description: pluginData.Description, + }) + } + return plugins, nil +} +func (a *Store) DeletePluginStoreData(storeType pluginstorepb.StoreType, gitProjectId, pluginName string) error { + err := a.dbClient.Delete(PluginStoreData{}, PluginStoreData{ + StoreType: int(storeType), + GitProjectID: uuid.MustParse(gitProjectId), + PluginName: pluginName, + }) + return err +} diff --git a/capten/common-pkg/pb/pluginstorepb/plugin_store.pb.go b/capten/common-pkg/pb/pluginstorepb/plugin_store.pb.go new file mode 100644 index 00000000..8efd2cd4 --- /dev/null +++ b/capten/common-pkg/pb/pluginstorepb/plugin_store.pb.go @@ -0,0 +1,1835 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.1 +// protoc v5.26.1 +// source: plugin_store.proto + +package pluginstorepb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type StatusCode int32 + +const ( + StatusCode_OK StatusCode = 0 + StatusCode_INTERNRAL_ERROR StatusCode = 1 + StatusCode_INVALID_ARGUMENT StatusCode = 2 + StatusCode_NOT_FOUND StatusCode = 3 +) + +// Enum value maps for StatusCode. +var ( + StatusCode_name = map[int32]string{ + 0: "OK", + 1: "INTERNRAL_ERROR", + 2: "INVALID_ARGUMENT", + 3: "NOT_FOUND", + } + StatusCode_value = map[string]int32{ + "OK": 0, + "INTERNRAL_ERROR": 1, + "INVALID_ARGUMENT": 2, + "NOT_FOUND": 3, + } +) + +func (x StatusCode) Enum() *StatusCode { + p := new(StatusCode) + *p = x + return p +} + +func (x StatusCode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (StatusCode) Descriptor() protoreflect.EnumDescriptor { + return file_plugin_store_proto_enumTypes[0].Descriptor() +} + +func (StatusCode) Type() protoreflect.EnumType { + return &file_plugin_store_proto_enumTypes[0] +} + +func (x StatusCode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use StatusCode.Descriptor instead. +func (StatusCode) EnumDescriptor() ([]byte, []int) { + return file_plugin_store_proto_rawDescGZIP(), []int{0} +} + +type StoreType int32 + +const ( + StoreType_NONE StoreType = 0 + StoreType_CENTRAL_STORE StoreType = 1 + StoreType_LOCAL_STORE StoreType = 2 + StoreType_DEFAULT_STORE StoreType = 3 +) + +// Enum value maps for StoreType. +var ( + StoreType_name = map[int32]string{ + 0: "NONE", + 1: "CENTRAL_STORE", + 2: "LOCAL_STORE", + 3: "DEFAULT_STORE", + } + StoreType_value = map[string]int32{ + "NONE": 0, + "CENTRAL_STORE": 1, + "LOCAL_STORE": 2, + "DEFAULT_STORE": 3, + } +) + +func (x StoreType) Enum() *StoreType { + p := new(StoreType) + *p = x + return p +} + +func (x StoreType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (StoreType) Descriptor() protoreflect.EnumDescriptor { + return file_plugin_store_proto_enumTypes[1].Descriptor() +} + +func (StoreType) Type() protoreflect.EnumType { + return &file_plugin_store_proto_enumTypes[1] +} + +func (x StoreType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use StoreType.Descriptor instead. +func (StoreType) EnumDescriptor() ([]byte, []int) { + return file_plugin_store_proto_rawDescGZIP(), []int{1} +} + +type PluginStoreConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StoreType StoreType `protobuf:"varint,1,opt,name=storeType,proto3,enum=pluginstorepb.StoreType" json:"storeType,omitempty"` + GitProjectId string `protobuf:"bytes,2,opt,name=gitProjectId,proto3" json:"gitProjectId,omitempty"` + GitProjectURL string `protobuf:"bytes,3,opt,name=gitProjectURL,proto3" json:"gitProjectURL,omitempty"` +} + +func (x *PluginStoreConfig) Reset() { + *x = PluginStoreConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_store_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PluginStoreConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PluginStoreConfig) ProtoMessage() {} + +func (x *PluginStoreConfig) ProtoReflect() protoreflect.Message { + mi := &file_plugin_store_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PluginStoreConfig.ProtoReflect.Descriptor instead. +func (*PluginStoreConfig) Descriptor() ([]byte, []int) { + return file_plugin_store_proto_rawDescGZIP(), []int{0} +} + +func (x *PluginStoreConfig) GetStoreType() StoreType { + if x != nil { + return x.StoreType + } + return StoreType_NONE +} + +func (x *PluginStoreConfig) GetGitProjectId() string { + if x != nil { + return x.GitProjectId + } + return "" +} + +func (x *PluginStoreConfig) GetGitProjectURL() string { + if x != nil { + return x.GitProjectURL + } + return "" +} + +type Plugin struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StoreType StoreType `protobuf:"varint,1,opt,name=storeType,proto3,enum=pluginstorepb.StoreType" json:"storeType,omitempty"` + PluginName string `protobuf:"bytes,2,opt,name=pluginName,proto3" json:"pluginName,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Category string `protobuf:"bytes,4,opt,name=category,proto3" json:"category,omitempty"` + Versions []string `protobuf:"bytes,5,rep,name=versions,proto3" json:"versions,omitempty"` + Icon []byte `protobuf:"bytes,6,opt,name=icon,proto3" json:"icon,omitempty"` +} + +func (x *Plugin) Reset() { + *x = Plugin{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_store_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Plugin) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Plugin) ProtoMessage() {} + +func (x *Plugin) ProtoReflect() protoreflect.Message { + mi := &file_plugin_store_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Plugin.ProtoReflect.Descriptor instead. +func (*Plugin) Descriptor() ([]byte, []int) { + return file_plugin_store_proto_rawDescGZIP(), []int{1} +} + +func (x *Plugin) GetStoreType() StoreType { + if x != nil { + return x.StoreType + } + return StoreType_NONE +} + +func (x *Plugin) GetPluginName() string { + if x != nil { + return x.PluginName + } + return "" +} + +func (x *Plugin) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Plugin) GetCategory() string { + if x != nil { + return x.Category + } + return "" +} + +func (x *Plugin) GetVersions() []string { + if x != nil { + return x.Versions + } + return nil +} + +func (x *Plugin) GetIcon() []byte { + if x != nil { + return x.Icon + } + return nil +} + +type PluginData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StoreType StoreType `protobuf:"varint,1,opt,name=storeType,proto3,enum=pluginstorepb.StoreType" json:"storeType,omitempty"` + PluginName string `protobuf:"bytes,2,opt,name=pluginName,proto3" json:"pluginName,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Category string `protobuf:"bytes,4,opt,name=category,proto3" json:"category,omitempty"` + Versions []string `protobuf:"bytes,5,rep,name=versions,proto3" json:"versions,omitempty"` + Icon []byte `protobuf:"bytes,6,opt,name=icon,proto3" json:"icon,omitempty"` +} + +func (x *PluginData) Reset() { + *x = PluginData{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_store_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PluginData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PluginData) ProtoMessage() {} + +func (x *PluginData) ProtoReflect() protoreflect.Message { + mi := &file_plugin_store_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PluginData.ProtoReflect.Descriptor instead. +func (*PluginData) Descriptor() ([]byte, []int) { + return file_plugin_store_proto_rawDescGZIP(), []int{2} +} + +func (x *PluginData) GetStoreType() StoreType { + if x != nil { + return x.StoreType + } + return StoreType_NONE +} + +func (x *PluginData) GetPluginName() string { + if x != nil { + return x.PluginName + } + return "" +} + +func (x *PluginData) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *PluginData) GetCategory() string { + if x != nil { + return x.Category + } + return "" +} + +func (x *PluginData) GetVersions() []string { + if x != nil { + return x.Versions + } + return nil +} + +func (x *PluginData) GetIcon() []byte { + if x != nil { + return x.Icon + } + return nil +} + +type ConfigurePluginStoreRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Config *PluginStoreConfig `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` +} + +func (x *ConfigurePluginStoreRequest) Reset() { + *x = ConfigurePluginStoreRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_store_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConfigurePluginStoreRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfigurePluginStoreRequest) ProtoMessage() {} + +func (x *ConfigurePluginStoreRequest) ProtoReflect() protoreflect.Message { + mi := &file_plugin_store_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConfigurePluginStoreRequest.ProtoReflect.Descriptor instead. +func (*ConfigurePluginStoreRequest) Descriptor() ([]byte, []int) { + return file_plugin_store_proto_rawDescGZIP(), []int{3} +} + +func (x *ConfigurePluginStoreRequest) GetConfig() *PluginStoreConfig { + if x != nil { + return x.Config + } + return nil +} + +type ConfigurePluginStoreResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status StatusCode `protobuf:"varint,1,opt,name=status,proto3,enum=pluginstorepb.StatusCode" json:"status,omitempty"` + StatusMessage string `protobuf:"bytes,2,opt,name=statusMessage,proto3" json:"statusMessage,omitempty"` +} + +func (x *ConfigurePluginStoreResponse) Reset() { + *x = ConfigurePluginStoreResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_store_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConfigurePluginStoreResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfigurePluginStoreResponse) ProtoMessage() {} + +func (x *ConfigurePluginStoreResponse) ProtoReflect() protoreflect.Message { + mi := &file_plugin_store_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConfigurePluginStoreResponse.ProtoReflect.Descriptor instead. +func (*ConfigurePluginStoreResponse) Descriptor() ([]byte, []int) { + return file_plugin_store_proto_rawDescGZIP(), []int{4} +} + +func (x *ConfigurePluginStoreResponse) GetStatus() StatusCode { + if x != nil { + return x.Status + } + return StatusCode_OK +} + +func (x *ConfigurePluginStoreResponse) GetStatusMessage() string { + if x != nil { + return x.StatusMessage + } + return "" +} + +type GetPluginStoreConfigRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StoreType StoreType `protobuf:"varint,1,opt,name=storeType,proto3,enum=pluginstorepb.StoreType" json:"storeType,omitempty"` +} + +func (x *GetPluginStoreConfigRequest) Reset() { + *x = GetPluginStoreConfigRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_store_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetPluginStoreConfigRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPluginStoreConfigRequest) ProtoMessage() {} + +func (x *GetPluginStoreConfigRequest) ProtoReflect() protoreflect.Message { + mi := &file_plugin_store_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetPluginStoreConfigRequest.ProtoReflect.Descriptor instead. +func (*GetPluginStoreConfigRequest) Descriptor() ([]byte, []int) { + return file_plugin_store_proto_rawDescGZIP(), []int{5} +} + +func (x *GetPluginStoreConfigRequest) GetStoreType() StoreType { + if x != nil { + return x.StoreType + } + return StoreType_NONE +} + +type GetPluginStoreConfigResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status StatusCode `protobuf:"varint,1,opt,name=status,proto3,enum=pluginstorepb.StatusCode" json:"status,omitempty"` + StatusMessage string `protobuf:"bytes,2,opt,name=statusMessage,proto3" json:"statusMessage,omitempty"` + Config *PluginStoreConfig `protobuf:"bytes,3,opt,name=config,proto3" json:"config,omitempty"` +} + +func (x *GetPluginStoreConfigResponse) Reset() { + *x = GetPluginStoreConfigResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_store_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetPluginStoreConfigResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPluginStoreConfigResponse) ProtoMessage() {} + +func (x *GetPluginStoreConfigResponse) ProtoReflect() protoreflect.Message { + mi := &file_plugin_store_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetPluginStoreConfigResponse.ProtoReflect.Descriptor instead. +func (*GetPluginStoreConfigResponse) Descriptor() ([]byte, []int) { + return file_plugin_store_proto_rawDescGZIP(), []int{6} +} + +func (x *GetPluginStoreConfigResponse) GetStatus() StatusCode { + if x != nil { + return x.Status + } + return StatusCode_OK +} + +func (x *GetPluginStoreConfigResponse) GetStatusMessage() string { + if x != nil { + return x.StatusMessage + } + return "" +} + +func (x *GetPluginStoreConfigResponse) GetConfig() *PluginStoreConfig { + if x != nil { + return x.Config + } + return nil +} + +type SyncPluginStoreRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StoreType StoreType `protobuf:"varint,1,opt,name=storeType,proto3,enum=pluginstorepb.StoreType" json:"storeType,omitempty"` +} + +func (x *SyncPluginStoreRequest) Reset() { + *x = SyncPluginStoreRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_store_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncPluginStoreRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncPluginStoreRequest) ProtoMessage() {} + +func (x *SyncPluginStoreRequest) ProtoReflect() protoreflect.Message { + mi := &file_plugin_store_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyncPluginStoreRequest.ProtoReflect.Descriptor instead. +func (*SyncPluginStoreRequest) Descriptor() ([]byte, []int) { + return file_plugin_store_proto_rawDescGZIP(), []int{7} +} + +func (x *SyncPluginStoreRequest) GetStoreType() StoreType { + if x != nil { + return x.StoreType + } + return StoreType_NONE +} + +type SyncPluginStoreResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status StatusCode `protobuf:"varint,1,opt,name=status,proto3,enum=pluginstorepb.StatusCode" json:"status,omitempty"` + StatusMessage string `protobuf:"bytes,2,opt,name=statusMessage,proto3" json:"statusMessage,omitempty"` +} + +func (x *SyncPluginStoreResponse) Reset() { + *x = SyncPluginStoreResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_store_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncPluginStoreResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncPluginStoreResponse) ProtoMessage() {} + +func (x *SyncPluginStoreResponse) ProtoReflect() protoreflect.Message { + mi := &file_plugin_store_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyncPluginStoreResponse.ProtoReflect.Descriptor instead. +func (*SyncPluginStoreResponse) Descriptor() ([]byte, []int) { + return file_plugin_store_proto_rawDescGZIP(), []int{8} +} + +func (x *SyncPluginStoreResponse) GetStatus() StatusCode { + if x != nil { + return x.Status + } + return StatusCode_OK +} + +func (x *SyncPluginStoreResponse) GetStatusMessage() string { + if x != nil { + return x.StatusMessage + } + return "" +} + +type GetPluginsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StoreType StoreType `protobuf:"varint,1,opt,name=storeType,proto3,enum=pluginstorepb.StoreType" json:"storeType,omitempty"` +} + +func (x *GetPluginsRequest) Reset() { + *x = GetPluginsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_store_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetPluginsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPluginsRequest) ProtoMessage() {} + +func (x *GetPluginsRequest) ProtoReflect() protoreflect.Message { + mi := &file_plugin_store_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetPluginsRequest.ProtoReflect.Descriptor instead. +func (*GetPluginsRequest) Descriptor() ([]byte, []int) { + return file_plugin_store_proto_rawDescGZIP(), []int{9} +} + +func (x *GetPluginsRequest) GetStoreType() StoreType { + if x != nil { + return x.StoreType + } + return StoreType_NONE +} + +type GetPluginsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status StatusCode `protobuf:"varint,1,opt,name=status,proto3,enum=pluginstorepb.StatusCode" json:"status,omitempty"` + StatusMessage string `protobuf:"bytes,2,opt,name=statusMessage,proto3" json:"statusMessage,omitempty"` + Plugins []*Plugin `protobuf:"bytes,3,rep,name=plugins,proto3" json:"plugins,omitempty"` +} + +func (x *GetPluginsResponse) Reset() { + *x = GetPluginsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_store_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetPluginsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPluginsResponse) ProtoMessage() {} + +func (x *GetPluginsResponse) ProtoReflect() protoreflect.Message { + mi := &file_plugin_store_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetPluginsResponse.ProtoReflect.Descriptor instead. +func (*GetPluginsResponse) Descriptor() ([]byte, []int) { + return file_plugin_store_proto_rawDescGZIP(), []int{10} +} + +func (x *GetPluginsResponse) GetStatus() StatusCode { + if x != nil { + return x.Status + } + return StatusCode_OK +} + +func (x *GetPluginsResponse) GetStatusMessage() string { + if x != nil { + return x.StatusMessage + } + return "" +} + +func (x *GetPluginsResponse) GetPlugins() []*Plugin { + if x != nil { + return x.Plugins + } + return nil +} + +type GetPluginValuesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StoreType StoreType `protobuf:"varint,1,opt,name=storeType,proto3,enum=pluginstorepb.StoreType" json:"storeType,omitempty"` + PluginName string `protobuf:"bytes,2,opt,name=pluginName,proto3" json:"pluginName,omitempty"` + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` +} + +func (x *GetPluginValuesRequest) Reset() { + *x = GetPluginValuesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_store_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetPluginValuesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPluginValuesRequest) ProtoMessage() {} + +func (x *GetPluginValuesRequest) ProtoReflect() protoreflect.Message { + mi := &file_plugin_store_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetPluginValuesRequest.ProtoReflect.Descriptor instead. +func (*GetPluginValuesRequest) Descriptor() ([]byte, []int) { + return file_plugin_store_proto_rawDescGZIP(), []int{11} +} + +func (x *GetPluginValuesRequest) GetStoreType() StoreType { + if x != nil { + return x.StoreType + } + return StoreType_NONE +} + +func (x *GetPluginValuesRequest) GetPluginName() string { + if x != nil { + return x.PluginName + } + return "" +} + +func (x *GetPluginValuesRequest) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +type GetPluginValuesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status StatusCode `protobuf:"varint,1,opt,name=status,proto3,enum=pluginstorepb.StatusCode" json:"status,omitempty"` + StatusMessage string `protobuf:"bytes,2,opt,name=statusMessage,proto3" json:"statusMessage,omitempty"` + Values []byte `protobuf:"bytes,3,opt,name=values,proto3" json:"values,omitempty"` +} + +func (x *GetPluginValuesResponse) Reset() { + *x = GetPluginValuesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_store_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetPluginValuesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPluginValuesResponse) ProtoMessage() {} + +func (x *GetPluginValuesResponse) ProtoReflect() protoreflect.Message { + mi := &file_plugin_store_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetPluginValuesResponse.ProtoReflect.Descriptor instead. +func (*GetPluginValuesResponse) Descriptor() ([]byte, []int) { + return file_plugin_store_proto_rawDescGZIP(), []int{12} +} + +func (x *GetPluginValuesResponse) GetStatus() StatusCode { + if x != nil { + return x.Status + } + return StatusCode_OK +} + +func (x *GetPluginValuesResponse) GetStatusMessage() string { + if x != nil { + return x.StatusMessage + } + return "" +} + +func (x *GetPluginValuesResponse) GetValues() []byte { + if x != nil { + return x.Values + } + return nil +} + +type GetPluginDataRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StoreType StoreType `protobuf:"varint,1,opt,name=storeType,proto3,enum=pluginstorepb.StoreType" json:"storeType,omitempty"` + PluginName string `protobuf:"bytes,2,opt,name=pluginName,proto3" json:"pluginName,omitempty"` +} + +func (x *GetPluginDataRequest) Reset() { + *x = GetPluginDataRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_store_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetPluginDataRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPluginDataRequest) ProtoMessage() {} + +func (x *GetPluginDataRequest) ProtoReflect() protoreflect.Message { + mi := &file_plugin_store_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetPluginDataRequest.ProtoReflect.Descriptor instead. +func (*GetPluginDataRequest) Descriptor() ([]byte, []int) { + return file_plugin_store_proto_rawDescGZIP(), []int{13} +} + +func (x *GetPluginDataRequest) GetStoreType() StoreType { + if x != nil { + return x.StoreType + } + return StoreType_NONE +} + +func (x *GetPluginDataRequest) GetPluginName() string { + if x != nil { + return x.PluginName + } + return "" +} + +type GetPluginDataResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status StatusCode `protobuf:"varint,1,opt,name=status,proto3,enum=pluginstorepb.StatusCode" json:"status,omitempty"` + StatusMessage string `protobuf:"bytes,2,opt,name=statusMessage,proto3" json:"statusMessage,omitempty"` + PluginData *PluginData `protobuf:"bytes,3,opt,name=pluginData,proto3" json:"pluginData,omitempty"` +} + +func (x *GetPluginDataResponse) Reset() { + *x = GetPluginDataResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_store_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetPluginDataResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPluginDataResponse) ProtoMessage() {} + +func (x *GetPluginDataResponse) ProtoReflect() protoreflect.Message { + mi := &file_plugin_store_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetPluginDataResponse.ProtoReflect.Descriptor instead. +func (*GetPluginDataResponse) Descriptor() ([]byte, []int) { + return file_plugin_store_proto_rawDescGZIP(), []int{14} +} + +func (x *GetPluginDataResponse) GetStatus() StatusCode { + if x != nil { + return x.Status + } + return StatusCode_OK +} + +func (x *GetPluginDataResponse) GetStatusMessage() string { + if x != nil { + return x.StatusMessage + } + return "" +} + +func (x *GetPluginDataResponse) GetPluginData() *PluginData { + if x != nil { + return x.PluginData + } + return nil +} + +type DeployPluginRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StoreType StoreType `protobuf:"varint,1,opt,name=storeType,proto3,enum=pluginstorepb.StoreType" json:"storeType,omitempty"` + PluginName string `protobuf:"bytes,2,opt,name=pluginName,proto3" json:"pluginName,omitempty"` + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + Values []byte `protobuf:"bytes,4,opt,name=values,proto3" json:"values,omitempty"` +} + +func (x *DeployPluginRequest) Reset() { + *x = DeployPluginRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_store_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeployPluginRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeployPluginRequest) ProtoMessage() {} + +func (x *DeployPluginRequest) ProtoReflect() protoreflect.Message { + mi := &file_plugin_store_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeployPluginRequest.ProtoReflect.Descriptor instead. +func (*DeployPluginRequest) Descriptor() ([]byte, []int) { + return file_plugin_store_proto_rawDescGZIP(), []int{15} +} + +func (x *DeployPluginRequest) GetStoreType() StoreType { + if x != nil { + return x.StoreType + } + return StoreType_NONE +} + +func (x *DeployPluginRequest) GetPluginName() string { + if x != nil { + return x.PluginName + } + return "" +} + +func (x *DeployPluginRequest) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *DeployPluginRequest) GetValues() []byte { + if x != nil { + return x.Values + } + return nil +} + +type DeployPluginResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status StatusCode `protobuf:"varint,1,opt,name=status,proto3,enum=pluginstorepb.StatusCode" json:"status,omitempty"` + StatusMessage string `protobuf:"bytes,2,opt,name=statusMessage,proto3" json:"statusMessage,omitempty"` +} + +func (x *DeployPluginResponse) Reset() { + *x = DeployPluginResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_store_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeployPluginResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeployPluginResponse) ProtoMessage() {} + +func (x *DeployPluginResponse) ProtoReflect() protoreflect.Message { + mi := &file_plugin_store_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeployPluginResponse.ProtoReflect.Descriptor instead. +func (*DeployPluginResponse) Descriptor() ([]byte, []int) { + return file_plugin_store_proto_rawDescGZIP(), []int{16} +} + +func (x *DeployPluginResponse) GetStatus() StatusCode { + if x != nil { + return x.Status + } + return StatusCode_OK +} + +func (x *DeployPluginResponse) GetStatusMessage() string { + if x != nil { + return x.StatusMessage + } + return "" +} + +type UnDeployPluginRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StoreType StoreType `protobuf:"varint,1,opt,name=storeType,proto3,enum=pluginstorepb.StoreType" json:"storeType,omitempty"` + PluginName string `protobuf:"bytes,2,opt,name=pluginName,proto3" json:"pluginName,omitempty"` +} + +func (x *UnDeployPluginRequest) Reset() { + *x = UnDeployPluginRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_store_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UnDeployPluginRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnDeployPluginRequest) ProtoMessage() {} + +func (x *UnDeployPluginRequest) ProtoReflect() protoreflect.Message { + mi := &file_plugin_store_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UnDeployPluginRequest.ProtoReflect.Descriptor instead. +func (*UnDeployPluginRequest) Descriptor() ([]byte, []int) { + return file_plugin_store_proto_rawDescGZIP(), []int{17} +} + +func (x *UnDeployPluginRequest) GetStoreType() StoreType { + if x != nil { + return x.StoreType + } + return StoreType_NONE +} + +func (x *UnDeployPluginRequest) GetPluginName() string { + if x != nil { + return x.PluginName + } + return "" +} + +type UnDeployPluginResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status StatusCode `protobuf:"varint,1,opt,name=status,proto3,enum=pluginstorepb.StatusCode" json:"status,omitempty"` + StatusMessage string `protobuf:"bytes,2,opt,name=statusMessage,proto3" json:"statusMessage,omitempty"` +} + +func (x *UnDeployPluginResponse) Reset() { + *x = UnDeployPluginResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_store_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UnDeployPluginResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnDeployPluginResponse) ProtoMessage() {} + +func (x *UnDeployPluginResponse) ProtoReflect() protoreflect.Message { + mi := &file_plugin_store_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UnDeployPluginResponse.ProtoReflect.Descriptor instead. +func (*UnDeployPluginResponse) Descriptor() ([]byte, []int) { + return file_plugin_store_proto_rawDescGZIP(), []int{18} +} + +func (x *UnDeployPluginResponse) GetStatus() StatusCode { + if x != nil { + return x.Status + } + return StatusCode_OK +} + +func (x *UnDeployPluginResponse) GetStatusMessage() string { + if x != nil { + return x.StatusMessage + } + return "" +} + +var File_plugin_store_proto protoreflect.FileDescriptor + +var file_plugin_store_proto_rawDesc = []byte{ + 0x0a, 0x12, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x70, 0x62, 0x22, 0x95, 0x01, 0x0a, 0x11, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x74, + 0x6f, 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x36, 0x0a, 0x09, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, + 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x67, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x67, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x67, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x55, 0x52, 0x4c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x67, 0x69, + 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x55, 0x52, 0x4c, 0x22, 0xce, 0x01, 0x0a, 0x06, + 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x36, 0x0a, 0x09, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x54, + 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x70, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x54, + 0x79, 0x70, 0x65, 0x52, 0x09, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, + 0x0a, 0x0a, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, + 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x1a, 0x0a, 0x08, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x22, 0xd2, 0x01, 0x0a, + 0x0a, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x36, 0x0a, 0x09, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, + 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x53, + 0x74, 0x6f, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x4e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, + 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, + 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x12, 0x0a, + 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x69, 0x63, 0x6f, + 0x6e, 0x22, 0x57, 0x0a, 0x1b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x50, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x38, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x20, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, + 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x77, 0x0a, 0x1c, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x74, 0x6f, + 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x70, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x24, 0x0a, + 0x0d, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x22, 0x55, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x53, 0x74, 0x6f, 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x36, 0x0a, 0x09, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, + 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, + 0x09, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0xb1, 0x01, 0x0a, 0x1c, 0x47, + 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x70, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x24, + 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x12, 0x38, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x74, 0x6f, 0x72, 0x65, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x50, + 0x0a, 0x16, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x74, 0x6f, 0x72, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x09, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x70, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, + 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, + 0x22, 0x72, 0x0a, 0x17, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x74, + 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x70, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x24, + 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x22, 0x4b, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x09, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, + 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x54, 0x79, 0x70, + 0x65, 0x22, 0x9e, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, + 0x6f, 0x64, 0x65, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x12, 0x2f, 0x0a, 0x07, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x07, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x73, 0x22, 0x8a, 0x01, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, + 0x09, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x18, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, + 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x4e, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, + 0x8a, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x70, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x24, + 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x6e, 0x0a, 0x14, + 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x09, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x54, 0x79, 0x70, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x54, 0x79, 0x70, + 0x65, 0x52, 0x09, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a, + 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0xab, 0x01, 0x0a, + 0x15, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, + 0x65, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0d, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, + 0x39, 0x0a, 0x0a, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0a, + 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x22, 0x9f, 0x01, 0x0a, 0x13, 0x44, + 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x36, 0x0a, 0x09, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, + 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, + 0x09, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x6f, 0x0a, 0x14, + 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x52, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x6f, 0x0a, + 0x15, 0x55, 0x6e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x09, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x54, + 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x70, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x54, + 0x79, 0x70, 0x65, 0x52, 0x09, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, + 0x0a, 0x0a, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x71, + 0x0a, 0x16, 0x55, 0x6e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, + 0x6f, 0x64, 0x65, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x2a, 0x4e, 0x0a, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, + 0x06, 0x0a, 0x02, 0x4f, 0x4b, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x49, 0x4e, 0x54, 0x45, 0x52, + 0x4e, 0x52, 0x41, 0x4c, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, + 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x41, 0x52, 0x47, 0x55, 0x4d, 0x45, 0x4e, 0x54, + 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, + 0x03, 0x2a, 0x4c, 0x0a, 0x09, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, + 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x45, 0x4e, 0x54, + 0x52, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x4f, 0x52, 0x45, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x4c, + 0x4f, 0x43, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x4f, 0x52, 0x45, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, + 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x5f, 0x53, 0x54, 0x4f, 0x52, 0x45, 0x10, 0x03, 0x32, + 0xaa, 0x06, 0x0a, 0x0b, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, + 0x71, 0x0a, 0x14, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x50, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x2a, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, + 0x65, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x50, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x71, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, + 0x74, 0x6f, 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2a, 0x2e, 0x70, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x53, 0x74, 0x6f, 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x62, 0x0a, 0x0f, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x25, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x26, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, + 0x53, 0x79, 0x6e, 0x63, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x53, 0x0a, 0x0a, 0x47, 0x65, 0x74, + 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x12, 0x20, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x70, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x62, + 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x12, 0x25, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, + 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x5c, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x44, + 0x61, 0x74, 0x61, 0x12, 0x23, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x44, 0x61, 0x74, + 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x59, 0x0a, 0x0c, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x12, 0x22, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, + 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x50, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5f, 0x0a, 0x0e, 0x55, + 0x6e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x24, 0x2e, + 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x55, 0x6e, + 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x70, 0x62, 0x2e, 0x55, 0x6e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x50, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x10, 0x5a, 0x0e, + 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_plugin_store_proto_rawDescOnce sync.Once + file_plugin_store_proto_rawDescData = file_plugin_store_proto_rawDesc +) + +func file_plugin_store_proto_rawDescGZIP() []byte { + file_plugin_store_proto_rawDescOnce.Do(func() { + file_plugin_store_proto_rawDescData = protoimpl.X.CompressGZIP(file_plugin_store_proto_rawDescData) + }) + return file_plugin_store_proto_rawDescData +} + +var file_plugin_store_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_plugin_store_proto_msgTypes = make([]protoimpl.MessageInfo, 19) +var file_plugin_store_proto_goTypes = []interface{}{ + (StatusCode)(0), // 0: pluginstorepb.StatusCode + (StoreType)(0), // 1: pluginstorepb.StoreType + (*PluginStoreConfig)(nil), // 2: pluginstorepb.PluginStoreConfig + (*Plugin)(nil), // 3: pluginstorepb.Plugin + (*PluginData)(nil), // 4: pluginstorepb.PluginData + (*ConfigurePluginStoreRequest)(nil), // 5: pluginstorepb.ConfigurePluginStoreRequest + (*ConfigurePluginStoreResponse)(nil), // 6: pluginstorepb.ConfigurePluginStoreResponse + (*GetPluginStoreConfigRequest)(nil), // 7: pluginstorepb.GetPluginStoreConfigRequest + (*GetPluginStoreConfigResponse)(nil), // 8: pluginstorepb.GetPluginStoreConfigResponse + (*SyncPluginStoreRequest)(nil), // 9: pluginstorepb.SyncPluginStoreRequest + (*SyncPluginStoreResponse)(nil), // 10: pluginstorepb.SyncPluginStoreResponse + (*GetPluginsRequest)(nil), // 11: pluginstorepb.GetPluginsRequest + (*GetPluginsResponse)(nil), // 12: pluginstorepb.GetPluginsResponse + (*GetPluginValuesRequest)(nil), // 13: pluginstorepb.GetPluginValuesRequest + (*GetPluginValuesResponse)(nil), // 14: pluginstorepb.GetPluginValuesResponse + (*GetPluginDataRequest)(nil), // 15: pluginstorepb.GetPluginDataRequest + (*GetPluginDataResponse)(nil), // 16: pluginstorepb.GetPluginDataResponse + (*DeployPluginRequest)(nil), // 17: pluginstorepb.DeployPluginRequest + (*DeployPluginResponse)(nil), // 18: pluginstorepb.DeployPluginResponse + (*UnDeployPluginRequest)(nil), // 19: pluginstorepb.UnDeployPluginRequest + (*UnDeployPluginResponse)(nil), // 20: pluginstorepb.UnDeployPluginResponse +} +var file_plugin_store_proto_depIdxs = []int32{ + 1, // 0: pluginstorepb.PluginStoreConfig.storeType:type_name -> pluginstorepb.StoreType + 1, // 1: pluginstorepb.Plugin.storeType:type_name -> pluginstorepb.StoreType + 1, // 2: pluginstorepb.PluginData.storeType:type_name -> pluginstorepb.StoreType + 2, // 3: pluginstorepb.ConfigurePluginStoreRequest.config:type_name -> pluginstorepb.PluginStoreConfig + 0, // 4: pluginstorepb.ConfigurePluginStoreResponse.status:type_name -> pluginstorepb.StatusCode + 1, // 5: pluginstorepb.GetPluginStoreConfigRequest.storeType:type_name -> pluginstorepb.StoreType + 0, // 6: pluginstorepb.GetPluginStoreConfigResponse.status:type_name -> pluginstorepb.StatusCode + 2, // 7: pluginstorepb.GetPluginStoreConfigResponse.config:type_name -> pluginstorepb.PluginStoreConfig + 1, // 8: pluginstorepb.SyncPluginStoreRequest.storeType:type_name -> pluginstorepb.StoreType + 0, // 9: pluginstorepb.SyncPluginStoreResponse.status:type_name -> pluginstorepb.StatusCode + 1, // 10: pluginstorepb.GetPluginsRequest.storeType:type_name -> pluginstorepb.StoreType + 0, // 11: pluginstorepb.GetPluginsResponse.status:type_name -> pluginstorepb.StatusCode + 3, // 12: pluginstorepb.GetPluginsResponse.plugins:type_name -> pluginstorepb.Plugin + 1, // 13: pluginstorepb.GetPluginValuesRequest.storeType:type_name -> pluginstorepb.StoreType + 0, // 14: pluginstorepb.GetPluginValuesResponse.status:type_name -> pluginstorepb.StatusCode + 1, // 15: pluginstorepb.GetPluginDataRequest.storeType:type_name -> pluginstorepb.StoreType + 0, // 16: pluginstorepb.GetPluginDataResponse.status:type_name -> pluginstorepb.StatusCode + 4, // 17: pluginstorepb.GetPluginDataResponse.pluginData:type_name -> pluginstorepb.PluginData + 1, // 18: pluginstorepb.DeployPluginRequest.storeType:type_name -> pluginstorepb.StoreType + 0, // 19: pluginstorepb.DeployPluginResponse.status:type_name -> pluginstorepb.StatusCode + 1, // 20: pluginstorepb.UnDeployPluginRequest.storeType:type_name -> pluginstorepb.StoreType + 0, // 21: pluginstorepb.UnDeployPluginResponse.status:type_name -> pluginstorepb.StatusCode + 5, // 22: pluginstorepb.PluginStore.ConfigurePluginStore:input_type -> pluginstorepb.ConfigurePluginStoreRequest + 7, // 23: pluginstorepb.PluginStore.GetPluginStoreConfig:input_type -> pluginstorepb.GetPluginStoreConfigRequest + 9, // 24: pluginstorepb.PluginStore.SyncPluginStore:input_type -> pluginstorepb.SyncPluginStoreRequest + 11, // 25: pluginstorepb.PluginStore.GetPlugins:input_type -> pluginstorepb.GetPluginsRequest + 13, // 26: pluginstorepb.PluginStore.GetPluginValues:input_type -> pluginstorepb.GetPluginValuesRequest + 15, // 27: pluginstorepb.PluginStore.GetPluginData:input_type -> pluginstorepb.GetPluginDataRequest + 17, // 28: pluginstorepb.PluginStore.DeployPlugin:input_type -> pluginstorepb.DeployPluginRequest + 19, // 29: pluginstorepb.PluginStore.UnDeployPlugin:input_type -> pluginstorepb.UnDeployPluginRequest + 6, // 30: pluginstorepb.PluginStore.ConfigurePluginStore:output_type -> pluginstorepb.ConfigurePluginStoreResponse + 8, // 31: pluginstorepb.PluginStore.GetPluginStoreConfig:output_type -> pluginstorepb.GetPluginStoreConfigResponse + 10, // 32: pluginstorepb.PluginStore.SyncPluginStore:output_type -> pluginstorepb.SyncPluginStoreResponse + 12, // 33: pluginstorepb.PluginStore.GetPlugins:output_type -> pluginstorepb.GetPluginsResponse + 14, // 34: pluginstorepb.PluginStore.GetPluginValues:output_type -> pluginstorepb.GetPluginValuesResponse + 16, // 35: pluginstorepb.PluginStore.GetPluginData:output_type -> pluginstorepb.GetPluginDataResponse + 18, // 36: pluginstorepb.PluginStore.DeployPlugin:output_type -> pluginstorepb.DeployPluginResponse + 20, // 37: pluginstorepb.PluginStore.UnDeployPlugin:output_type -> pluginstorepb.UnDeployPluginResponse + 30, // [30:38] is the sub-list for method output_type + 22, // [22:30] is the sub-list for method input_type + 22, // [22:22] is the sub-list for extension type_name + 22, // [22:22] is the sub-list for extension extendee + 0, // [0:22] is the sub-list for field type_name +} + +func init() { file_plugin_store_proto_init() } +func file_plugin_store_proto_init() { + if File_plugin_store_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_plugin_store_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PluginStoreConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_store_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Plugin); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_store_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PluginData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_store_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConfigurePluginStoreRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_store_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConfigurePluginStoreResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_store_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPluginStoreConfigRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_store_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPluginStoreConfigResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_store_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SyncPluginStoreRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_store_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SyncPluginStoreResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_store_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPluginsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_store_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPluginsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_store_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPluginValuesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_store_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPluginValuesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_store_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPluginDataRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_store_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPluginDataResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_store_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeployPluginRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_store_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeployPluginResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_store_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UnDeployPluginRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_store_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UnDeployPluginResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_plugin_store_proto_rawDesc, + NumEnums: 2, + NumMessages: 19, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_plugin_store_proto_goTypes, + DependencyIndexes: file_plugin_store_proto_depIdxs, + EnumInfos: file_plugin_store_proto_enumTypes, + MessageInfos: file_plugin_store_proto_msgTypes, + }.Build() + File_plugin_store_proto = out.File + file_plugin_store_proto_rawDesc = nil + file_plugin_store_proto_goTypes = nil + file_plugin_store_proto_depIdxs = nil +} diff --git a/capten/common-pkg/pb/pluginstorepb/plugin_store_grpc.pb.go b/capten/common-pkg/pb/pluginstorepb/plugin_store_grpc.pb.go new file mode 100644 index 00000000..6abb3437 --- /dev/null +++ b/capten/common-pkg/pb/pluginstorepb/plugin_store_grpc.pb.go @@ -0,0 +1,368 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v5.26.1 +// source: plugin_store.proto + +package pluginstorepb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + PluginStore_ConfigurePluginStore_FullMethodName = "/pluginstorepb.PluginStore/ConfigurePluginStore" + PluginStore_GetPluginStoreConfig_FullMethodName = "/pluginstorepb.PluginStore/GetPluginStoreConfig" + PluginStore_SyncPluginStore_FullMethodName = "/pluginstorepb.PluginStore/SyncPluginStore" + PluginStore_GetPlugins_FullMethodName = "/pluginstorepb.PluginStore/GetPlugins" + PluginStore_GetPluginValues_FullMethodName = "/pluginstorepb.PluginStore/GetPluginValues" + PluginStore_GetPluginData_FullMethodName = "/pluginstorepb.PluginStore/GetPluginData" + PluginStore_DeployPlugin_FullMethodName = "/pluginstorepb.PluginStore/DeployPlugin" + PluginStore_UnDeployPlugin_FullMethodName = "/pluginstorepb.PluginStore/UnDeployPlugin" +) + +// PluginStoreClient is the client API for PluginStore service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type PluginStoreClient interface { + ConfigurePluginStore(ctx context.Context, in *ConfigurePluginStoreRequest, opts ...grpc.CallOption) (*ConfigurePluginStoreResponse, error) + GetPluginStoreConfig(ctx context.Context, in *GetPluginStoreConfigRequest, opts ...grpc.CallOption) (*GetPluginStoreConfigResponse, error) + SyncPluginStore(ctx context.Context, in *SyncPluginStoreRequest, opts ...grpc.CallOption) (*SyncPluginStoreResponse, error) + GetPlugins(ctx context.Context, in *GetPluginsRequest, opts ...grpc.CallOption) (*GetPluginsResponse, error) + GetPluginValues(ctx context.Context, in *GetPluginValuesRequest, opts ...grpc.CallOption) (*GetPluginValuesResponse, error) + GetPluginData(ctx context.Context, in *GetPluginDataRequest, opts ...grpc.CallOption) (*GetPluginDataResponse, error) + DeployPlugin(ctx context.Context, in *DeployPluginRequest, opts ...grpc.CallOption) (*DeployPluginResponse, error) + UnDeployPlugin(ctx context.Context, in *UnDeployPluginRequest, opts ...grpc.CallOption) (*UnDeployPluginResponse, error) +} + +type pluginStoreClient struct { + cc grpc.ClientConnInterface +} + +func NewPluginStoreClient(cc grpc.ClientConnInterface) PluginStoreClient { + return &pluginStoreClient{cc} +} + +func (c *pluginStoreClient) ConfigurePluginStore(ctx context.Context, in *ConfigurePluginStoreRequest, opts ...grpc.CallOption) (*ConfigurePluginStoreResponse, error) { + out := new(ConfigurePluginStoreResponse) + err := c.cc.Invoke(ctx, PluginStore_ConfigurePluginStore_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pluginStoreClient) GetPluginStoreConfig(ctx context.Context, in *GetPluginStoreConfigRequest, opts ...grpc.CallOption) (*GetPluginStoreConfigResponse, error) { + out := new(GetPluginStoreConfigResponse) + err := c.cc.Invoke(ctx, PluginStore_GetPluginStoreConfig_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pluginStoreClient) SyncPluginStore(ctx context.Context, in *SyncPluginStoreRequest, opts ...grpc.CallOption) (*SyncPluginStoreResponse, error) { + out := new(SyncPluginStoreResponse) + err := c.cc.Invoke(ctx, PluginStore_SyncPluginStore_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pluginStoreClient) GetPlugins(ctx context.Context, in *GetPluginsRequest, opts ...grpc.CallOption) (*GetPluginsResponse, error) { + out := new(GetPluginsResponse) + err := c.cc.Invoke(ctx, PluginStore_GetPlugins_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pluginStoreClient) GetPluginValues(ctx context.Context, in *GetPluginValuesRequest, opts ...grpc.CallOption) (*GetPluginValuesResponse, error) { + out := new(GetPluginValuesResponse) + err := c.cc.Invoke(ctx, PluginStore_GetPluginValues_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pluginStoreClient) GetPluginData(ctx context.Context, in *GetPluginDataRequest, opts ...grpc.CallOption) (*GetPluginDataResponse, error) { + out := new(GetPluginDataResponse) + err := c.cc.Invoke(ctx, PluginStore_GetPluginData_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pluginStoreClient) DeployPlugin(ctx context.Context, in *DeployPluginRequest, opts ...grpc.CallOption) (*DeployPluginResponse, error) { + out := new(DeployPluginResponse) + err := c.cc.Invoke(ctx, PluginStore_DeployPlugin_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pluginStoreClient) UnDeployPlugin(ctx context.Context, in *UnDeployPluginRequest, opts ...grpc.CallOption) (*UnDeployPluginResponse, error) { + out := new(UnDeployPluginResponse) + err := c.cc.Invoke(ctx, PluginStore_UnDeployPlugin_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// PluginStoreServer is the server API for PluginStore service. +// All implementations must embed UnimplementedPluginStoreServer +// for forward compatibility +type PluginStoreServer interface { + ConfigurePluginStore(context.Context, *ConfigurePluginStoreRequest) (*ConfigurePluginStoreResponse, error) + GetPluginStoreConfig(context.Context, *GetPluginStoreConfigRequest) (*GetPluginStoreConfigResponse, error) + SyncPluginStore(context.Context, *SyncPluginStoreRequest) (*SyncPluginStoreResponse, error) + GetPlugins(context.Context, *GetPluginsRequest) (*GetPluginsResponse, error) + GetPluginValues(context.Context, *GetPluginValuesRequest) (*GetPluginValuesResponse, error) + GetPluginData(context.Context, *GetPluginDataRequest) (*GetPluginDataResponse, error) + DeployPlugin(context.Context, *DeployPluginRequest) (*DeployPluginResponse, error) + UnDeployPlugin(context.Context, *UnDeployPluginRequest) (*UnDeployPluginResponse, error) + mustEmbedUnimplementedPluginStoreServer() +} + +// UnimplementedPluginStoreServer must be embedded to have forward compatible implementations. +type UnimplementedPluginStoreServer struct { +} + +func (UnimplementedPluginStoreServer) ConfigurePluginStore(context.Context, *ConfigurePluginStoreRequest) (*ConfigurePluginStoreResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConfigurePluginStore not implemented") +} +func (UnimplementedPluginStoreServer) GetPluginStoreConfig(context.Context, *GetPluginStoreConfigRequest) (*GetPluginStoreConfigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPluginStoreConfig not implemented") +} +func (UnimplementedPluginStoreServer) SyncPluginStore(context.Context, *SyncPluginStoreRequest) (*SyncPluginStoreResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SyncPluginStore not implemented") +} +func (UnimplementedPluginStoreServer) GetPlugins(context.Context, *GetPluginsRequest) (*GetPluginsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPlugins not implemented") +} +func (UnimplementedPluginStoreServer) GetPluginValues(context.Context, *GetPluginValuesRequest) (*GetPluginValuesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPluginValues not implemented") +} +func (UnimplementedPluginStoreServer) GetPluginData(context.Context, *GetPluginDataRequest) (*GetPluginDataResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPluginData not implemented") +} +func (UnimplementedPluginStoreServer) DeployPlugin(context.Context, *DeployPluginRequest) (*DeployPluginResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeployPlugin not implemented") +} +func (UnimplementedPluginStoreServer) UnDeployPlugin(context.Context, *UnDeployPluginRequest) (*UnDeployPluginResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UnDeployPlugin not implemented") +} +func (UnimplementedPluginStoreServer) mustEmbedUnimplementedPluginStoreServer() {} + +// UnsafePluginStoreServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to PluginStoreServer will +// result in compilation errors. +type UnsafePluginStoreServer interface { + mustEmbedUnimplementedPluginStoreServer() +} + +func RegisterPluginStoreServer(s grpc.ServiceRegistrar, srv PluginStoreServer) { + s.RegisterService(&PluginStore_ServiceDesc, srv) +} + +func _PluginStore_ConfigurePluginStore_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ConfigurePluginStoreRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PluginStoreServer).ConfigurePluginStore(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PluginStore_ConfigurePluginStore_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PluginStoreServer).ConfigurePluginStore(ctx, req.(*ConfigurePluginStoreRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PluginStore_GetPluginStoreConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPluginStoreConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PluginStoreServer).GetPluginStoreConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PluginStore_GetPluginStoreConfig_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PluginStoreServer).GetPluginStoreConfig(ctx, req.(*GetPluginStoreConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PluginStore_SyncPluginStore_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SyncPluginStoreRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PluginStoreServer).SyncPluginStore(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PluginStore_SyncPluginStore_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PluginStoreServer).SyncPluginStore(ctx, req.(*SyncPluginStoreRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PluginStore_GetPlugins_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPluginsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PluginStoreServer).GetPlugins(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PluginStore_GetPlugins_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PluginStoreServer).GetPlugins(ctx, req.(*GetPluginsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PluginStore_GetPluginValues_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPluginValuesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PluginStoreServer).GetPluginValues(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PluginStore_GetPluginValues_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PluginStoreServer).GetPluginValues(ctx, req.(*GetPluginValuesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PluginStore_GetPluginData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPluginDataRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PluginStoreServer).GetPluginData(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PluginStore_GetPluginData_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PluginStoreServer).GetPluginData(ctx, req.(*GetPluginDataRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PluginStore_DeployPlugin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeployPluginRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PluginStoreServer).DeployPlugin(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PluginStore_DeployPlugin_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PluginStoreServer).DeployPlugin(ctx, req.(*DeployPluginRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PluginStore_UnDeployPlugin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UnDeployPluginRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PluginStoreServer).UnDeployPlugin(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PluginStore_UnDeployPlugin_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PluginStoreServer).UnDeployPlugin(ctx, req.(*UnDeployPluginRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// PluginStore_ServiceDesc is the grpc.ServiceDesc for PluginStore service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var PluginStore_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pluginstorepb.PluginStore", + HandlerType: (*PluginStoreServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ConfigurePluginStore", + Handler: _PluginStore_ConfigurePluginStore_Handler, + }, + { + MethodName: "GetPluginStoreConfig", + Handler: _PluginStore_GetPluginStoreConfig_Handler, + }, + { + MethodName: "SyncPluginStore", + Handler: _PluginStore_SyncPluginStore_Handler, + }, + { + MethodName: "GetPlugins", + Handler: _PluginStore_GetPlugins_Handler, + }, + { + MethodName: "GetPluginValues", + Handler: _PluginStore_GetPluginValues_Handler, + }, + { + MethodName: "GetPluginData", + Handler: _PluginStore_GetPluginData_Handler, + }, + { + MethodName: "DeployPlugin", + Handler: _PluginStore_DeployPlugin_Handler, + }, + { + MethodName: "UnDeployPlugin", + Handler: _PluginStore_UnDeployPlugin_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "plugin_store.proto", +} diff --git a/capten/common-pkg/plugin-store/git.go b/capten/common-pkg/plugin-store/git.go new file mode 100644 index 00000000..3551388f --- /dev/null +++ b/capten/common-pkg/plugin-store/git.go @@ -0,0 +1,147 @@ +package pluginstore + +import ( + "errors" + "fmt" + "os" + "strings" + "time" + + git "github.com/go-git/go-git/v5" + "github.com/go-git/go-git/v5/config" + "github.com/go-git/go-git/v5/plumbing/object" + "github.com/go-git/go-git/v5/plumbing/transport/http" +) + +type GitClient struct { + repository *git.Repository +} + +func NewGitClient() *GitClient { + return &GitClient{} +} + +func (g *GitClient) Clone(directory, url, token string) error { + opt := &git.CloneOptions{ + URL: url, + Progress: os.Stdout, + InsecureSkipTLS: true, + } + if len(token) != 0 { + opt.Auth = &http.BasicAuth{ + Username: "dummy", // yes, this can be anything except an empty string + Password: token, + } + } + + r, err := git.PlainClone(directory, false, opt) + if err != nil { + return err + } + + g.repository = r + return nil +} + +func (g *GitClient) Add(path string) error { + w, err := g.repository.Worktree() + if err != nil { + return err + } + + _, err = w.Add(path) + if err != nil { + return err + } + return nil +} + +func (g *GitClient) Remove(path string) error { + w, err := g.repository.Worktree() + if err != nil { + return err + } + + _, err = w.Remove(path) + if err != nil { + return err + } + return nil +} + +func (g *GitClient) Commit(msg, name, email string) error { + w, err := g.repository.Worktree() + if err != nil { + return err + } + + _, err = w.Commit(msg, &git.CommitOptions{ + Author: &object.Signature{ + Name: name, + Email: email, + When: time.Now(), + }, + }) + + if err != nil { + return err + } + return nil +} + +func (g *GitClient) GetDefaultBranchName() (string, error) { + defBranch, err := g.repository.Head() + if err != nil { + return "", fmt.Errorf("failed to get the current head: %w", err) + } + + defaultBranch := strings.Split(defBranch.String(), "/") + return defaultBranch[len(defaultBranch)-1], nil +} + +func (g *GitClient) Push(branchName, token string) error { + defBranch, err := g.GetDefaultBranchName() + if err != nil { + return fmt.Errorf("failed to get the current head: %w", err) + } + + err = g.repository.Push(&git.PushOptions{RemoteName: "origin", Force: true, + Auth: &http.BasicAuth{ + Username: "dummy", // yes, this can be anything except an empty string + Password: token, + }, + InsecureSkipTLS: true, + RefSpecs: []config.RefSpec{config.RefSpec(fmt.Sprintf("refs/heads/%s:refs/heads/%s", defBranch, branchName))}}) + + return err +} + +func (g *GitClient) IsEmptyChanges() (bool, error) { + w, err := g.repository.Worktree() + if err != nil { + return false, err + } + + status, err := w.Status() + if err != nil { + return false, err + } + + if status.IsClean() || len(status) == 0 { + return true, errors.New("no commit changes found") + } + + hasModifiedFiles := false + for _, fileStatus := range status { + if fileStatus.Staging != git.Untracked { + hasModifiedFiles = true + break + } + } + + if !hasModifiedFiles { + return true, errors.New("no commit changes found") + } + + return false, nil +} diff --git a/capten/common-pkg/plugin-store/model.go b/capten/common-pkg/plugin-store/model.go new file mode 100644 index 00000000..f4d40dd4 --- /dev/null +++ b/capten/common-pkg/plugin-store/model.go @@ -0,0 +1,67 @@ +package pluginstore + +const ( + tmpGitProjectCloneStr = "clone*" + gitProjectAccessTokenAttribute = "accessToken" + gitProjectUserId = "userID" + + uiSSOCapabilityName = "ui-sso-oauth" + oAuthBaseURLName = "oAuthBaseURL" + oAuthClientIdName = "oAuthClientId" + oAuthClientSecretName = "oAuthClientSecret" +) + +var ( + supporttedCapabilities = map[string]bool{ + "ui-sso-oauth": true, + "capten-sdk": true, + "postgress-store": true, + "vault-store": true} +) + +type Config struct { + PluginsStoreProjectMount string `envconfig:"PLUGIN_STORE_PROJECT_MOUNT" default:"/plugin-store-clone"` + PluginsStorePath string `envconfig:"PLUGIN_STORE_PATH" default:"/plugin-store"` + PluginsFileName string `envconfig:"PLUGIN_LIST_FILE" default:"plugin-list.yaml"` + PluginFileName string `envconfig:"PLUGIN_FILE" default:"plugin.yaml"` + PluginConfigFileName string `envconfig:"PLUGIN_CONFIG_FILE" default:"plugin-config.yaml"` + PluginStoreProjectURL string `envconfig:"PLUGIN_STORE_PROJECT_URL" default:"https://github.com/intelops/capten-plugins"` + PluginStoreProjectAccess string `envconfig:"PLUGIN_STORE_PROJECT_ACCESS" default:""` + PluginStoreProjectID string `envconfig:"PLUGIN_STORE_PROJECT_ID" default:"1cf5201d-5f35-4d5b-afe0-4b9d0e0d4cd2"` + GitVaultEntityName string `envconfig:"GIT_VAULT_ENTITY_NAME" default:"git-project"` + CaptenOAuthURL string `envconfig:"CAPTEN_OAUTH_URL" default:"https://alpha.optimizor.app/api/.ory"` +} + +type PluginListData struct { + Plugins []string `yaml:"plugins"` +} + +type Deployment struct { + ControlplaneCluster *DeploymentConfig `yaml:"controlplaneCluster"` + BussinessCluster *DeploymentConfig `yaml:"bussinessCluster"` +} + +type DeploymentConfig struct { + Version string `yaml:"version"` + ChartName string `yaml:"chartName"` + ChartRepo string `yaml:"chartRepo"` + DefaultNamespace string `yaml:"defaultNamespace"` + PrivilegedNamespace bool `yaml:"privilegedNamespace"` + ValuesFile string `yaml:"valuesFile"` +} + +type PluginConfig struct { + Deployment Deployment `yaml:"deployment"` + ApiEndpoint string `yaml:"apiEndpoint"` + UIEndpoint string `yaml:"uiEndpoint"` + UIModulePackageURL string `yaml:"uiModulePackageURL"` + Capabilities []string `yaml:"capabilities"` +} + +type Plugin struct { + PluginName string `yaml:"pluginName"` + Description string `yaml:"description"` + Category string `yaml:"category"` + Icon string `yaml:"icon"` + Versions []string `yaml:"versions"` +} diff --git a/capten/common-pkg/plugin-store/plugin_store_handler.go b/capten/common-pkg/plugin-store/plugin_store_handler.go new file mode 100644 index 00000000..1813bfc7 --- /dev/null +++ b/capten/common-pkg/plugin-store/plugin_store_handler.go @@ -0,0 +1,525 @@ +package pluginstore + +import ( + "bytes" + "context" + "fmt" + "os" + "path/filepath" + "strings" + "text/template" + + "github.com/intelops/go-common/logging" + "github.com/kelseyhightower/envconfig" + "github.com/kube-tarian/kad/capten/common-pkg/credential" + "github.com/kube-tarian/kad/capten/common-pkg/pb/captenpluginspb" + "github.com/kube-tarian/kad/capten/common-pkg/pb/clusterpluginspb" + "github.com/kube-tarian/kad/capten/common-pkg/pb/pluginstorepb" + + "github.com/pkg/errors" + "gopkg.in/yaml.v2" +) + +type captenStore interface { + GetGitProjects() ([]*captenpluginspb.GitProject, error) + + UpsertPluginStoreConfig(config *pluginstorepb.PluginStoreConfig) error + GetPluginStoreConfig(storeType pluginstorepb.StoreType) (*pluginstorepb.PluginStoreConfig, error) + GetPlugins(gitProjectId string) ([]*pluginstorepb.Plugin, error) + DeletePluginStoreData(storeType pluginstorepb.StoreType, gitProjectId, pluginName string) error + UpsertPluginStoreData(gitProjectId string, plugin *pluginstorepb.PluginData) error + GetPluginStoreData(storeType pluginstorepb.StoreType, gitProjectId, pluginName string) (*pluginstorepb.PluginData, error) +} + +type pluginDeployHandler interface { + DeployClusterPlugin(context.Context, *clusterpluginspb.DeployClusterPluginRequest) (*clusterpluginspb.DeployClusterPluginResponse, error) + UnDeployClusterPlugin(context.Context, *clusterpluginspb.UnDeployClusterPluginRequest) (*clusterpluginspb.UnDeployClusterPluginResponse, error) +} + +type PluginStore struct { + log logging.Logger + cfg *Config + dbStore captenStore + pluginHandler pluginDeployHandler +} + +func NewPluginStore(log logging.Logger, dbStore captenStore, pluginHandler pluginDeployHandler) (*PluginStore, error) { + cfg := &Config{} + if err := envconfig.Process("", cfg); err != nil { + return nil, err + } + + return &PluginStore{ + log: log, + cfg: cfg, + dbStore: dbStore, + pluginHandler: pluginHandler, + }, nil +} + +func (p *PluginStore) ConfigureStore(config *pluginstorepb.PluginStoreConfig) error { + return p.dbStore.UpsertPluginStoreConfig(config) +} + +func (p *PluginStore) GetStoreConfig(storeType pluginstorepb.StoreType) (*pluginstorepb.PluginStoreConfig, error) { + if storeType == pluginstorepb.StoreType_LOCAL_STORE { + config, err := p.dbStore.GetPluginStoreConfig(storeType) + if err != nil { + if strings.Contains(err.Error(), "not found") { + return &pluginstorepb.PluginStoreConfig{ + StoreType: pluginstorepb.StoreType_LOCAL_STORE, + }, nil + } + return nil, err + } + return config, nil + } else if storeType == pluginstorepb.StoreType_CENTRAL_STORE { + return &pluginstorepb.PluginStoreConfig{ + StoreType: pluginstorepb.StoreType_CENTRAL_STORE, + GitProjectId: p.cfg.PluginStoreProjectID, + GitProjectURL: p.cfg.PluginStoreProjectURL, + }, nil + } else { + return nil, fmt.Errorf("not supported store type") + } +} + +func (p *PluginStore) SyncPlugins(storeType pluginstorepb.StoreType) error { + config, err := p.GetStoreConfig(storeType) + if err != nil { + return err + } + + pluginStoreDir, err := p.clonePluginStoreProject(config.GitProjectURL, config.GitProjectId, storeType) + if err != nil { + return err + } + defer os.RemoveAll(pluginStoreDir) + + pluginListFilePath := p.getPluginListFilePath(pluginStoreDir) + p.log.Infof("Loading plugin data from %s", pluginListFilePath) + pluginListData, err := os.ReadFile(pluginListFilePath) + if err != nil { + return errors.WithMessage(err, "failed to read store config file") + } + + var plugins PluginListData + if err := yaml.Unmarshal(pluginListData, &plugins); err != nil { + return errors.WithMessage(err, "failed to unmarshall store config file") + } + + addedPlugins := map[string]bool{} + for _, pluginName := range plugins.Plugins { + err := p.addPluginApp(config.GitProjectId, pluginStoreDir, pluginName) + if err != nil { + p.log.Errorf("%v", err) + continue + } + addedPlugins[pluginName] = true + p.log.Infof("stored plugin data for plugin %s", pluginName) + } + + dbPlugins, err := p.dbStore.GetPlugins(config.GitProjectId) + if err != nil { + if !strings.Contains(err.Error(), "not found") { + return err + } + } + + for _, dbPlugin := range dbPlugins { + if _, ok := addedPlugins[dbPlugin.PluginName]; !ok { + if err = p.dbStore.DeletePluginStoreData(storeType, config.GitProjectId, dbPlugin.PluginName); err != nil { + p.log.Infof("failed to deleted plugin data for plugin %s", dbPlugin.PluginName) + } + p.log.Infof("deleted plugin data for plugin %s", dbPlugin.PluginName) + } + } + + return nil +} + +func (p *PluginStore) clonePluginStoreProject(projectURL, projectId string, + storeType pluginstorepb.StoreType) (pluginStoreDir string, err error) { + pluginStoreDir, err = os.MkdirTemp(p.cfg.PluginsStoreProjectMount, tmpGitProjectCloneStr) + if err != nil { + err = fmt.Errorf("failed to create plugin store tmp dir, err: %v", err) + return + } + + accessToken, err := p.getGitProjectAccessToken(projectId, storeType) + if err != nil { + err = fmt.Errorf("failed to get git project credentias, %v", err) + return + } + + p.log.Infof("cloning plugin store project %s to %s", projectURL, pluginStoreDir) + gitClient := NewGitClient() + if err = gitClient.Clone(pluginStoreDir, projectURL, accessToken); err != nil { + os.RemoveAll(pluginStoreDir) + err = fmt.Errorf("failed to Clone plugin store project, err: %v", err) + return + } + return +} + +func (p *PluginStore) addPluginApp(gitProjectId, pluginStoreDir, pluginName string) error { + appData, err := os.ReadFile(p.getPluginFilePath(pluginStoreDir, pluginName)) + if err != nil { + return errors.WithMessagef(err, "failed to read store plugin %s", pluginName) + } + + var pluginData Plugin + if err := yaml.Unmarshal(appData, &pluginData); err != nil { + return errors.WithMessagef(err, "failed to unmarshall store plugin %s", pluginName) + } + + var iconData []byte + if len(pluginData.Icon) != 0 { + iconData, err = os.ReadFile(p.getPluginIconFilePath(pluginStoreDir, pluginName, pluginData.Icon)) + if err != nil { + return errors.WithMessagef(err, "failed to read icon %s for plugin %s", pluginData.Icon, pluginName) + } + } + + if pluginData.PluginName == "" || len(pluginData.Versions) == 0 { + return fmt.Errorf("app name/version is missing for %s", pluginName) + } + + plugin := &pluginstorepb.PluginData{ + PluginName: pluginData.PluginName, + Description: pluginData.Description, + Category: pluginData.Category, + Versions: pluginData.Versions, + Icon: iconData, + } + + if err := p.dbStore.UpsertPluginStoreData(gitProjectId, plugin); err != nil { + return errors.WithMessagef(err, "failed to store plugin %s", pluginName) + } + return nil +} + +func (p *PluginStore) GetPlugins(storeType pluginstorepb.StoreType) ([]*pluginstorepb.Plugin, error) { + config, err := p.GetStoreConfig(storeType) + if err != nil { + return nil, err + } + + plugins, err := p.dbStore.GetPlugins(config.GitProjectId) + if err != nil { + if strings.Contains(err.Error(), "not found") { + return []*pluginstorepb.Plugin{}, nil + } + return nil, err + } + return plugins, nil +} + +func (p *PluginStore) GetPluginData(storeType pluginstorepb.StoreType, pluginName string) (*pluginstorepb.PluginData, error) { + config, err := p.GetStoreConfig(storeType) + if err != nil { + return nil, err + } + + return p.dbStore.GetPluginStoreData(storeType, config.GitProjectId, pluginName) +} + +func (p *PluginStore) GetPluginValues(storeType pluginstorepb.StoreType, + pluginName, version string) ([]byte, error) { + config, err := p.GetStoreConfig(storeType) + if err != nil { + return nil, err + } + + pluginStoreDir, err := p.clonePluginStoreProject(config.GitProjectURL, config.GitProjectId, storeType) + if err != nil { + return nil, err + } + defer os.RemoveAll(pluginStoreDir) + + pluginConfig, err := p.getPluginConfig(pluginStoreDir, pluginName, version) + if err != nil { + return nil, err + } + + return p.getPluginValues(pluginConfig, pluginStoreDir, pluginName, version) +} + +func (p *PluginStore) getPluginValues(pluginConfig *PluginConfig, pluginStoreDir, pluginName, version string) ([]byte, error) { + pluginValuesPath := p.getPluginDeployValuesFilePath(pluginStoreDir, pluginName, version, + pluginConfig.Deployment.ControlplaneCluster.ValuesFile) + p.log.Infof("Loading %s plugin values from %s", pluginName, pluginValuesPath) + pluginValuesData, err := os.ReadFile(pluginValuesPath) + if err != nil { + return nil, errors.WithMessage(err, "failed to read plugins values file") + } + return pluginValuesData, nil +} + +func (p *PluginStore) getPluginConfig(pluginStoreDir, pluginName, version string) (*PluginConfig, error) { + pluginConfigPath := p.getPluginConfigFilePath(pluginStoreDir, pluginName, version) + pluginConfigData, err := os.ReadFile(pluginConfigPath) + if err != nil { + return nil, errors.WithMessage(err, "failed to read store config file") + } + + pluginConfig := &PluginConfig{} + if err := yaml.Unmarshal(pluginConfigData, pluginConfig); err != nil { + return nil, errors.WithMessage(err, "failed to unmarshall store config file") + } + if pluginConfig.Deployment.ControlplaneCluster == nil { + return nil, errors.WithMessage(err, "no deployment found") + } + return pluginConfig, nil +} + +func (p *PluginStore) DeployPlugin(storeType pluginstorepb.StoreType, + pluginName, version string, values []byte) error { + config, err := p.GetStoreConfig(storeType) + if err != nil { + return fmt.Errorf("faild to fetch store config, %v", err) + } + + pluginData, err := p.dbStore.GetPluginStoreData(storeType, config.GitProjectId, pluginName) + if err != nil { + return fmt.Errorf("faild to read plugin %s from project %s, %v", pluginName, config.GitProjectId, err) + } + + if !stringContains(pluginData.Versions, version) { + return fmt.Errorf("version %s not supported", version) + } + + pluginStoreDir, err := p.clonePluginStoreProject(config.GitProjectURL, config.GitProjectId, storeType) + if err != nil { + return err + } + defer os.RemoveAll(pluginStoreDir) + + pluginConfig, err := p.getPluginConfig(pluginStoreDir, pluginName, version) + if err != nil { + return err + } + + validCapabilities, invalidCapabilities := filterSupporttedCapabilties(pluginConfig.Capabilities) + if len(invalidCapabilities) > 0 { + p.log.Infof("skipped plugin %s invalid capabilities %v", pluginName, invalidCapabilities) + } + + if len(values) == 0 { + values, err = p.getPluginValues(pluginConfig, pluginStoreDir, pluginName, version) + if err != nil { + p.log.Infof("no values defined for plugin %s", pluginName) + } + } + + overrideValuesMapping, err := p.getOverrideTemplateValues() + if err != nil { + return err + } + + apiEndpoint, uiEndpoint, err := p.getPluginDataAPIValues(pluginConfig, overrideValuesMapping) + if err != nil { + return err + } + + overrideValues, err := yaml.Marshal(overrideValuesMapping) + if err != nil { + return err + } + + plugin := &clusterpluginspb.Plugin{ + StoreType: clusterpluginspb.StoreType(pluginData.StoreType), + PluginName: pluginData.PluginName, + Description: pluginData.Description, + Category: pluginData.Category, + Icon: pluginData.Icon, + Version: version, + ChartName: pluginConfig.Deployment.ControlplaneCluster.ChartName, + ChartRepo: pluginConfig.Deployment.ControlplaneCluster.ChartRepo, + DefaultNamespace: pluginConfig.Deployment.ControlplaneCluster.DefaultNamespace, + PrivilegedNamespace: pluginConfig.Deployment.ControlplaneCluster.PrivilegedNamespace, + ApiEndpoint: apiEndpoint, + UiEndpoint: uiEndpoint, + Capabilities: validCapabilities, + Values: values, + OverrideValues: overrideValues, + } + + p.log.Infof("Sending plugin %s deploy request", pluginName) + _, err = p.pluginHandler.DeployClusterPlugin(context.Background(), &clusterpluginspb.DeployClusterPluginRequest{Plugin: plugin}) + if err != nil { + return err + } + return nil +} + +func (p *PluginStore) UnDeployPlugin(storeType pluginstorepb.StoreType, pluginName string) error { + _, err := p.pluginHandler.UnDeployClusterPlugin(context.Background(), + &clusterpluginspb.UnDeployClusterPluginRequest{StoreType: clusterpluginspb.StoreType(storeType), PluginName: pluginName}) + if err != nil { + return err + } + return nil +} + +func stringContains(arr []string, target string) bool { + for _, str := range arr { + if str == target { + return true + } + } + return false +} + +func (p *PluginStore) getGitProjectAccessToken(projectId string, storeType pluginstorepb.StoreType) (string, error) { + if storeType == pluginstorepb.StoreType_CENTRAL_STORE { + return p.cfg.PluginStoreProjectAccess, nil + } + + projects, err := p.dbStore.GetGitProjects() + if err != nil { + return "", err + } + + var accessToken string + for _, project := range projects { + if project.Id == projectId { + accessToken = project.AccessToken + break + } + } + + if len(accessToken) == 0 { + return "", fmt.Errorf("project not found") + } + + return accessToken, nil +} + +func filterSupporttedCapabilties(pluginCapabilties []string) (validCapabilties, invalidCapabilities []string) { + validCapabilties = []string{} + invalidCapabilities = []string{} + for _, pluginCapability := range pluginCapabilties { + _, ok := supporttedCapabilities[pluginCapability] + if ok { + validCapabilties = append(validCapabilties, pluginCapability) + } else { + invalidCapabilities = append(invalidCapabilities, pluginCapability) + } + } + return +} + +func isUISSOCapabilitySupported(pluginCapabilties []string) bool { + for _, pluginCapability := range pluginCapabilties { + if pluginCapability == uiSSOCapabilityName { + return true + } + } + return false +} + +func (p *PluginStore) getPluginDataAPIValues(pluginConfig *PluginConfig, overrideValues map[string]string) (string, string, error) { + apiEndpoint, err := replaceTemplateValuesInString(pluginConfig.ApiEndpoint, overrideValues) + if err != nil { + return "", "", fmt.Errorf("failed to update template values in plguin data, %v", err) + } + + uiEndpoint, err := replaceTemplateValuesInString(pluginConfig.UIEndpoint, overrideValues) + if err != nil { + return "", "", fmt.Errorf("failed to update template values in plguin data, %v", err) + } + return apiEndpoint, uiEndpoint, nil +} + +func (p *PluginStore) getOverrideTemplateValues() (map[string]string, error) { + clusterGlobalValues, err := p.getClusterGlobalValues() + if err != nil { + return nil, fmt.Errorf("failed to get cluster global values, %v", err) + } + + overrideValues := map[string]string{} + for key, val := range clusterGlobalValues { + overrideValues[key] = fmt.Sprintf("%v", val) + + } + + return overrideValues, nil +} + +func (p *PluginStore) getClusterGlobalValues() (map[string]interface{}, error) { + globalVal, err := credential.GetClusterGlobalValues(context.TODO()) + if err != nil { + return nil, err + } + + var globalValues map[string]interface{} + err = yaml.Unmarshal([]byte(globalVal), &globalValues) + if err != nil { + return nil, errors.WithMessagef(err, "failed to unmarshal cluster values") + } + p.log.Debugf("cluster globalValues: %+v", globalValues) + return globalValues, nil +} + +func replaceTemplateValuesInByteData(data []byte, + values map[string]interface{}) (transformedData []byte, err error) { + tmpl, err := template.New("templateVal").Parse(string(data)) + if err != nil { + return + } + + var buf bytes.Buffer + err = tmpl.Execute(&buf, values) + if err != nil { + return + } + + transformedData = buf.Bytes() + return +} + +func replaceTemplateValuesInString(data string, values map[string]string) (transformedData string, err error) { + if len(data) == 0 { + return + } + + tmpl, err := template.New("templateVal").Parse(data) + if err != nil { + return + } + + var buf bytes.Buffer + err = tmpl.Execute(&buf, values) + if err != nil { + return + } + + transformedData = string(buf.Bytes()) + + return +} + +func prepareFilePath(parts ...string) string { + return filepath.Join(parts...) +} + +func (p *PluginStore) getPluginListFilePath(parentFolder string) string { + return prepareFilePath(parentFolder, p.cfg.PluginsStorePath, p.cfg.PluginsFileName) +} + +func (p *PluginStore) getPluginFilePath(parentFolder, pluginName string) string { + return prepareFilePath(parentFolder, p.cfg.PluginsStorePath, pluginName, p.cfg.PluginFileName) +} + +func (p *PluginStore) getPluginIconFilePath(parentFolder, pluginName, iconFileName string) string { + return prepareFilePath(parentFolder, p.cfg.PluginsStorePath, pluginName, iconFileName) +} + +func (p *PluginStore) getPluginConfigFilePath(parentFolder, pluginName, version string) string { + return prepareFilePath(parentFolder, p.cfg.PluginsStorePath, pluginName, version, p.cfg.PluginConfigFileName) +} + +func (p *PluginStore) getPluginDeployValuesFilePath(parentFolder, pluginName, version, valuesFile string) string { + return prepareFilePath(parentFolder, p.cfg.PluginsStorePath, pluginName, version, valuesFile) +} diff --git a/capten/database/postgres/migrations/001_git_project.down.sql b/capten/database/postgres/migrations/001_git_project.down.sql deleted file mode 100644 index 069b037c..00000000 --- a/capten/database/postgres/migrations/001_git_project.down.sql +++ /dev/null @@ -1 +0,0 @@ -DROP TABLE IF EXISTS GitProject; \ No newline at end of file diff --git a/capten/database/postgres/migrations/001_git_project.up.sql b/capten/database/postgres/migrations/001_git_project.up.sql deleted file mode 100644 index 16739a0c..00000000 --- a/capten/database/postgres/migrations/001_git_project.up.sql +++ /dev/null @@ -1,6 +0,0 @@ -CREATE TABLE IF NOT EXISTS git_project ( - id UUID PRIMARY KEY, - project_url varchar(200), - labels TEXT[], - last_update_time TIMESTAMP -); \ No newline at end of file diff --git a/capten/database/postgres/migrations/001_onboard_resources.down.sql b/capten/database/postgres/migrations/001_onboard_resources.down.sql new file mode 100644 index 00000000..bf3e97d9 --- /dev/null +++ b/capten/database/postgres/migrations/001_onboard_resources.down.sql @@ -0,0 +1,3 @@ +DROP TABLE IF EXISTS git_project; +DROP TABLE IF EXISTS cloud_provider; +DROP TABLE IF EXISTS container_registry; diff --git a/capten/database/postgres/migrations/001_onboard_resources.up.sql b/capten/database/postgres/migrations/001_onboard_resources.up.sql new file mode 100644 index 00000000..ed5db4f6 --- /dev/null +++ b/capten/database/postgres/migrations/001_onboard_resources.up.sql @@ -0,0 +1,21 @@ +CREATE TABLE IF NOT EXISTS git_project ( + id UUID PRIMARY KEY, + project_url varchar(200), + labels TEXT[], + last_update_time TIMESTAMP +); + +CREATE TABLE IF NOT EXISTS cloud_provider ( + id UUID PRIMARY KEY, + cloud_type varchar(40), + labels TEXT[], + last_update_time TIMESTAMP +); + +CREATE TABLE IF NOT EXISTS container_registry ( + id UUID PRIMARY KEY, + registry_url varchar(200), + registry_type varchar(40), + labels TEXT[], + last_update_time TIMESTAMP +); \ No newline at end of file diff --git a/capten/database/postgres/migrations/002_cloud_provider.down.sql b/capten/database/postgres/migrations/002_cloud_provider.down.sql deleted file mode 100644 index 1c913a0f..00000000 --- a/capten/database/postgres/migrations/002_cloud_provider.down.sql +++ /dev/null @@ -1 +0,0 @@ -DROP TABLE IF EXISTS CloudProvider; \ No newline at end of file diff --git a/capten/database/postgres/migrations/002_cloud_provider.up.sql b/capten/database/postgres/migrations/002_cloud_provider.up.sql deleted file mode 100644 index a3478465..00000000 --- a/capten/database/postgres/migrations/002_cloud_provider.up.sql +++ /dev/null @@ -1,6 +0,0 @@ -CREATE TABLE IF NOT EXISTS cloud_provider ( - id UUID PRIMARY KEY, - cloud_type varchar(40), - labels TEXT[], - last_update_time TIMESTAMP -); \ No newline at end of file diff --git a/capten/database/postgres/migrations/002_cluster_plugin_data.down.sql b/capten/database/postgres/migrations/002_cluster_plugin_data.down.sql new file mode 100644 index 00000000..3712d45b --- /dev/null +++ b/capten/database/postgres/migrations/002_cluster_plugin_data.down.sql @@ -0,0 +1,2 @@ +DROP TABLE IF EXISTS cluster_pluginConfig; +DROP TABLE IF EXISTS cluster_appConfig; diff --git a/capten/database/postgres/migrations/004_app_config.up.sql b/capten/database/postgres/migrations/002_cluster_plugin_data.up.sql similarity index 51% rename from capten/database/postgres/migrations/004_app_config.up.sql rename to capten/database/postgres/migrations/002_cluster_plugin_data.up.sql index c60d91a9..aeaa8a64 100644 --- a/capten/database/postgres/migrations/004_app_config.up.sql +++ b/capten/database/postgres/migrations/002_cluster_plugin_data.up.sql @@ -1,3 +1,25 @@ +CREATE TABLE IF NOT EXISTS cluster_plugin_config ( + plugin_name varchar(80) PRIMARY KEY, + plugin_store_type INTEGER, + capabilities TEXT, + category varchar(40), + description TEXT, + chart_name varchar(40), + chart_repo varchar(200), + version varchar(40), + namespace varchar(80), + ui_endpoint varchar(200), + api_endpoint varchar(200), + ui_module_endpoint varchar(200), + default_app BOOLEAN, + privileged_namespace BOOLEAN, + install_status varchar(40), + icon BYTEA, + override_values TEXT, + values TEXT, + last_update_time TIMESTAMP +); + CREATE TABLE IF NOT EXISTS cluster_app_config ( release_name varchar(80) PRIMARY KEY, app_name varchar(80), diff --git a/capten/database/postgres/migrations/003_container_registry.down.sql b/capten/database/postgres/migrations/003_container_registry.down.sql deleted file mode 100644 index 5d04dc08..00000000 --- a/capten/database/postgres/migrations/003_container_registry.down.sql +++ /dev/null @@ -1 +0,0 @@ -DROP TABLE IF EXISTS ContainerRegistry; \ No newline at end of file diff --git a/capten/database/postgres/migrations/003_container_registry.up.sql b/capten/database/postgres/migrations/003_container_registry.up.sql deleted file mode 100644 index 7db760e7..00000000 --- a/capten/database/postgres/migrations/003_container_registry.up.sql +++ /dev/null @@ -1,7 +0,0 @@ -CREATE TABLE IF NOT EXISTS container_registry ( - id UUID PRIMARY KEY, - registry_url varchar(200), - registry_type varchar(40), - labels TEXT[], - last_update_time TIMESTAMP -); \ No newline at end of file diff --git a/capten/database/postgres/migrations/003_crossplane_plugin_data.down.sql b/capten/database/postgres/migrations/003_crossplane_plugin_data.down.sql new file mode 100644 index 00000000..e07d6a17 --- /dev/null +++ b/capten/database/postgres/migrations/003_crossplane_plugin_data.down.sql @@ -0,0 +1,3 @@ +DROP TABLE IF EXISTS crossplane_project; +DROP TABLE IF EXISTS crossplane_provider; +DROP TABLE IF EXISTS managed_cluster; \ No newline at end of file diff --git a/capten/database/postgres/migrations/003_crossplane_plugin_data.up.sql b/capten/database/postgres/migrations/003_crossplane_plugin_data.up.sql new file mode 100644 index 00000000..dfef0ae8 --- /dev/null +++ b/capten/database/postgres/migrations/003_crossplane_plugin_data.up.sql @@ -0,0 +1,25 @@ +CREATE TABLE IF NOT EXISTS crossplane_project ( + id INTEGER PRIMARY KEY, + git_project_id UUID, + git_project_url varchar(200), + status varchar(40), + last_update_time TIMESTAMP +); + +CREATE TABLE IF NOT EXISTS crossplane_provider ( + id UUID PRIMARY KEY, + cloud_provider_id varchar(80), + provider_name varchar(40), + cloud_type varchar(40), + status varchar(40), + last_update_time TIMESTAMP +); + +CREATE TABLE IF NOT EXISTS managed_cluster ( + id UUID PRIMARY KEY, + cluster_name varchar(80), + cluster_endpoint varchar(200), + cluster_deploy_status varchar(40), + app_deploy_status varchar(40), + last_update_time TIMESTAMP +); \ No newline at end of file diff --git a/capten/database/postgres/migrations/004_app_config.down.sql b/capten/database/postgres/migrations/004_app_config.down.sql deleted file mode 100644 index d5dfa37c..00000000 --- a/capten/database/postgres/migrations/004_app_config.down.sql +++ /dev/null @@ -1 +0,0 @@ -DROP TABLE IF EXISTS ClusterAppConfig; \ No newline at end of file diff --git a/capten/database/postgres/migrations/004_tekton_plugin_data.down.sql b/capten/database/postgres/migrations/004_tekton_plugin_data.down.sql new file mode 100644 index 00000000..de2e8d78 --- /dev/null +++ b/capten/database/postgres/migrations/004_tekton_plugin_data.down.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS tekton_project; \ No newline at end of file diff --git a/capten/database/postgres/migrations/007_tekton_project_data.up.sql b/capten/database/postgres/migrations/004_tekton_plugin_data.up.sql similarity index 100% rename from capten/database/postgres/migrations/007_tekton_project_data.up.sql rename to capten/database/postgres/migrations/004_tekton_plugin_data.up.sql diff --git a/capten/database/postgres/migrations/005_plugin_config.down.sql b/capten/database/postgres/migrations/005_plugin_config.down.sql deleted file mode 100644 index 54ed0b7b..00000000 --- a/capten/database/postgres/migrations/005_plugin_config.down.sql +++ /dev/null @@ -1 +0,0 @@ -DROP TABLE IF EXISTS ClusterPluginConfig; \ No newline at end of file diff --git a/capten/database/postgres/migrations/005_plugin_config.up.sql b/capten/database/postgres/migrations/005_plugin_config.up.sql deleted file mode 100644 index 8935823c..00000000 --- a/capten/database/postgres/migrations/005_plugin_config.up.sql +++ /dev/null @@ -1,21 +0,0 @@ -CREATE TABLE IF NOT EXISTS cluster_plugin_config ( - plugin_name varchar(80) PRIMARY KEY, - plugin_store_type INTEGER, - capabilities TEXT, - category varchar(40), - description TEXT, - chart_name varchar(40), - chart_repo varchar(200), - version varchar(40), - namespace varchar(80), - ui_endpoint varchar(200), - api_endpoint varchar(200), - ui_module_endpoint varchar(200), - default_app BOOLEAN, - privileged_namespace BOOLEAN, - install_status varchar(40), - icon BYTEA, - override_values TEXT, - values TEXT, - last_update_time TIMESTAMP -); \ No newline at end of file diff --git a/capten/database/postgres/migrations/005_plugin_store_data.down.sql b/capten/database/postgres/migrations/005_plugin_store_data.down.sql new file mode 100644 index 00000000..68d53eb4 --- /dev/null +++ b/capten/database/postgres/migrations/005_plugin_store_data.down.sql @@ -0,0 +1,2 @@ +DROP TABLE IF EXISTS plugin_store_config; +DROP TABLE IF EXISTS plugin_store_data; \ No newline at end of file diff --git a/capten/database/postgres/migrations/005_plugin_store_data.up.sql b/capten/database/postgres/migrations/005_plugin_store_data.up.sql new file mode 100644 index 00000000..c93c5310 --- /dev/null +++ b/capten/database/postgres/migrations/005_plugin_store_data.up.sql @@ -0,0 +1,19 @@ +CREATE TABLE IF NOT EXISTS plugin_store_config ( + store_type INTEGER PRIMARY KEY, + git_project_id varchar(200), + git_project_url varchar(200), + status varchar(40), + last_update_time TIMESTAMP +); + +CREATE TABLE IF NOT EXISTS plugin_store_data ( + store_type INTEGER, + git_project_id varchar(200), + plugin_name varchar(80), + category varchar(40), + versions TEXT[], + icon BYTEA, + description TEXT, + last_update_time TIMESTAMP, + PRIMARY KEY (store_type, git_project_id, plugin_name) +); diff --git a/capten/database/postgres/migrations/006_managed_clusters.down.sql b/capten/database/postgres/migrations/006_managed_clusters.down.sql deleted file mode 100644 index dedd3ad5..00000000 --- a/capten/database/postgres/migrations/006_managed_clusters.down.sql +++ /dev/null @@ -1 +0,0 @@ -DROP TABLE IF EXISTS ManagedClusters; \ No newline at end of file diff --git a/capten/database/postgres/migrations/006_managed_clusters.up.sql b/capten/database/postgres/migrations/006_managed_clusters.up.sql deleted file mode 100644 index 80b057ba..00000000 --- a/capten/database/postgres/migrations/006_managed_clusters.up.sql +++ /dev/null @@ -1,8 +0,0 @@ -CREATE TABLE IF NOT EXISTS managed_clusters ( - id UUID PRIMARY KEY, - cluster_name varchar(80), - cluster_endpoint varchar(200), - cluster_deploy_status varchar(40), - app_deploy_status varchar(40), - last_update_time TIMESTAMP -); \ No newline at end of file diff --git a/capten/database/postgres/migrations/007_tekton_project_data.down.sql b/capten/database/postgres/migrations/007_tekton_project_data.down.sql deleted file mode 100644 index 764658e0..00000000 --- a/capten/database/postgres/migrations/007_tekton_project_data.down.sql +++ /dev/null @@ -1 +0,0 @@ -DROP TABLE IF EXISTS TektonProject; \ No newline at end of file diff --git a/capten/database/postgres/migrations/008_crossplane_project.down.sql b/capten/database/postgres/migrations/008_crossplane_project.down.sql deleted file mode 100644 index 66cb695c..00000000 --- a/capten/database/postgres/migrations/008_crossplane_project.down.sql +++ /dev/null @@ -1 +0,0 @@ -DROP TABLE IF EXISTS CrossplaneProject; \ No newline at end of file diff --git a/capten/database/postgres/migrations/008_crossplane_project.up.sql b/capten/database/postgres/migrations/008_crossplane_project.up.sql deleted file mode 100644 index 6a8eb938..00000000 --- a/capten/database/postgres/migrations/008_crossplane_project.up.sql +++ /dev/null @@ -1,7 +0,0 @@ -CREATE TABLE IF NOT EXISTS crossplane_project ( - id INTEGER PRIMARY KEY, - git_project_id UUID, - git_project_url varchar(200), - status varchar(40), - last_update_time TIMESTAMP -); \ No newline at end of file diff --git a/capten/database/postgres/migrations/009_crossplane_provider.down.sql b/capten/database/postgres/migrations/009_crossplane_provider.down.sql deleted file mode 100644 index bbf1feab..00000000 --- a/capten/database/postgres/migrations/009_crossplane_provider.down.sql +++ /dev/null @@ -1 +0,0 @@ -DROP TABLE IF EXISTS CrossplaneProvider; diff --git a/capten/database/postgres/migrations/009_crossplane_provider.up.sql b/capten/database/postgres/migrations/009_crossplane_provider.up.sql deleted file mode 100644 index 8f53cf81..00000000 --- a/capten/database/postgres/migrations/009_crossplane_provider.up.sql +++ /dev/null @@ -1,8 +0,0 @@ -CREATE TABLE IF NOT EXISTS crossplane_provider ( - id UUID PRIMARY KEY, - cloud_provider_id varchar(80), - provider_name varchar(40), - cloud_type varchar(40), - status varchar(40), - last_update_time TIMESTAMP -); \ No newline at end of file diff --git a/proto/plugin_store.proto b/proto/plugin_store.proto index d6860864..ea0c7678 100644 --- a/proto/plugin_store.proto +++ b/proto/plugin_store.proto @@ -24,10 +24,11 @@ enum StatusCode { NOT_FOUND = 3; } -enum StoreType { - DEFAULT_STORE = 0; +enum StoreType { + NONE = 0; CENTRAL_STORE = 1; LOCAL_STORE = 2; + DEFAULT_STORE = 3; } message PluginStoreConfig { diff --git a/server/pkg/pb/pluginstorepb/plugin_store.pb.go b/server/pkg/pb/pluginstorepb/plugin_store.pb.go index 51d2b291..8efd2cd4 100644 --- a/server/pkg/pb/pluginstorepb/plugin_store.pb.go +++ b/server/pkg/pb/pluginstorepb/plugin_store.pb.go @@ -75,22 +75,25 @@ func (StatusCode) EnumDescriptor() ([]byte, []int) { type StoreType int32 const ( - StoreType_DEFAULT_STORE StoreType = 0 + StoreType_NONE StoreType = 0 StoreType_CENTRAL_STORE StoreType = 1 StoreType_LOCAL_STORE StoreType = 2 + StoreType_DEFAULT_STORE StoreType = 3 ) // Enum value maps for StoreType. var ( StoreType_name = map[int32]string{ - 0: "DEFAULT_STORE", + 0: "NONE", 1: "CENTRAL_STORE", 2: "LOCAL_STORE", + 3: "DEFAULT_STORE", } StoreType_value = map[string]int32{ - "DEFAULT_STORE": 0, + "NONE": 0, "CENTRAL_STORE": 1, "LOCAL_STORE": 2, + "DEFAULT_STORE": 3, } ) @@ -167,7 +170,7 @@ func (x *PluginStoreConfig) GetStoreType() StoreType { if x != nil { return x.StoreType } - return StoreType_DEFAULT_STORE + return StoreType_NONE } func (x *PluginStoreConfig) GetGitProjectId() string { @@ -233,7 +236,7 @@ func (x *Plugin) GetStoreType() StoreType { if x != nil { return x.StoreType } - return StoreType_DEFAULT_STORE + return StoreType_NONE } func (x *Plugin) GetPluginName() string { @@ -320,7 +323,7 @@ func (x *PluginData) GetStoreType() StoreType { if x != nil { return x.StoreType } - return StoreType_DEFAULT_STORE + return StoreType_NONE } func (x *PluginData) GetPluginName() string { @@ -504,7 +507,7 @@ func (x *GetPluginStoreConfigRequest) GetStoreType() StoreType { if x != nil { return x.StoreType } - return StoreType_DEFAULT_STORE + return StoreType_NONE } type GetPluginStoreConfigResponse struct { @@ -614,7 +617,7 @@ func (x *SyncPluginStoreRequest) GetStoreType() StoreType { if x != nil { return x.StoreType } - return StoreType_DEFAULT_STORE + return StoreType_NONE } type SyncPluginStoreResponse struct { @@ -716,7 +719,7 @@ func (x *GetPluginsRequest) GetStoreType() StoreType { if x != nil { return x.StoreType } - return StoreType_DEFAULT_STORE + return StoreType_NONE } type GetPluginsResponse struct { @@ -828,7 +831,7 @@ func (x *GetPluginValuesRequest) GetStoreType() StoreType { if x != nil { return x.StoreType } - return StoreType_DEFAULT_STORE + return StoreType_NONE } func (x *GetPluginValuesRequest) GetPluginName() string { @@ -953,7 +956,7 @@ func (x *GetPluginDataRequest) GetStoreType() StoreType { if x != nil { return x.StoreType } - return StoreType_DEFAULT_STORE + return StoreType_NONE } func (x *GetPluginDataRequest) GetPluginName() string { @@ -1073,7 +1076,7 @@ func (x *DeployPluginRequest) GetStoreType() StoreType { if x != nil { return x.StoreType } - return StoreType_DEFAULT_STORE + return StoreType_NONE } func (x *DeployPluginRequest) GetPluginName() string { @@ -1197,7 +1200,7 @@ func (x *UnDeployPluginRequest) GetStoreType() StoreType { if x != nil { return x.StoreType } - return StoreType_DEFAULT_STORE + return StoreType_NONE } func (x *UnDeployPluginRequest) GetPluginName() string { @@ -1432,63 +1435,64 @@ var file_plugin_store_proto_rawDesc = []byte{ 0x4e, 0x52, 0x41, 0x4c, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x41, 0x52, 0x47, 0x55, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, - 0x03, 0x2a, 0x42, 0x0a, 0x09, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x11, - 0x0a, 0x0d, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x5f, 0x53, 0x54, 0x4f, 0x52, 0x45, 0x10, - 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x45, 0x4e, 0x54, 0x52, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x4f, - 0x52, 0x45, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x5f, 0x53, 0x54, - 0x4f, 0x52, 0x45, 0x10, 0x02, 0x32, 0xaa, 0x06, 0x0a, 0x0b, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x71, 0x0a, 0x14, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, - 0x72, 0x65, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x2a, 0x2e, - 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x74, 0x6f, - 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x70, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x75, 0x72, 0x65, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x71, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x50, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x12, 0x2a, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, - 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x70, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, - 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x62, 0x0a, 0x0f, 0x53, - 0x79, 0x6e, 0x63, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x25, - 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x53, - 0x79, 0x6e, 0x63, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, - 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x53, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x12, 0x20, 0x2e, - 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x47, 0x65, - 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x21, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, - 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x12, 0x62, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x25, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x03, 0x2a, 0x4c, 0x0a, 0x09, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, + 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x45, 0x4e, 0x54, + 0x52, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x4f, 0x52, 0x45, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x4c, + 0x4f, 0x43, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x4f, 0x52, 0x45, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, + 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x5f, 0x53, 0x54, 0x4f, 0x52, 0x45, 0x10, 0x03, 0x32, + 0xaa, 0x06, 0x0a, 0x0b, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, + 0x71, 0x0a, 0x14, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x50, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x2a, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, + 0x65, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x50, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x71, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, + 0x74, 0x6f, 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2a, 0x2e, 0x70, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x53, 0x74, 0x6f, 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x62, 0x0a, 0x0f, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x25, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x26, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, + 0x53, 0x79, 0x6e, 0x63, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x53, 0x0a, 0x0a, 0x47, 0x65, 0x74, + 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x12, 0x20, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, - 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x47, - 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5c, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x50, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x23, 0x2e, 0x70, 0x6c, 0x75, 0x67, + 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, - 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x47, - 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x59, 0x0a, 0x0c, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, - 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x22, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, - 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x50, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x70, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, - 0x79, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x5f, 0x0a, 0x0e, 0x55, 0x6e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x50, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x12, 0x24, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, + 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x62, + 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x12, 0x25, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, + 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x5c, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x44, + 0x61, 0x74, 0x61, 0x12, 0x23, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x44, 0x61, 0x74, + 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x59, 0x0a, 0x0c, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x12, 0x22, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, + 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x50, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5f, 0x0a, 0x0e, 0x55, + 0x6e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x24, 0x2e, + 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x55, 0x6e, + 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x55, 0x6e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x50, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x70, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x2e, 0x55, 0x6e, 0x44, 0x65, 0x70, 0x6c, - 0x6f, 0x79, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x42, 0x10, 0x5a, 0x0e, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, - 0x72, 0x65, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x10, 0x5a, 0x0e, + 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var (