From d3918a77b607a9664d1265c0aebc958911f0d681 Mon Sep 17 00:00:00 2001 From: Clockwork Date: Tue, 5 Sep 2023 17:00:57 +0300 Subject: [PATCH] refactor: Add basic GetChainInfo method to plugin API (#3561) * refactor: Analyzer/analizer -> ClientAPI * refactor: rename proto files and rebuild * refactor: Add json tags * wip/refactor: Module analysis * feat: Add chain reference to plugin ClientAPI * feat: Complete Dependencies ClientAPI method * fix: Address review comments * feat: Remove services/chain dep from pkg/cosmosanalysis as per discussion * wip: remove deptools install * feat: package-specific includes * fix: Replace Module List call with Chain Info call * chore: Remove chain analysis code * feat: ChainInfo API example template * chore: Update template cli reference * chore: clean up PR * fix: Address review comments * fix: address review comments * fix: address review comments * fix: Tests and linting * chore: add changelog * fix: linting issues * tests: fix issue with client api in plugin tests * tests: fix plugin template for integration tests --------- Co-authored-by: jeronimoalbi --- changelog.md | 1 + docs/docs/plugins/02-dev-plugins.md | 24 +- ignite/cmd/plugin.go | 30 +- ignite/cmd/plugin_test.go | 6 +- ignite/pkg/cosmosanalysis/module/module.go | 35 +- .../cosmosclient/mocks/account_retriever.go | 2 +- .../cosmosclient/mocks/bank_query_client.go | 2 +- .../pkg/cosmosclient/mocks/faucet_client.go | 12 +- ignite/pkg/cosmosclient/mocks/gasometer.go | 14 +- ignite/pkg/cosmosclient/mocks/rpc_client.go | 2 +- ignite/pkg/cosmosclient/mocks/signer.go | 7 +- ignite/pkg/cosmosgen/generate.go | 2 +- ignite/pkg/cosmostxcollector/mocks/saver.go | 10 +- .../cosmostxcollector/mocks/txs_collector.go | 7 +- ignite/pkg/gomodule/gomodule.go | 4 +- ignite/pkg/protoanalysis/package.go | 63 +- ignite/services/chain/chain.go | 5 + ignite/services/plugin/analyzer.go | 19 - ignite/services/plugin/client_api.go | 44 + ignite/services/plugin/grpc/v1/analyzer.pb.go | 1145 ----------------- .../services/plugin/grpc/v1/client_api.pb.go | 178 +++ ignite/services/plugin/grpc/v1/service.pb.go | 299 ++--- .../plugin/grpc/v1/service_grpc.pb.go | 78 +- ignite/services/plugin/interface.go | 26 +- ignite/services/plugin/mocks/analyzer.go | 85 -- ignite/services/plugin/mocks/client_api.go | 93 ++ ignite/services/plugin/mocks/interface.go | 72 +- ignite/services/plugin/plugin_test.go | 18 +- ignite/services/plugin/protocol.go | 78 +- ignite/services/plugin/template/go.mod.plush | 2 +- ignite/services/plugin/template/main.go.plush | 13 +- .../plugin/testdata/example-plugin/main.go | 11 +- .../services/plugin/grpc/v1/analyzer.proto | 156 --- .../services/plugin/grpc/v1/client_api.proto | 12 + .../services/plugin/grpc/v1/service.proto | 26 +- 35 files changed, 800 insertions(+), 1781 deletions(-) delete mode 100644 ignite/services/plugin/analyzer.go create mode 100644 ignite/services/plugin/client_api.go delete mode 100644 ignite/services/plugin/grpc/v1/analyzer.pb.go create mode 100644 ignite/services/plugin/grpc/v1/client_api.pb.go delete mode 100644 ignite/services/plugin/mocks/analyzer.go create mode 100644 ignite/services/plugin/mocks/client_api.go delete mode 100644 proto/ignite/services/plugin/grpc/v1/analyzer.proto create mode 100644 proto/ignite/services/plugin/grpc/v1/client_api.proto diff --git a/changelog.md b/changelog.md index 16988bc6f3..011f1609d7 100644 --- a/changelog.md +++ b/changelog.md @@ -5,6 +5,7 @@ ### Features - [#3544](https://github.com/ignite/cli/pull/3544) Add bidirectional communication to plugin system +- [#3561](https://github.com/ignite/cli/pull/3561) Add GetChainInfo method to plugin system API ### Changes diff --git a/docs/docs/plugins/02-dev-plugins.md b/docs/docs/plugins/02-dev-plugins.md index 8281cf314f..88df9c74c7 100644 --- a/docs/docs/plugins/02-dev-plugins.md +++ b/docs/docs/plugins/02-dev-plugins.md @@ -47,30 +47,30 @@ type Interface interface { // Execute will be invoked by ignite when a plugin Command is executed. // It is global for all commands declared in Manifest, if you have declared // multiple commands, use cmd.Path to distinguish them. - // The analizer argument can be used by plugins to get chain app analysis info. - Execute(context.Context, *ExecutedCommand, Analyzer) error + // The ClientAPI argument can be used by plugins to get chain app analysis info. + Execute(context.Context, *ExecutedCommand, ClientAPI) error // ExecuteHookPre is invoked by ignite when a command specified by the Hook // path is invoked. // It is global for all hooks declared in Manifest, if you have declared // multiple hooks, use hook.Name to distinguish them. - // The analizer argument can be used by plugins to get chain app analysis info. - ExecuteHookPre(context.Context, *ExecutedHook, Analyzer) error + // The ClientAPI argument can be used by plugins to get chain app analysis info. + ExecuteHookPre(context.Context, *ExecutedHook, ClientAPI) error // ExecuteHookPost is invoked by ignite when a command specified by the hook // path is invoked. // It is global for all hooks declared in Manifest, if you have declared // multiple hooks, use hook.Name to distinguish them. - // The analizer argument can be used by plugins to get chain app analysis info. - ExecuteHookPost(context.Context, *ExecutedHook, Analyzer) error + // The ClientAPI argument can be used by plugins to get chain app analysis info. + ExecuteHookPost(context.Context, *ExecutedHook, ClientAPI) error // ExecuteHookCleanUp is invoked by ignite when a command specified by the // hook path is invoked. Unlike ExecuteHookPost, it is invoked regardless of // execution status of the command and hooks. // It is global for all hooks declared in Manifest, if you have declared // multiple hooks, use hook.Name to distinguish them. - // The analizer argument can be used by plugins to get chain app analysis info. - ExecuteHookCleanUp(context.Context, *ExecutedHook, Analyzer) error + // The ClientAPI argument can be used by plugins to get chain app analysis info. + ExecuteHookCleanUp(context.Context, *ExecutedHook, ClientAPI) error } ``` @@ -160,7 +160,7 @@ To update the plugin execution, you have to change the plugin `Execute` command, for instance : ```go -func (p) Execute(_ context.Context, cmd *plugin.ExecutedCommand, _ plugin.Analyzer) error { +func (p) Execute(_ context.Context, cmd *plugin.ExecutedCommand, _ plugin.ClientAPI) error { if len(cmd.Args) == 0 { return fmt.Errorf("oracle name missing") } @@ -221,7 +221,7 @@ func (p) Manifest(context.Context) (*plugin.Manifest, error) { }, nil } -func (p) ExecuteHookPre(_ context.Context, h *plugin.ExecutedHook, _ plugin.Analyzer) error { +func (p) ExecuteHookPre(_ context.Context, h *plugin.ExecutedHook, _ plugin.ClientAPI) error { switch h.Hook.GetName() { case "my-hook": fmt.Println("I'm executed before ignite chain build") @@ -231,7 +231,7 @@ func (p) ExecuteHookPre(_ context.Context, h *plugin.ExecutedHook, _ plugin.Anal return nil } -func (p) ExecuteHookPost(_ context.Context, h *plugin.ExecutedHook, _ plugin.Analyzer) error { +func (p) ExecuteHookPost(_ context.Context, h *plugin.ExecutedHook, _ plugin.ClientAPI) error { switch h.Hook.GetName() { case "my-hook": fmt.Println("I'm executed after ignite chain build (if no error)") @@ -241,7 +241,7 @@ func (p) ExecuteHookPost(_ context.Context, h *plugin.ExecutedHook, _ plugin.Ana return nil } -func (p) ExecuteHookCleanUp(_ context.Context, h *plugin.ExecutedHook, _ plugin.Analyzer) error { +func (p) ExecuteHookCleanUp(_ context.Context, h *plugin.ExecutedHook, _ plugin.ClientAPI) error { switch h.Hook.GetName() { case "my-hook": fmt.Println("I'm executed after ignite chain build (regardless errors)") diff --git a/ignite/cmd/plugin.go b/ignite/cmd/plugin.go index 4ec19d0393..7730f6bf05 100644 --- a/ignite/cmd/plugin.go +++ b/ignite/cmd/plugin.go @@ -207,7 +207,11 @@ func linkPluginHook(rootCmd *cobra.Command, p *plugin.Plugin, hook *plugin.Hook) } execHook := newExecutedHook(hook, cmd, args) - err := p.Interface.ExecuteHookPre(ctx, execHook, plugin.NewAnalyzer()) + c, err := newChainWithHomeFlags(cmd) + if err != nil { + return err + } + err = p.Interface.ExecuteHookPre(ctx, execHook, plugin.NewClientAPI(c)) if err != nil { return fmt.Errorf("plugin %q ExecuteHookPre() error: %w", p.Path, err) } @@ -223,7 +227,11 @@ func linkPluginHook(rootCmd *cobra.Command, p *plugin.Plugin, hook *plugin.Hook) if err != nil { ctx := cmd.Context() execHook := newExecutedHook(hook, cmd, args) - err := p.Interface.ExecuteHookCleanUp(ctx, execHook, plugin.NewAnalyzer()) + c, err := newChainWithHomeFlags(cmd) + if err != nil { + return err + } + err = p.Interface.ExecuteHookCleanUp(ctx, execHook, plugin.NewClientAPI(c)) if err != nil { fmt.Printf("plugin %q ExecuteHookCleanUp() error: %v", p.Path, err) } @@ -240,8 +248,12 @@ func linkPluginHook(rootCmd *cobra.Command, p *plugin.Plugin, hook *plugin.Hook) ctx := cmd.Context() execHook := newExecutedHook(hook, cmd, args) + c, err := newChainWithHomeFlags(cmd) + if err != nil { + return err + } defer func() { - err := p.Interface.ExecuteHookCleanUp(ctx, execHook, plugin.NewAnalyzer()) + err := p.Interface.ExecuteHookCleanUp(ctx, execHook, plugin.NewClientAPI(c)) if err != nil { fmt.Printf("plugin %q ExecuteHookCleanUp() error: %v", p.Path, err) } @@ -255,7 +267,11 @@ func linkPluginHook(rootCmd *cobra.Command, p *plugin.Plugin, hook *plugin.Hook) } } - err := p.Interface.ExecuteHookPost(ctx, execHook, plugin.NewAnalyzer()) + c, err = newChainWithHomeFlags(cmd) + if err != nil { + return err + } + err = p.Interface.ExecuteHookPost(ctx, execHook, plugin.NewClientAPI(c)) if err != nil { return fmt.Errorf("plugin %q ExecuteHookPost() error : %w", p.Path, err) } @@ -327,7 +343,11 @@ func linkPluginCmd(rootCmd *cobra.Command, p *plugin.Plugin, pluginCmd *plugin.C } execCmd.ImportFlags(cmd) // Call the plugin Execute - err := p.Interface.Execute(ctx, execCmd, plugin.NewAnalyzer()) + c, err := newChainWithHomeFlags(cmd) + if err != nil { + return err + } + err = p.Interface.Execute(ctx, execCmd, plugin.NewClientAPI(c)) // NOTE(tb): This pause gives enough time for go-plugin to sync the // output from stdout/stderr of the plugin. Without that pause, this // output can be discarded and not printed in the user console. diff --git a/ignite/cmd/plugin_test.go b/ignite/cmd/plugin_test.go index e0c7335a7c..a97a29e438 100644 --- a/ignite/cmd/plugin_test.go +++ b/ignite/cmd/plugin_test.go @@ -97,7 +97,7 @@ func TestLinkPluginCmds(t *testing.T) { }), mock.Anything, ). - Run(func(_ context.Context, execCmd *plugin.ExecutedCommand, _ plugin.Analyzer) { + Run(func(_ context.Context, execCmd *plugin.ExecutedCommand, _ plugin.ClientAPI) { // Assert execCmd is populated correctly assert.True(t, strings.HasSuffix(execCmd.Path, cmd.Use), "wrong path %s", execCmd.Path) assert.Equal(t, args, execCmd.Args) @@ -419,8 +419,8 @@ func TestLinkPluginHooks(t *testing.T) { hook.PlaceHookOn == execHook.Hook.PlaceHookOn }) } - asserter := func(hook *plugin.Hook) func(_ context.Context, hook *plugin.ExecutedHook, _ plugin.Analyzer) { - return func(_ context.Context, execHook *plugin.ExecutedHook, _ plugin.Analyzer) { + asserter := func(hook *plugin.Hook) func(_ context.Context, hook *plugin.ExecutedHook, _ plugin.ClientAPI) { + return func(_ context.Context, execHook *plugin.ExecutedHook, _ plugin.ClientAPI) { assert.True(t, strings.HasSuffix(execHook.ExecutedCommand.Path, hook.PlaceHookOn), "wrong path %q want %q", execHook.ExecutedCommand.Path, hook.PlaceHookOn) assert.Equal(t, args, execHook.ExecutedCommand.Args) assertFlags(t, expectedFlags, execHook.ExecutedCommand) diff --git a/ignite/pkg/cosmosanalysis/module/module.go b/ignite/pkg/cosmosanalysis/module/module.go index 16d538e847..a6c446331d 100644 --- a/ignite/pkg/cosmosanalysis/module/module.go +++ b/ignite/pkg/cosmosanalysis/module/module.go @@ -22,57 +22,58 @@ type Msgs map[string][]string // Module keeps metadata about a Cosmos SDK module. type Module struct { // Name of the module. - Name string + Name string `json:"name,omitempty"` // GoModulePath of the app where the module is defined. - GoModulePath string + GoModulePath string `json:"go_module_path,omitempty"` // Pkg holds the proto package info. - Pkg protoanalysis.Package + Pkg protoanalysis.Package `json:"package,omitempty"` // Msg is a list of sdk.Msg implementation of the module. - Msgs []Msg + Msgs []Msg `json:"messages,omitempty"` // HTTPQueries is a list of module queries. - HTTPQueries []HTTPQuery + HTTPQueries []HTTPQuery `json:"http_queries,omitempty"` // Types is a list of proto types that might be used by module. - Types []Type + Types []Type `json:"types,omitempty"` } // Msg keeps metadata about an sdk.Msg implementation. type Msg struct { // Name of the type. - Name string + Name string `json:"name,omitempty"` // URI of the type. - URI string + URI string `json:"uri,omitempty"` - // FilePath is the path of the .proto file where message is defined at. - FilePath string + // File path is the path of the proto file where message is defined. + FilePath string `json:"file_path,omitempty"` } // HTTPQuery is an sdk Query. type HTTPQuery struct { // Name of the RPC func. - Name string + Name string `json:"name,omitempty"` // FullName of the query with service name and rpc func name. - FullName string + FullName string `json:"full_name,omitempty"` // HTTPAnnotations keeps info about http annotations of query. - Rules []protoanalysis.HTTPRule + Rules []protoanalysis.HTTPRule `json:"rules,omitempty"` // Paginated indicates that the query is using pagination. - Paginated bool + Paginated bool `json:"paginated,omitempty"` } // Type is a proto type that might be used by module. type Type struct { - Name string + // Name pf the type. + Name string `json:"name,omitempty"` - // FilePath is the path of the .proto file where message is defined at. - FilePath string + // File path is the path of the .proto file where message is defined at. + FilePath string `json:"file_path,omitempty"` } type moduleDiscoverer struct { diff --git a/ignite/pkg/cosmosclient/mocks/account_retriever.go b/ignite/pkg/cosmosclient/mocks/account_retriever.go index c5ed1de1f6..d01a5c6f6a 100644 --- a/ignite/pkg/cosmosclient/mocks/account_retriever.go +++ b/ignite/pkg/cosmosclient/mocks/account_retriever.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.22.1. DO NOT EDIT. +// Code generated by mockery v2.27.1. DO NOT EDIT. package mocks diff --git a/ignite/pkg/cosmosclient/mocks/bank_query_client.go b/ignite/pkg/cosmosclient/mocks/bank_query_client.go index 76793e1c4b..32b4722b69 100644 --- a/ignite/pkg/cosmosclient/mocks/bank_query_client.go +++ b/ignite/pkg/cosmosclient/mocks/bank_query_client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.22.1. DO NOT EDIT. +// Code generated by mockery v2.27.1. DO NOT EDIT. package mocks diff --git a/ignite/pkg/cosmosclient/mocks/faucet_client.go b/ignite/pkg/cosmosclient/mocks/faucet_client.go index 6c808dce58..12ac46772e 100644 --- a/ignite/pkg/cosmosclient/mocks/faucet_client.go +++ b/ignite/pkg/cosmosclient/mocks/faucet_client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.16.0. DO NOT EDIT. +// Code generated by mockery v2.27.1. DO NOT EDIT. package mocks @@ -28,13 +28,16 @@ func (_m *FaucetClient) Transfer(_a0 context.Context, _a1 cosmosfaucet.TransferR ret := _m.Called(_a0, _a1) var r0 cosmosfaucet.TransferResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, cosmosfaucet.TransferRequest) (cosmosfaucet.TransferResponse, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, cosmosfaucet.TransferRequest) cosmosfaucet.TransferResponse); ok { r0 = rf(_a0, _a1) } else { r0 = ret.Get(0).(cosmosfaucet.TransferResponse) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, cosmosfaucet.TransferRequest) error); ok { r1 = rf(_a0, _a1) } else { @@ -68,6 +71,11 @@ func (_c *FaucetClient_Transfer_Call) Return(_a0 cosmosfaucet.TransferResponse, return _c } +func (_c *FaucetClient_Transfer_Call) RunAndReturn(run func(context.Context, cosmosfaucet.TransferRequest) (cosmosfaucet.TransferResponse, error)) *FaucetClient_Transfer_Call { + _c.Call.Return(run) + return _c +} + type mockConstructorTestingTNewFaucetClient interface { mock.TestingT Cleanup(func()) diff --git a/ignite/pkg/cosmosclient/mocks/gasometer.go b/ignite/pkg/cosmosclient/mocks/gasometer.go index 26b8149585..2bb356b37e 100644 --- a/ignite/pkg/cosmosclient/mocks/gasometer.go +++ b/ignite/pkg/cosmosclient/mocks/gasometer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.16.0. DO NOT EDIT. +// Code generated by mockery v2.27.1. DO NOT EDIT. package mocks @@ -38,6 +38,11 @@ func (_m *Gasometer) CalculateGas(clientCtx grpc.ClientConn, txf tx.Factory, msg ret := _m.Called(_ca...) var r0 *typestx.SimulateResponse + var r1 uint64 + var r2 error + if rf, ok := ret.Get(0).(func(grpc.ClientConn, tx.Factory, ...types.Msg) (*typestx.SimulateResponse, uint64, error)); ok { + return rf(clientCtx, txf, msgs...) + } if rf, ok := ret.Get(0).(func(grpc.ClientConn, tx.Factory, ...types.Msg) *typestx.SimulateResponse); ok { r0 = rf(clientCtx, txf, msgs...) } else { @@ -46,14 +51,12 @@ func (_m *Gasometer) CalculateGas(clientCtx grpc.ClientConn, txf tx.Factory, msg } } - var r1 uint64 if rf, ok := ret.Get(1).(func(grpc.ClientConn, tx.Factory, ...types.Msg) uint64); ok { r1 = rf(clientCtx, txf, msgs...) } else { r1 = ret.Get(1).(uint64) } - var r2 error if rf, ok := ret.Get(2).(func(grpc.ClientConn, tx.Factory, ...types.Msg) error); ok { r2 = rf(clientCtx, txf, msgs...) } else { @@ -95,6 +98,11 @@ func (_c *Gasometer_CalculateGas_Call) Return(_a0 *typestx.SimulateResponse, _a1 return _c } +func (_c *Gasometer_CalculateGas_Call) RunAndReturn(run func(grpc.ClientConn, tx.Factory, ...types.Msg) (*typestx.SimulateResponse, uint64, error)) *Gasometer_CalculateGas_Call { + _c.Call.Return(run) + return _c +} + type mockConstructorTestingTNewGasometer interface { mock.TestingT Cleanup(func()) diff --git a/ignite/pkg/cosmosclient/mocks/rpc_client.go b/ignite/pkg/cosmosclient/mocks/rpc_client.go index d76eae984d..a8b39d43ee 100644 --- a/ignite/pkg/cosmosclient/mocks/rpc_client.go +++ b/ignite/pkg/cosmosclient/mocks/rpc_client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.22.1. DO NOT EDIT. +// Code generated by mockery v2.27.1. DO NOT EDIT. package mocks diff --git a/ignite/pkg/cosmosclient/mocks/signer.go b/ignite/pkg/cosmosclient/mocks/signer.go index b199b10fcf..53914d8a73 100644 --- a/ignite/pkg/cosmosclient/mocks/signer.go +++ b/ignite/pkg/cosmosclient/mocks/signer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.16.0. DO NOT EDIT. +// Code generated by mockery v2.27.1. DO NOT EDIT. package mocks @@ -63,6 +63,11 @@ func (_c *Signer_Sign_Call) Return(_a0 error) *Signer_Sign_Call { return _c } +func (_c *Signer_Sign_Call) RunAndReturn(run func(tx.Factory, string, client.TxBuilder, bool) error) *Signer_Sign_Call { + _c.Call.Return(run) + return _c +} + type mockConstructorTestingTNewSigner interface { mock.TestingT Cleanup(func()) diff --git a/ignite/pkg/cosmosgen/generate.go b/ignite/pkg/cosmosgen/generate.go index 1af5fdc71f..0aad31a8ac 100644 --- a/ignite/pkg/cosmosgen/generate.go +++ b/ignite/pkg/cosmosgen/generate.go @@ -59,7 +59,7 @@ func (g *generator) setup() (err error) { } // Read the dependencies defined in the `go.mod` file - g.deps, err = gomodule.ResolveDependencies(modFile) + g.deps, err = gomodule.ResolveDependencies(modFile, false) if err != nil { return err } diff --git a/ignite/pkg/cosmostxcollector/mocks/saver.go b/ignite/pkg/cosmostxcollector/mocks/saver.go index 734e1f1c11..0f28067f30 100644 --- a/ignite/pkg/cosmostxcollector/mocks/saver.go +++ b/ignite/pkg/cosmostxcollector/mocks/saver.go @@ -1,13 +1,12 @@ -// Code generated by mockery v2.16.0. DO NOT EDIT. +// Code generated by mockery v2.27.1. DO NOT EDIT. package mocks import ( context "context" - mock "github.com/stretchr/testify/mock" - cosmosclient "github.com/ignite/cli/ignite/pkg/cosmosclient" + mock "github.com/stretchr/testify/mock" ) // Saver is an autogenerated mock type for the Saver type @@ -61,6 +60,11 @@ func (_c *Saver_Save_Call) Return(_a0 error) *Saver_Save_Call { return _c } +func (_c *Saver_Save_Call) RunAndReturn(run func(context.Context, []cosmosclient.TX) error) *Saver_Save_Call { + _c.Call.Return(run) + return _c +} + type mockConstructorTestingTNewSaver interface { mock.TestingT Cleanup(func()) diff --git a/ignite/pkg/cosmostxcollector/mocks/txs_collector.go b/ignite/pkg/cosmostxcollector/mocks/txs_collector.go index a80ee11808..9ee77bed6e 100644 --- a/ignite/pkg/cosmostxcollector/mocks/txs_collector.go +++ b/ignite/pkg/cosmostxcollector/mocks/txs_collector.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.16.0. DO NOT EDIT. +// Code generated by mockery v2.27.1. DO NOT EDIT. package mocks @@ -62,6 +62,11 @@ func (_c *TXsCollector_CollectTXs_Call) Return(_a0 error) *TXsCollector_CollectT return _c } +func (_c *TXsCollector_CollectTXs_Call) RunAndReturn(run func(context.Context, int64, chan<- []cosmosclient.TX) error) *TXsCollector_CollectTXs_Call { + _c.Call.Return(run) + return _c +} + type mockConstructorTestingTNewTXsCollector interface { mock.TestingT Cleanup(func()) diff --git a/ignite/pkg/gomodule/gomodule.go b/ignite/pkg/gomodule/gomodule.go index ef5c892328..1418079fcb 100644 --- a/ignite/pkg/gomodule/gomodule.go +++ b/ignite/pkg/gomodule/gomodule.go @@ -52,7 +52,7 @@ func FilterVersions(dependencies []module.Version, paths ...string) []module.Ver return filtered } -func ResolveDependencies(f *modfile.File) ([]module.Version, error) { +func ResolveDependencies(f *modfile.File, includeIndirect bool) ([]module.Version, error) { var versions []module.Version isReplacementAdded := func(rv module.Version) bool { @@ -68,7 +68,7 @@ func ResolveDependencies(f *modfile.File) ([]module.Version, error) { } for _, req := range f.Require { - if req.Indirect { + if req.Indirect && !includeIndirect { continue } if !isReplacementAdded(req.Mod) { diff --git a/ignite/pkg/protoanalysis/package.go b/ignite/pkg/protoanalysis/package.go index 2d53d0e5a3..0067dc64e5 100644 --- a/ignite/pkg/protoanalysis/package.go +++ b/ignite/pkg/protoanalysis/package.go @@ -19,32 +19,31 @@ func (p Packages) Files() Files { // Package represents a proto pkg. type Package struct { // Name of the proto pkg. - Name string + Name string `json:"name,omitempty"` // Path of the package in the fs. - Path string + Path string `json:"path,omitempty"` // Files is a list of .proto files in the package. - Files Files + Files Files `json:"files,omitempty"` // GoImportName is the go package name of proto package. - GoImportName string + GoImportName string `json:"go_import_name,omitempty"` // Messages is a list of proto messages defined in the package. - Messages []Message + Messages []Message `json:"messages,omitempty"` // Services is a list of RPC services. - Services []Service + Services []Service `json:"services,omitempty"` } type Files []File type File struct { // Path of the file. - Path string - - // Dependencies is a list of imported .proto files in this package. - Dependencies []string + Path string `json:"path,omitempty"` + // Dependencies is a list of imported proto packages. + Dependencies []string `json:"dependencies,omitempty"` } func (f Files) Paths() []string { @@ -73,56 +72,54 @@ func (p Package) GoImportPath() string { // Message represents a proto message. type Message struct { // Name of the message. - Name string + Name string `json:"name,omitempty"` - // Path of the file where message is defined at. - Path string + // Path of the proto file where the message is defined. + Path string `json:"path,omitempty"` - // HighestFieldNumber is the highest field number among fields of the message - // This allows to determine new field number when writing to proto message - HighestFieldNumber int + // Highest field name is the highest field number among fields of the message. + // This allows to determine new field number when writing to proto message. + HighestFieldNumber int `json:"highest_field_number,omitempty"` - // Fields contains message's field names and types - Fields map[string]string + // Fields contains message's field names and types. + Fields map[string]string `json:"fields,omitempty"` } // Service is an RPC service. type Service struct { // Name of the services. - Name string + Name string `json:"name,omitempty"` // RPC is a list of RPC funcs of the service. - RPCFuncs []RPCFunc + RPCFuncs []RPCFunc `json:"functions,omitempty"` } // RPCFunc is an RPC func. type RPCFunc struct { // Name of the RPC func. - Name string + Name string `json:"name,omitempty"` // RequestType is the request type of RPC func. - RequestType string + RequestType string `json:"request_type,omitempty"` // ReturnsType is the response type of RPC func. - ReturnsType string + ReturnsType string `json:"return_type,omitempty"` // HTTPRules keeps info about http rules of an RPC func. // spec: // https://github.com/googleapis/googleapis/blob/master/google/api/http.proto. - HTTPRules []HTTPRule + HTTPRules []HTTPRule `json:"http_rules,omitempty"` // Paginated indicates that the RPC function is using pagination. - Paginated bool + Paginated bool `json:"paginated,omitempty"` } // HTTPRule keeps info about a configured http rule of an RPC func. type HTTPRule struct { - // Params is a list of parameters defined in the http endpoint itself. - Params []string - - // HasQuery indicates if there is a request query. - HasQuery bool - - // HasBody indicates if there is a request payload. - HasBody bool + // Params is a list of parameters defined in the HTTP endpoint itself. + Params []string `json:"params,omitempty"` + // Has query indicates if there is a request query. + HasQuery bool `json:"has_query,omitempty"` + // Has body indicates if there is a request payload. + HasBody bool `json:"has_body,omitempty"` } diff --git a/ignite/services/chain/chain.go b/ignite/services/chain/chain.go index 2bc222ab57..4e8af01382 100644 --- a/ignite/services/chain/chain.go +++ b/ignite/services/chain/chain.go @@ -314,6 +314,11 @@ func (c *Chain) Home() (string, error) { return home, nil } +// AppPath returns the configured App's path. +func (c *Chain) AppPath() string { + return c.app.Path +} + // DefaultHome returns the blockchain node's default home dir when not specified in the app. func (c *Chain) DefaultHome() (string, error) { // check if home is defined in config diff --git a/ignite/services/plugin/analyzer.go b/ignite/services/plugin/analyzer.go deleted file mode 100644 index 081d73d5d1..0000000000 --- a/ignite/services/plugin/analyzer.go +++ /dev/null @@ -1,19 +0,0 @@ -package plugin - -import "context" - -// NewAnalyzer creates a new app analyzer. -func NewAnalyzer() Analyzer { - return analyzer{} -} - -type analyzer struct{} - -// TODO: Implement dependency analyzer. - -// Deoendencies returns chain app dependencies. -func (a analyzer) Dependencies(_ context.Context) ([]*Dependency, error) { - return []*Dependency{ - {Path: "Foo"}, - }, nil -} diff --git a/ignite/services/plugin/client_api.go b/ignite/services/plugin/client_api.go new file mode 100644 index 0000000000..193ac93487 --- /dev/null +++ b/ignite/services/plugin/client_api.go @@ -0,0 +1,44 @@ +package plugin + +import ( + "context" +) + +type Chainer interface { + // AppPath returns the configured App's path. + AppPath() string + // ID returns the configured App's chain id. + ID() (string, error) + // ConfigPath returns the path to the App's config file. + ConfigPath() string + // RPCPublicAddress returns the configured App's rpc endpoint. + RPCPublicAddress() (string, error) +} + +// NewClientAPI creates a new app ClientAPI. +func NewClientAPI(c Chainer) ClientAPI { + return clientAPI{chain: c} +} + +type clientAPI struct { + chain Chainer +} + +func (api clientAPI) GetChainInfo(_ context.Context) (*ChainInfo, error) { + chainID, err := api.chain.ID() + if err != nil { + return nil, err + } + appPath := api.chain.AppPath() + configPath := api.chain.ConfigPath() + rpc, err := api.chain.RPCPublicAddress() + if err != nil { + return nil, err + } + return &ChainInfo{ + ChainId: chainID, + AppPath: appPath, + ConfigPath: configPath, + RpcAddress: rpc, + }, nil +} diff --git a/ignite/services/plugin/grpc/v1/analyzer.pb.go b/ignite/services/plugin/grpc/v1/analyzer.pb.go deleted file mode 100644 index 7fe1148378..0000000000 --- a/ignite/services/plugin/grpc/v1/analyzer.pb.go +++ /dev/null @@ -1,1145 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: ignite/services/plugin/grpc/v1/analyzer.proto - -package v1 - -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) -) - -// Dependecy keeps data about Go module dependencies. -type Dependency struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Path is the absolute path to the Go module. - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - // Modules contains the list of modules defined by the dependency. - Modules []*Module `protobuf:"bytes,2,rep,name=modules,proto3" json:"modules,omitempty"` -} - -func (x *Dependency) Reset() { - *x = Dependency{} - if protoimpl.UnsafeEnabled { - mi := &file_ignite_services_plugin_grpc_v1_analyzer_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Dependency) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Dependency) ProtoMessage() {} - -func (x *Dependency) ProtoReflect() protoreflect.Message { - mi := &file_ignite_services_plugin_grpc_v1_analyzer_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 Dependency.ProtoReflect.Descriptor instead. -func (*Dependency) Descriptor() ([]byte, []int) { - return file_ignite_services_plugin_grpc_v1_analyzer_proto_rawDescGZIP(), []int{0} -} - -func (x *Dependency) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -func (x *Dependency) GetModules() []*Module { - if x != nil { - return x.Modules - } - return nil -} - -// Module keeps metadata about a Cosmos SDK module. -type Module struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Name of the module. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Go module path of the app where the module is defined. - GoModulePath string `protobuf:"bytes,2,opt,name=go_module_path,json=goModulePath,proto3" json:"go_module_path,omitempty"` - // Package contains proto package info. - Package *ProtoPackage `protobuf:"bytes,3,opt,name=package,proto3" json:"package,omitempty"` - // Messages is the list of sdk.Msg that the module implements. - Messages []*Message `protobuf:"bytes,4,rep,name=messages,proto3" json:"messages,omitempty"` - // HTTP queries is a list of module queries. - HttpQueries []*HTTPQuery `protobuf:"bytes,5,rep,name=http_queries,json=httpQueries,proto3" json:"http_queries,omitempty"` - // Types is a list of proto types that could be used by the module. - Types []*Type `protobuf:"bytes,6,rep,name=types,proto3" json:"types,omitempty"` -} - -func (x *Module) Reset() { - *x = Module{} - if protoimpl.UnsafeEnabled { - mi := &file_ignite_services_plugin_grpc_v1_analyzer_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Module) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Module) ProtoMessage() {} - -func (x *Module) ProtoReflect() protoreflect.Message { - mi := &file_ignite_services_plugin_grpc_v1_analyzer_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 Module.ProtoReflect.Descriptor instead. -func (*Module) Descriptor() ([]byte, []int) { - return file_ignite_services_plugin_grpc_v1_analyzer_proto_rawDescGZIP(), []int{1} -} - -func (x *Module) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Module) GetGoModulePath() string { - if x != nil { - return x.GoModulePath - } - return "" -} - -func (x *Module) GetPackage() *ProtoPackage { - if x != nil { - return x.Package - } - return nil -} - -func (x *Module) GetMessages() []*Message { - if x != nil { - return x.Messages - } - return nil -} - -func (x *Module) GetHttpQueries() []*HTTPQuery { - if x != nil { - return x.HttpQueries - } - return nil -} - -func (x *Module) GetTypes() []*Type { - if x != nil { - return x.Types - } - return nil -} - -// ProtoPackage represents a proto package. -type ProtoPackage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Name of the proto package. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Path of the proto package. - Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` - // Files is list of package proto files. - Files []*ProtoFile `protobuf:"bytes,3,rep,name=files,proto3" json:"files,omitempty"` - // Go import name for the proto package. - GoImportName string `protobuf:"bytes,4,opt,name=go_import_name,json=goImportName,proto3" json:"go_import_name,omitempty"` - // Messages is list of messages defined within the proto package. - Messages []*ProtoMessage `protobuf:"bytes,5,rep,name=messages,proto3" json:"messages,omitempty"` - // Services is list of services defined within the proto package. - Services []*ProtoService `protobuf:"bytes,6,rep,name=services,proto3" json:"services,omitempty"` -} - -func (x *ProtoPackage) Reset() { - *x = ProtoPackage{} - if protoimpl.UnsafeEnabled { - mi := &file_ignite_services_plugin_grpc_v1_analyzer_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ProtoPackage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ProtoPackage) ProtoMessage() {} - -func (x *ProtoPackage) ProtoReflect() protoreflect.Message { - mi := &file_ignite_services_plugin_grpc_v1_analyzer_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 ProtoPackage.ProtoReflect.Descriptor instead. -func (*ProtoPackage) Descriptor() ([]byte, []int) { - return file_ignite_services_plugin_grpc_v1_analyzer_proto_rawDescGZIP(), []int{2} -} - -func (x *ProtoPackage) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ProtoPackage) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -func (x *ProtoPackage) GetFiles() []*ProtoFile { - if x != nil { - return x.Files - } - return nil -} - -func (x *ProtoPackage) GetGoImportName() string { - if x != nil { - return x.GoImportName - } - return "" -} - -func (x *ProtoPackage) GetMessages() []*ProtoMessage { - if x != nil { - return x.Messages - } - return nil -} - -func (x *ProtoPackage) GetServices() []*ProtoService { - if x != nil { - return x.Services - } - return nil -} - -// ProtoFile represents a proto file. -type ProtoFile struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Path to the file. - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - // Dependencies is a list of imported proto packages. - Dependencies []string `protobuf:"bytes,2,rep,name=dependencies,proto3" json:"dependencies,omitempty"` -} - -func (x *ProtoFile) Reset() { - *x = ProtoFile{} - if protoimpl.UnsafeEnabled { - mi := &file_ignite_services_plugin_grpc_v1_analyzer_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ProtoFile) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ProtoFile) ProtoMessage() {} - -func (x *ProtoFile) ProtoReflect() protoreflect.Message { - mi := &file_ignite_services_plugin_grpc_v1_analyzer_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 ProtoFile.ProtoReflect.Descriptor instead. -func (*ProtoFile) Descriptor() ([]byte, []int) { - return file_ignite_services_plugin_grpc_v1_analyzer_proto_rawDescGZIP(), []int{3} -} - -func (x *ProtoFile) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -func (x *ProtoFile) GetDependencies() []string { - if x != nil { - return x.Dependencies - } - return nil -} - -// ProtoMessage represents a proto message. -type ProtoMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Name of the message. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Path of the proto file where the message is defined. - Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` - // Highest field name is the highest field number among fields of the message. - // This allows to determine new field number when writing to proto message. - HighestFieldNumber int32 `protobuf:"varint,3,opt,name=highest_field_number,json=highestFieldNumber,proto3" json:"highest_field_number,omitempty"` - // Fields contains message's field names and types. - Fields map[string]string `protobuf:"bytes,4,rep,name=fields,proto3" json:"fields,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *ProtoMessage) Reset() { - *x = ProtoMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_ignite_services_plugin_grpc_v1_analyzer_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ProtoMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ProtoMessage) ProtoMessage() {} - -func (x *ProtoMessage) ProtoReflect() protoreflect.Message { - mi := &file_ignite_services_plugin_grpc_v1_analyzer_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 ProtoMessage.ProtoReflect.Descriptor instead. -func (*ProtoMessage) Descriptor() ([]byte, []int) { - return file_ignite_services_plugin_grpc_v1_analyzer_proto_rawDescGZIP(), []int{4} -} - -func (x *ProtoMessage) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ProtoMessage) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -func (x *ProtoMessage) GetHighestFieldNumber() int32 { - if x != nil { - return x.HighestFieldNumber - } - return 0 -} - -func (x *ProtoMessage) GetFields() map[string]string { - if x != nil { - return x.Fields - } - return nil -} - -// ProtoService represents a proto RPC service. -type ProtoService struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Name of the service. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Functions is a list of RPC functions. - Functions []*ProtoServiceFunc `protobuf:"bytes,2,rep,name=functions,proto3" json:"functions,omitempty"` -} - -func (x *ProtoService) Reset() { - *x = ProtoService{} - if protoimpl.UnsafeEnabled { - mi := &file_ignite_services_plugin_grpc_v1_analyzer_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ProtoService) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ProtoService) ProtoMessage() {} - -func (x *ProtoService) ProtoReflect() protoreflect.Message { - mi := &file_ignite_services_plugin_grpc_v1_analyzer_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 ProtoService.ProtoReflect.Descriptor instead. -func (*ProtoService) Descriptor() ([]byte, []int) { - return file_ignite_services_plugin_grpc_v1_analyzer_proto_rawDescGZIP(), []int{5} -} - -func (x *ProtoService) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ProtoService) GetFunctions() []*ProtoServiceFunc { - if x != nil { - return x.Functions - } - return nil -} - -// Proto service func represents a proto RPC function. -type ProtoServiceFunc struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Name of the RPC function. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Request type is the request type of the RPC function. - RequestType string `protobuf:"bytes,2,opt,name=request_type,json=requestType,proto3" json:"request_type,omitempty"` - // Return type is the return type of the RPC function. - ReturnType string `protobuf:"bytes,3,opt,name=return_type,json=returnType,proto3" json:"return_type,omitempty"` - // Paginated indicates that the function is using pagination. - Paginated bool `protobuf:"varint,4,opt,name=paginated,proto3" json:"paginated,omitempty"` - // HTTP rules keeps info about HTTP annotations of query. - HttpRules []*HTTPRule `protobuf:"bytes,5,rep,name=http_rules,json=httpRules,proto3" json:"http_rules,omitempty"` -} - -func (x *ProtoServiceFunc) Reset() { - *x = ProtoServiceFunc{} - if protoimpl.UnsafeEnabled { - mi := &file_ignite_services_plugin_grpc_v1_analyzer_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ProtoServiceFunc) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ProtoServiceFunc) ProtoMessage() {} - -func (x *ProtoServiceFunc) ProtoReflect() protoreflect.Message { - mi := &file_ignite_services_plugin_grpc_v1_analyzer_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 ProtoServiceFunc.ProtoReflect.Descriptor instead. -func (*ProtoServiceFunc) Descriptor() ([]byte, []int) { - return file_ignite_services_plugin_grpc_v1_analyzer_proto_rawDescGZIP(), []int{6} -} - -func (x *ProtoServiceFunc) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ProtoServiceFunc) GetRequestType() string { - if x != nil { - return x.RequestType - } - return "" -} - -func (x *ProtoServiceFunc) GetReturnType() string { - if x != nil { - return x.ReturnType - } - return "" -} - -func (x *ProtoServiceFunc) GetPaginated() bool { - if x != nil { - return x.Paginated - } - return false -} - -func (x *ProtoServiceFunc) GetHttpRules() []*HTTPRule { - if x != nil { - return x.HttpRules - } - return nil -} - -// Message keeps metadata about an sdk.Msg implementation. -type Message struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Name of the type. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // URI of the type. - Uri string `protobuf:"bytes,2,opt,name=uri,proto3" json:"uri,omitempty"` - // File path is the path of the proto file where message is defined. - FilePath string `protobuf:"bytes,3,opt,name=file_path,json=filePath,proto3" json:"file_path,omitempty"` -} - -func (x *Message) Reset() { - *x = Message{} - if protoimpl.UnsafeEnabled { - mi := &file_ignite_services_plugin_grpc_v1_analyzer_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Message) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Message) ProtoMessage() {} - -func (x *Message) ProtoReflect() protoreflect.Message { - mi := &file_ignite_services_plugin_grpc_v1_analyzer_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 Message.ProtoReflect.Descriptor instead. -func (*Message) Descriptor() ([]byte, []int) { - return file_ignite_services_plugin_grpc_v1_analyzer_proto_rawDescGZIP(), []int{7} -} - -func (x *Message) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Message) GetUri() string { - if x != nil { - return x.Uri - } - return "" -} - -func (x *Message) GetFilePath() string { - if x != nil { - return x.FilePath - } - return "" -} - -// HTTPQuery is an SDK query. -type HTTPQuery struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Name of the RPC function. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Full name of the query with service name and RPC function name. - FullName string `protobuf:"bytes,2,opt,name=full_name,json=fullName,proto3" json:"full_name,omitempty"` - // Paginated indicates that the query is using pagination. - Paginated bool `protobuf:"varint,3,opt,name=paginated,proto3" json:"paginated,omitempty"` - // HTTP rules keeps info about HTTP annotations of query. - Rules []*HTTPRule `protobuf:"bytes,4,rep,name=rules,proto3" json:"rules,omitempty"` -} - -func (x *HTTPQuery) Reset() { - *x = HTTPQuery{} - if protoimpl.UnsafeEnabled { - mi := &file_ignite_services_plugin_grpc_v1_analyzer_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HTTPQuery) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HTTPQuery) ProtoMessage() {} - -func (x *HTTPQuery) ProtoReflect() protoreflect.Message { - mi := &file_ignite_services_plugin_grpc_v1_analyzer_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 HTTPQuery.ProtoReflect.Descriptor instead. -func (*HTTPQuery) Descriptor() ([]byte, []int) { - return file_ignite_services_plugin_grpc_v1_analyzer_proto_rawDescGZIP(), []int{8} -} - -func (x *HTTPQuery) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *HTTPQuery) GetFullName() string { - if x != nil { - return x.FullName - } - return "" -} - -func (x *HTTPQuery) GetPaginated() bool { - if x != nil { - return x.Paginated - } - return false -} - -func (x *HTTPQuery) GetRules() []*HTTPRule { - if x != nil { - return x.Rules - } - return nil -} - -// HTTP rule keeps info about a configured HTTP rule of an RPC function. -type HTTPRule struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Params is a list of parameters defined in the HTTP endpoint itself. - Params []string `protobuf:"bytes,1,rep,name=params,proto3" json:"params,omitempty"` - // Has query indicates if there is a request query. - HasQuery bool `protobuf:"varint,2,opt,name=has_query,json=hasQuery,proto3" json:"has_query,omitempty"` - // Has body indicates if there is a request payload. - HasBody bool `protobuf:"varint,3,opt,name=has_body,json=hasBody,proto3" json:"has_body,omitempty"` -} - -func (x *HTTPRule) Reset() { - *x = HTTPRule{} - if protoimpl.UnsafeEnabled { - mi := &file_ignite_services_plugin_grpc_v1_analyzer_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HTTPRule) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HTTPRule) ProtoMessage() {} - -func (x *HTTPRule) ProtoReflect() protoreflect.Message { - mi := &file_ignite_services_plugin_grpc_v1_analyzer_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 HTTPRule.ProtoReflect.Descriptor instead. -func (*HTTPRule) Descriptor() ([]byte, []int) { - return file_ignite_services_plugin_grpc_v1_analyzer_proto_rawDescGZIP(), []int{9} -} - -func (x *HTTPRule) GetParams() []string { - if x != nil { - return x.Params - } - return nil -} - -func (x *HTTPRule) GetHasQuery() bool { - if x != nil { - return x.HasQuery - } - return false -} - -func (x *HTTPRule) GetHasBody() bool { - if x != nil { - return x.HasBody - } - return false -} - -// Type is a proto type. -type Type struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Name pf the type. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // File path is the path of the .proto file where message is defined at. - FilePath string `protobuf:"bytes,2,opt,name=file_path,json=filePath,proto3" json:"file_path,omitempty"` -} - -func (x *Type) Reset() { - *x = Type{} - if protoimpl.UnsafeEnabled { - mi := &file_ignite_services_plugin_grpc_v1_analyzer_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Type) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Type) ProtoMessage() {} - -func (x *Type) ProtoReflect() protoreflect.Message { - mi := &file_ignite_services_plugin_grpc_v1_analyzer_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 Type.ProtoReflect.Descriptor instead. -func (*Type) Descriptor() ([]byte, []int) { - return file_ignite_services_plugin_grpc_v1_analyzer_proto_rawDescGZIP(), []int{10} -} - -func (x *Type) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Type) GetFilePath() string { - if x != nil { - return x.FilePath - } - return "" -} - -var File_ignite_services_plugin_grpc_v1_analyzer_proto protoreflect.FileDescriptor - -var file_ignite_services_plugin_grpc_v1_analyzer_proto_rawDesc = []byte{ - 0x0a, 0x2d, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, - 0x2f, 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x7a, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x1e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x22, - 0x62, 0x0a, 0x0a, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x12, 0x0a, - 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, - 0x68, 0x12, 0x40, 0x0a, 0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x07, 0x6d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x73, 0x22, 0xd9, 0x02, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x67, 0x6f, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, - 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x67, 0x6f, 0x4d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x46, 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, - 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x69, 0x67, 0x6e, 0x69, - 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, - 0x12, 0x43, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x4c, 0x0a, 0x0c, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x71, 0x75, - 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x67, - 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x54, 0x54, - 0x50, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x0b, 0x68, 0x74, 0x74, 0x70, 0x51, 0x75, 0x65, 0x72, - 0x69, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x22, - 0xb1, 0x02, 0x0a, 0x0c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x3f, 0x0a, 0x05, 0x66, 0x69, 0x6c, 0x65, - 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x46, 0x69, - 0x6c, 0x65, 0x52, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x24, 0x0a, 0x0e, 0x67, 0x6f, 0x5f, - 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0c, 0x67, 0x6f, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x48, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x2c, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, - 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x48, 0x0a, 0x08, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x69, 0x67, - 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x22, 0x43, 0x0a, 0x09, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x46, 0x69, 0x6c, 0x65, - 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x70, 0x61, 0x74, 0x68, 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, - 0x63, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x65, - 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x22, 0xf5, 0x01, 0x0a, 0x0c, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, - 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, - 0x68, 0x12, 0x30, 0x0a, 0x14, 0x68, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x5f, 0x66, 0x69, 0x65, - 0x6c, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x12, 0x68, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4e, 0x75, 0x6d, - 0x62, 0x65, 0x72, 0x12, 0x50, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x04, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x66, - 0x69, 0x65, 0x6c, 0x64, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, - 0x22, 0x72, 0x0a, 0x0c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x4e, 0x0a, 0x09, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x46, 0x75, 0x6e, 0x63, 0x52, 0x09, 0x66, 0x75, 0x6e, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xd1, 0x01, 0x0a, 0x10, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x46, 0x75, 0x6e, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, - 0x0c, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x64, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x64, 0x12, - 0x47, 0x0a, 0x0a, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x05, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x09, 0x68, - 0x74, 0x74, 0x70, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x22, 0x4c, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x69, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x69, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, - 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, - 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, 0x22, 0x9a, 0x01, 0x0a, 0x09, 0x48, 0x54, 0x54, 0x50, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x75, 0x6c, 0x6c, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x75, 0x6c, - 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, - 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, - 0x74, 0x65, 0x64, 0x12, 0x3e, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x75, - 0x6c, 0x65, 0x73, 0x22, 0x5a, 0x0a, 0x08, 0x48, 0x54, 0x54, 0x50, 0x52, 0x75, 0x6c, 0x65, 0x12, - 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x68, 0x61, 0x73, 0x5f, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x68, 0x61, 0x73, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x68, 0x61, 0x73, 0x5f, 0x62, 0x6f, 0x64, 0x79, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x68, 0x61, 0x73, 0x42, 0x6f, 0x64, 0x79, 0x22, - 0x37, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x66, - 0x69, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x66, 0x69, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x63, 0x6c, - 0x69, 0x2f, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_ignite_services_plugin_grpc_v1_analyzer_proto_rawDescOnce sync.Once - file_ignite_services_plugin_grpc_v1_analyzer_proto_rawDescData = file_ignite_services_plugin_grpc_v1_analyzer_proto_rawDesc -) - -func file_ignite_services_plugin_grpc_v1_analyzer_proto_rawDescGZIP() []byte { - file_ignite_services_plugin_grpc_v1_analyzer_proto_rawDescOnce.Do(func() { - file_ignite_services_plugin_grpc_v1_analyzer_proto_rawDescData = protoimpl.X.CompressGZIP(file_ignite_services_plugin_grpc_v1_analyzer_proto_rawDescData) - }) - return file_ignite_services_plugin_grpc_v1_analyzer_proto_rawDescData -} - -var file_ignite_services_plugin_grpc_v1_analyzer_proto_msgTypes = make([]protoimpl.MessageInfo, 12) -var file_ignite_services_plugin_grpc_v1_analyzer_proto_goTypes = []interface{}{ - (*Dependency)(nil), // 0: ignite.services.plugin.grpc.v1.Dependency - (*Module)(nil), // 1: ignite.services.plugin.grpc.v1.Module - (*ProtoPackage)(nil), // 2: ignite.services.plugin.grpc.v1.ProtoPackage - (*ProtoFile)(nil), // 3: ignite.services.plugin.grpc.v1.ProtoFile - (*ProtoMessage)(nil), // 4: ignite.services.plugin.grpc.v1.ProtoMessage - (*ProtoService)(nil), // 5: ignite.services.plugin.grpc.v1.ProtoService - (*ProtoServiceFunc)(nil), // 6: ignite.services.plugin.grpc.v1.ProtoServiceFunc - (*Message)(nil), // 7: ignite.services.plugin.grpc.v1.Message - (*HTTPQuery)(nil), // 8: ignite.services.plugin.grpc.v1.HTTPQuery - (*HTTPRule)(nil), // 9: ignite.services.plugin.grpc.v1.HTTPRule - (*Type)(nil), // 10: ignite.services.plugin.grpc.v1.Type - nil, // 11: ignite.services.plugin.grpc.v1.ProtoMessage.FieldsEntry -} -var file_ignite_services_plugin_grpc_v1_analyzer_proto_depIdxs = []int32{ - 1, // 0: ignite.services.plugin.grpc.v1.Dependency.modules:type_name -> ignite.services.plugin.grpc.v1.Module - 2, // 1: ignite.services.plugin.grpc.v1.Module.package:type_name -> ignite.services.plugin.grpc.v1.ProtoPackage - 7, // 2: ignite.services.plugin.grpc.v1.Module.messages:type_name -> ignite.services.plugin.grpc.v1.Message - 8, // 3: ignite.services.plugin.grpc.v1.Module.http_queries:type_name -> ignite.services.plugin.grpc.v1.HTTPQuery - 10, // 4: ignite.services.plugin.grpc.v1.Module.types:type_name -> ignite.services.plugin.grpc.v1.Type - 3, // 5: ignite.services.plugin.grpc.v1.ProtoPackage.files:type_name -> ignite.services.plugin.grpc.v1.ProtoFile - 4, // 6: ignite.services.plugin.grpc.v1.ProtoPackage.messages:type_name -> ignite.services.plugin.grpc.v1.ProtoMessage - 5, // 7: ignite.services.plugin.grpc.v1.ProtoPackage.services:type_name -> ignite.services.plugin.grpc.v1.ProtoService - 11, // 8: ignite.services.plugin.grpc.v1.ProtoMessage.fields:type_name -> ignite.services.plugin.grpc.v1.ProtoMessage.FieldsEntry - 6, // 9: ignite.services.plugin.grpc.v1.ProtoService.functions:type_name -> ignite.services.plugin.grpc.v1.ProtoServiceFunc - 9, // 10: ignite.services.plugin.grpc.v1.ProtoServiceFunc.http_rules:type_name -> ignite.services.plugin.grpc.v1.HTTPRule - 9, // 11: ignite.services.plugin.grpc.v1.HTTPQuery.rules:type_name -> ignite.services.plugin.grpc.v1.HTTPRule - 12, // [12:12] is the sub-list for method output_type - 12, // [12:12] is the sub-list for method input_type - 12, // [12:12] is the sub-list for extension type_name - 12, // [12:12] is the sub-list for extension extendee - 0, // [0:12] is the sub-list for field type_name -} - -func init() { file_ignite_services_plugin_grpc_v1_analyzer_proto_init() } -func file_ignite_services_plugin_grpc_v1_analyzer_proto_init() { - if File_ignite_services_plugin_grpc_v1_analyzer_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_ignite_services_plugin_grpc_v1_analyzer_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Dependency); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ignite_services_plugin_grpc_v1_analyzer_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Module); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ignite_services_plugin_grpc_v1_analyzer_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoPackage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ignite_services_plugin_grpc_v1_analyzer_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoFile); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ignite_services_plugin_grpc_v1_analyzer_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ignite_services_plugin_grpc_v1_analyzer_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoService); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ignite_services_plugin_grpc_v1_analyzer_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoServiceFunc); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ignite_services_plugin_grpc_v1_analyzer_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Message); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ignite_services_plugin_grpc_v1_analyzer_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HTTPQuery); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ignite_services_plugin_grpc_v1_analyzer_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HTTPRule); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ignite_services_plugin_grpc_v1_analyzer_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Type); 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_ignite_services_plugin_grpc_v1_analyzer_proto_rawDesc, - NumEnums: 0, - NumMessages: 12, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_ignite_services_plugin_grpc_v1_analyzer_proto_goTypes, - DependencyIndexes: file_ignite_services_plugin_grpc_v1_analyzer_proto_depIdxs, - MessageInfos: file_ignite_services_plugin_grpc_v1_analyzer_proto_msgTypes, - }.Build() - File_ignite_services_plugin_grpc_v1_analyzer_proto = out.File - file_ignite_services_plugin_grpc_v1_analyzer_proto_rawDesc = nil - file_ignite_services_plugin_grpc_v1_analyzer_proto_goTypes = nil - file_ignite_services_plugin_grpc_v1_analyzer_proto_depIdxs = nil -} diff --git a/ignite/services/plugin/grpc/v1/client_api.pb.go b/ignite/services/plugin/grpc/v1/client_api.pb.go new file mode 100644 index 0000000000..d0a5a00f68 --- /dev/null +++ b/ignite/services/plugin/grpc/v1/client_api.pb.go @@ -0,0 +1,178 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: ignite/services/plugin/grpc/v1/client_api.proto + +package v1 + +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 ChainInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + AppPath string `protobuf:"bytes,2,opt,name=app_path,json=appPath,proto3" json:"app_path,omitempty"` + ConfigPath string `protobuf:"bytes,3,opt,name=config_path,json=configPath,proto3" json:"config_path,omitempty"` + RpcAddress string `protobuf:"bytes,4,opt,name=rpc_address,json=rpcAddress,proto3" json:"rpc_address,omitempty"` +} + +func (x *ChainInfo) Reset() { + *x = ChainInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_ignite_services_plugin_grpc_v1_client_api_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChainInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChainInfo) ProtoMessage() {} + +func (x *ChainInfo) ProtoReflect() protoreflect.Message { + mi := &file_ignite_services_plugin_grpc_v1_client_api_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 ChainInfo.ProtoReflect.Descriptor instead. +func (*ChainInfo) Descriptor() ([]byte, []int) { + return file_ignite_services_plugin_grpc_v1_client_api_proto_rawDescGZIP(), []int{0} +} + +func (x *ChainInfo) GetChainId() string { + if x != nil { + return x.ChainId + } + return "" +} + +func (x *ChainInfo) GetAppPath() string { + if x != nil { + return x.AppPath + } + return "" +} + +func (x *ChainInfo) GetConfigPath() string { + if x != nil { + return x.ConfigPath + } + return "" +} + +func (x *ChainInfo) GetRpcAddress() string { + if x != nil { + return x.RpcAddress + } + return "" +} + +var File_ignite_services_plugin_grpc_v1_client_api_proto protoreflect.FileDescriptor + +var file_ignite_services_plugin_grpc_v1_client_api_proto_rawDesc = []byte{ + 0x0a, 0x2f, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x73, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, + 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x1e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, + 0x31, 0x22, 0x83, 0x01, 0x0a, 0x09, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, + 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, + 0x70, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x70, + 0x70, 0x50, 0x61, 0x74, 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, + 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x50, 0x61, 0x74, 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x70, 0x63, 0x5f, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x70, 0x63, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x63, 0x6c, 0x69, + 0x2f, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, + 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_ignite_services_plugin_grpc_v1_client_api_proto_rawDescOnce sync.Once + file_ignite_services_plugin_grpc_v1_client_api_proto_rawDescData = file_ignite_services_plugin_grpc_v1_client_api_proto_rawDesc +) + +func file_ignite_services_plugin_grpc_v1_client_api_proto_rawDescGZIP() []byte { + file_ignite_services_plugin_grpc_v1_client_api_proto_rawDescOnce.Do(func() { + file_ignite_services_plugin_grpc_v1_client_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_ignite_services_plugin_grpc_v1_client_api_proto_rawDescData) + }) + return file_ignite_services_plugin_grpc_v1_client_api_proto_rawDescData +} + +var file_ignite_services_plugin_grpc_v1_client_api_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_ignite_services_plugin_grpc_v1_client_api_proto_goTypes = []interface{}{ + (*ChainInfo)(nil), // 0: ignite.services.plugin.grpc.v1.ChainInfo +} +var file_ignite_services_plugin_grpc_v1_client_api_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_ignite_services_plugin_grpc_v1_client_api_proto_init() } +func file_ignite_services_plugin_grpc_v1_client_api_proto_init() { + if File_ignite_services_plugin_grpc_v1_client_api_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_ignite_services_plugin_grpc_v1_client_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChainInfo); 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_ignite_services_plugin_grpc_v1_client_api_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_ignite_services_plugin_grpc_v1_client_api_proto_goTypes, + DependencyIndexes: file_ignite_services_plugin_grpc_v1_client_api_proto_depIdxs, + MessageInfos: file_ignite_services_plugin_grpc_v1_client_api_proto_msgTypes, + }.Build() + File_ignite_services_plugin_grpc_v1_client_api_proto = out.File + file_ignite_services_plugin_grpc_v1_client_api_proto_rawDesc = nil + file_ignite_services_plugin_grpc_v1_client_api_proto_goTypes = nil + file_ignite_services_plugin_grpc_v1_client_api_proto_depIdxs = nil +} diff --git a/ignite/services/plugin/grpc/v1/service.pb.go b/ignite/services/plugin/grpc/v1/service.pb.go index 4f31f8d541..7cd54c135e 100644 --- a/ignite/services/plugin/grpc/v1/service.pb.go +++ b/ignite/services/plugin/grpc/v1/service.pb.go @@ -110,8 +110,8 @@ type ExecuteRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Cmd *ExecutedCommand `protobuf:"bytes,1,opt,name=cmd,proto3" json:"cmd,omitempty"` - Analyzer uint32 `protobuf:"varint,2,opt,name=analyzer,proto3" json:"analyzer,omitempty"` + Cmd *ExecutedCommand `protobuf:"bytes,1,opt,name=cmd,proto3" json:"cmd,omitempty"` + ClientApi uint32 `protobuf:"varint,2,opt,name=client_api,json=clientApi,proto3" json:"client_api,omitempty"` } func (x *ExecuteRequest) Reset() { @@ -153,9 +153,9 @@ func (x *ExecuteRequest) GetCmd() *ExecutedCommand { return nil } -func (x *ExecuteRequest) GetAnalyzer() uint32 { +func (x *ExecuteRequest) GetClientApi() uint32 { if x != nil { - return x.Analyzer + return x.ClientApi } return 0 } @@ -203,8 +203,8 @@ type ExecuteHookPreRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Hook *ExecutedHook `protobuf:"bytes,1,opt,name=hook,proto3" json:"hook,omitempty"` - Analyzer uint32 `protobuf:"varint,2,opt,name=analyzer,proto3" json:"analyzer,omitempty"` + Hook *ExecutedHook `protobuf:"bytes,1,opt,name=hook,proto3" json:"hook,omitempty"` + ClientApi uint32 `protobuf:"varint,2,opt,name=client_api,json=clientApi,proto3" json:"client_api,omitempty"` } func (x *ExecuteHookPreRequest) Reset() { @@ -246,9 +246,9 @@ func (x *ExecuteHookPreRequest) GetHook() *ExecutedHook { return nil } -func (x *ExecuteHookPreRequest) GetAnalyzer() uint32 { +func (x *ExecuteHookPreRequest) GetClientApi() uint32 { if x != nil { - return x.Analyzer + return x.ClientApi } return 0 } @@ -296,8 +296,8 @@ type ExecuteHookPostRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Hook *ExecutedHook `protobuf:"bytes,1,opt,name=hook,proto3" json:"hook,omitempty"` - Analyzer uint32 `protobuf:"varint,2,opt,name=analyzer,proto3" json:"analyzer,omitempty"` + Hook *ExecutedHook `protobuf:"bytes,1,opt,name=hook,proto3" json:"hook,omitempty"` + ClientApi uint32 `protobuf:"varint,2,opt,name=client_api,json=clientApi,proto3" json:"client_api,omitempty"` } func (x *ExecuteHookPostRequest) Reset() { @@ -339,9 +339,9 @@ func (x *ExecuteHookPostRequest) GetHook() *ExecutedHook { return nil } -func (x *ExecuteHookPostRequest) GetAnalyzer() uint32 { +func (x *ExecuteHookPostRequest) GetClientApi() uint32 { if x != nil { - return x.Analyzer + return x.ClientApi } return 0 } @@ -389,8 +389,8 @@ type ExecuteHookCleanUpRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Hook *ExecutedHook `protobuf:"bytes,1,opt,name=hook,proto3" json:"hook,omitempty"` - Analyzer uint32 `protobuf:"varint,2,opt,name=analyzer,proto3" json:"analyzer,omitempty"` + Hook *ExecutedHook `protobuf:"bytes,1,opt,name=hook,proto3" json:"hook,omitempty"` + ClientApi uint32 `protobuf:"varint,2,opt,name=client_api,json=clientApi,proto3" json:"client_api,omitempty"` } func (x *ExecuteHookCleanUpRequest) Reset() { @@ -432,9 +432,9 @@ func (x *ExecuteHookCleanUpRequest) GetHook() *ExecutedHook { return nil } -func (x *ExecuteHookCleanUpRequest) GetAnalyzer() uint32 { +func (x *ExecuteHookCleanUpRequest) GetClientApi() uint32 { if x != nil { - return x.Analyzer + return x.ClientApi } return 0 } @@ -477,14 +477,14 @@ func (*ExecuteHookCleanUpResponse) Descriptor() ([]byte, []int) { return file_ignite_services_plugin_grpc_v1_service_proto_rawDescGZIP(), []int{9} } -type DependenciesRequest struct { +type GetChainInfoRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } -func (x *DependenciesRequest) Reset() { - *x = DependenciesRequest{} +func (x *GetChainInfoRequest) Reset() { + *x = GetChainInfoRequest{} if protoimpl.UnsafeEnabled { mi := &file_ignite_services_plugin_grpc_v1_service_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -492,13 +492,13 @@ func (x *DependenciesRequest) Reset() { } } -func (x *DependenciesRequest) String() string { +func (x *GetChainInfoRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*DependenciesRequest) ProtoMessage() {} +func (*GetChainInfoRequest) ProtoMessage() {} -func (x *DependenciesRequest) ProtoReflect() protoreflect.Message { +func (x *GetChainInfoRequest) ProtoReflect() protoreflect.Message { mi := &file_ignite_services_plugin_grpc_v1_service_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -510,21 +510,21 @@ func (x *DependenciesRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use DependenciesRequest.ProtoReflect.Descriptor instead. -func (*DependenciesRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use GetChainInfoRequest.ProtoReflect.Descriptor instead. +func (*GetChainInfoRequest) Descriptor() ([]byte, []int) { return file_ignite_services_plugin_grpc_v1_service_proto_rawDescGZIP(), []int{10} } -type DependenciesResponse struct { +type GetChainInfoResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Dependencies []*Dependency `protobuf:"bytes,2,rep,name=dependencies,proto3" json:"dependencies,omitempty"` + ChainInfo *ChainInfo `protobuf:"bytes,1,opt,name=chain_info,json=chainInfo,proto3" json:"chain_info,omitempty"` } -func (x *DependenciesResponse) Reset() { - *x = DependenciesResponse{} +func (x *GetChainInfoResponse) Reset() { + *x = GetChainInfoResponse{} if protoimpl.UnsafeEnabled { mi := &file_ignite_services_plugin_grpc_v1_service_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -532,13 +532,13 @@ func (x *DependenciesResponse) Reset() { } } -func (x *DependenciesResponse) String() string { +func (x *GetChainInfoResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*DependenciesResponse) ProtoMessage() {} +func (*GetChainInfoResponse) ProtoMessage() {} -func (x *DependenciesResponse) ProtoReflect() protoreflect.Message { +func (x *GetChainInfoResponse) ProtoReflect() protoreflect.Message { mi := &file_ignite_services_plugin_grpc_v1_service_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -550,14 +550,14 @@ func (x *DependenciesResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use DependenciesResponse.ProtoReflect.Descriptor instead. -func (*DependenciesResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use GetChainInfoResponse.ProtoReflect.Descriptor instead. +func (*GetChainInfoResponse) Descriptor() ([]byte, []int) { return file_ignite_services_plugin_grpc_v1_service_proto_rawDescGZIP(), []int{11} } -func (x *DependenciesResponse) GetDependencies() []*Dependency { +func (x *GetChainInfoResponse) GetChainInfo() *ChainInfo { if x != nil { - return x.Dependencies + return x.ChainInfo } return nil } @@ -569,117 +569,118 @@ var file_ignite_services_plugin_grpc_v1_service_proto_rawDesc = []byte{ 0x73, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, - 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x1a, 0x2d, + 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x1a, 0x2f, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, - 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x61, - 0x6e, 0x61, 0x6c, 0x79, 0x7a, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x69, - 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x70, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x11, 0x0a, - 0x0f, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x22, 0x58, 0x0a, 0x10, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x08, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, - 0x52, 0x08, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x22, 0x6f, 0x0a, 0x0e, 0x45, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x03, - 0x63, 0x6d, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x69, 0x67, 0x6e, 0x69, - 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x03, 0x63, 0x6d, 0x64, 0x12, - 0x1a, 0x0a, 0x08, 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x7a, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x08, 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x7a, 0x65, 0x72, 0x22, 0x11, 0x0a, 0x0f, 0x45, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x75, - 0x0a, 0x15, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x50, 0x72, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, 0x0a, 0x04, 0x68, 0x6f, 0x6f, 0x6b, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x64, 0x48, - 0x6f, 0x6f, 0x6b, 0x52, 0x04, 0x68, 0x6f, 0x6f, 0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x6e, 0x61, - 0x6c, 0x79, 0x7a, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x61, 0x6e, 0x61, - 0x6c, 0x79, 0x7a, 0x65, 0x72, 0x22, 0x18, 0x0a, 0x16, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, - 0x48, 0x6f, 0x6f, 0x6b, 0x50, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x76, 0x0a, 0x16, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x50, 0x6f, - 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, 0x0a, 0x04, 0x68, 0x6f, 0x6f, - 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, - 0x64, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x04, 0x68, 0x6f, 0x6f, 0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x61, - 0x6e, 0x61, 0x6c, 0x79, 0x7a, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x61, - 0x6e, 0x61, 0x6c, 0x79, 0x7a, 0x65, 0x72, 0x22, 0x19, 0x0a, 0x17, 0x45, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x50, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x79, 0x0a, 0x19, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x48, 0x6f, 0x6f, - 0x6b, 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x55, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x40, 0x0a, 0x04, 0x68, 0x6f, 0x6f, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, - 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, - 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x45, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x64, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x04, 0x68, 0x6f, 0x6f, - 0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x7a, 0x65, 0x72, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x08, 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x7a, 0x65, 0x72, 0x22, 0x1c, 0x0a, - 0x1a, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x43, 0x6c, 0x65, 0x61, - 0x6e, 0x55, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0x0a, 0x13, 0x44, - 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x22, 0x66, 0x0a, 0x14, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, - 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x0c, 0x64, 0x65, - 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x2a, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, - 0x31, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x52, 0x0c, 0x64, 0x65, - 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x32, 0x81, 0x05, 0x0a, 0x10, 0x49, - 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, - 0x6d, 0x0a, 0x08, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x12, 0x2f, 0x2e, 0x69, 0x67, + 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x63, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, + 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x2f, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x11, 0x0a, 0x0f, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x22, 0x58, 0x0a, 0x10, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x08, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, + 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, + 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, + 0x73, 0x74, 0x52, 0x08, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x22, 0x72, 0x0a, 0x0e, + 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x41, + 0x0a, 0x03, 0x63, 0x6d, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x6e, - 0x69, 0x66, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x69, - 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, - 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6a, - 0x0a, 0x07, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x12, 0x2e, 0x2e, 0x69, 0x67, 0x6e, 0x69, - 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x69, 0x67, 0x6e, 0x69, - 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7f, 0x0a, 0x0e, 0x45, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x50, 0x72, 0x65, 0x12, 0x35, 0x2e, 0x69, + 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x03, 0x63, 0x6d, + 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x70, 0x69, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x70, 0x69, + 0x22, 0x11, 0x0a, 0x0f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x78, 0x0a, 0x15, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x48, 0x6f, + 0x6f, 0x6b, 0x50, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, 0x0a, 0x04, + 0x68, 0x6f, 0x6f, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x69, 0x67, 0x6e, + 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x65, 0x64, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x04, 0x68, 0x6f, 0x6f, 0x6b, 0x12, 0x1d, + 0x0a, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x70, 0x69, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x70, 0x69, 0x22, 0x18, 0x0a, + 0x16, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x50, 0x72, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x79, 0x0a, 0x16, 0x45, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x50, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x40, 0x0a, 0x04, 0x68, 0x6f, 0x6f, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2c, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, + 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x64, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x04, 0x68, + 0x6f, 0x6f, 0x6b, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x70, + 0x69, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, + 0x70, 0x69, 0x22, 0x19, 0x0a, 0x17, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x48, 0x6f, 0x6f, + 0x6b, 0x50, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x7c, 0x0a, + 0x19, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x43, 0x6c, 0x65, 0x61, + 0x6e, 0x55, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, 0x0a, 0x04, 0x68, 0x6f, + 0x6f, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, + 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x65, 0x64, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x04, 0x68, 0x6f, 0x6f, 0x6b, 0x12, 0x1d, 0x0a, 0x0a, + 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x70, 0x69, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x70, 0x69, 0x22, 0x1c, 0x0a, 0x1a, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x55, + 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0x0a, 0x13, 0x47, 0x65, 0x74, + 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x22, 0x60, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x69, + 0x6e, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x50, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, + 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x6e, + 0x66, 0x6f, 0x32, 0x81, 0x05, 0x0a, 0x10, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6d, 0x0a, 0x08, 0x4d, 0x61, 0x6e, 0x69, 0x66, + 0x65, 0x73, 0x74, 0x12, 0x2f, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, - 0x50, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x82, 0x01, 0x0a, 0x0f, - 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x50, 0x6f, 0x73, 0x74, 0x12, - 0x36, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, - 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x50, 0x6f, 0x73, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, - 0x48, 0x6f, 0x6f, 0x6b, 0x50, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x8b, 0x01, 0x0a, 0x12, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, - 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x55, 0x70, 0x12, 0x39, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, + 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6a, 0x0a, 0x07, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x65, 0x12, 0x2e, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x2f, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x7f, 0x0a, 0x0e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x48, 0x6f, 0x6f, + 0x6b, 0x50, 0x72, 0x65, 0x12, 0x35, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x48, 0x6f, 0x6f, + 0x6b, 0x50, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x69, 0x67, + 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x50, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x82, 0x01, 0x0a, 0x0f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x48, + 0x6f, 0x6f, 0x6b, 0x50, 0x6f, 0x73, 0x74, 0x12, 0x36, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, - 0x48, 0x6f, 0x6f, 0x6b, 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x55, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x3a, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x43, - 0x6c, 0x65, 0x61, 0x6e, 0x55, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x8c, - 0x01, 0x0a, 0x0f, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x7a, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x12, 0x79, 0x0a, 0x0c, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, - 0x65, 0x73, 0x12, 0x33, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, - 0x6e, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x36, 0x5a, - 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x67, 0x6e, 0x69, - 0x74, 0x65, 0x2f, 0x63, 0x6c, 0x69, 0x2f, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2f, 0x67, 0x72, - 0x70, 0x63, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x48, 0x6f, 0x6f, 0x6b, 0x50, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x37, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, + 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x50, 0x6f, 0x73, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x8b, 0x01, 0x0a, 0x12, 0x45, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x55, 0x70, 0x12, + 0x39, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, + 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x43, 0x6c, 0x65, 0x61, + 0x6e, 0x55, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3a, 0x2e, 0x69, 0x67, 0x6e, + 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x55, 0x70, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x8d, 0x01, 0x0a, 0x10, 0x43, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x41, 0x50, 0x49, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x79, 0x0a, 0x0c, 0x47, + 0x65, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x33, 0x2e, 0x69, 0x67, + 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, + 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x34, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, + 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x63, 0x6c, 0x69, 0x2f, + 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, + 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -706,12 +707,12 @@ var file_ignite_services_plugin_grpc_v1_service_proto_goTypes = []interface{}{ (*ExecuteHookPostResponse)(nil), // 7: ignite.services.plugin.grpc.v1.ExecuteHookPostResponse (*ExecuteHookCleanUpRequest)(nil), // 8: ignite.services.plugin.grpc.v1.ExecuteHookCleanUpRequest (*ExecuteHookCleanUpResponse)(nil), // 9: ignite.services.plugin.grpc.v1.ExecuteHookCleanUpResponse - (*DependenciesRequest)(nil), // 10: ignite.services.plugin.grpc.v1.DependenciesRequest - (*DependenciesResponse)(nil), // 11: ignite.services.plugin.grpc.v1.DependenciesResponse + (*GetChainInfoRequest)(nil), // 10: ignite.services.plugin.grpc.v1.GetChainInfoRequest + (*GetChainInfoResponse)(nil), // 11: ignite.services.plugin.grpc.v1.GetChainInfoResponse (*Manifest)(nil), // 12: ignite.services.plugin.grpc.v1.Manifest (*ExecutedCommand)(nil), // 13: ignite.services.plugin.grpc.v1.ExecutedCommand (*ExecutedHook)(nil), // 14: ignite.services.plugin.grpc.v1.ExecutedHook - (*Dependency)(nil), // 15: ignite.services.plugin.grpc.v1.Dependency + (*ChainInfo)(nil), // 15: ignite.services.plugin.grpc.v1.ChainInfo } var file_ignite_services_plugin_grpc_v1_service_proto_depIdxs = []int32{ 12, // 0: ignite.services.plugin.grpc.v1.ManifestResponse.manifest:type_name -> ignite.services.plugin.grpc.v1.Manifest @@ -719,19 +720,19 @@ var file_ignite_services_plugin_grpc_v1_service_proto_depIdxs = []int32{ 14, // 2: ignite.services.plugin.grpc.v1.ExecuteHookPreRequest.hook:type_name -> ignite.services.plugin.grpc.v1.ExecutedHook 14, // 3: ignite.services.plugin.grpc.v1.ExecuteHookPostRequest.hook:type_name -> ignite.services.plugin.grpc.v1.ExecutedHook 14, // 4: ignite.services.plugin.grpc.v1.ExecuteHookCleanUpRequest.hook:type_name -> ignite.services.plugin.grpc.v1.ExecutedHook - 15, // 5: ignite.services.plugin.grpc.v1.DependenciesResponse.dependencies:type_name -> ignite.services.plugin.grpc.v1.Dependency + 15, // 5: ignite.services.plugin.grpc.v1.GetChainInfoResponse.chain_info:type_name -> ignite.services.plugin.grpc.v1.ChainInfo 0, // 6: ignite.services.plugin.grpc.v1.InterfaceService.Manifest:input_type -> ignite.services.plugin.grpc.v1.ManifestRequest 2, // 7: ignite.services.plugin.grpc.v1.InterfaceService.Execute:input_type -> ignite.services.plugin.grpc.v1.ExecuteRequest 4, // 8: ignite.services.plugin.grpc.v1.InterfaceService.ExecuteHookPre:input_type -> ignite.services.plugin.grpc.v1.ExecuteHookPreRequest 6, // 9: ignite.services.plugin.grpc.v1.InterfaceService.ExecuteHookPost:input_type -> ignite.services.plugin.grpc.v1.ExecuteHookPostRequest 8, // 10: ignite.services.plugin.grpc.v1.InterfaceService.ExecuteHookCleanUp:input_type -> ignite.services.plugin.grpc.v1.ExecuteHookCleanUpRequest - 10, // 11: ignite.services.plugin.grpc.v1.AnalyzerService.Dependencies:input_type -> ignite.services.plugin.grpc.v1.DependenciesRequest + 10, // 11: ignite.services.plugin.grpc.v1.ClientAPIService.GetChainInfo:input_type -> ignite.services.plugin.grpc.v1.GetChainInfoRequest 1, // 12: ignite.services.plugin.grpc.v1.InterfaceService.Manifest:output_type -> ignite.services.plugin.grpc.v1.ManifestResponse 3, // 13: ignite.services.plugin.grpc.v1.InterfaceService.Execute:output_type -> ignite.services.plugin.grpc.v1.ExecuteResponse 5, // 14: ignite.services.plugin.grpc.v1.InterfaceService.ExecuteHookPre:output_type -> ignite.services.plugin.grpc.v1.ExecuteHookPreResponse 7, // 15: ignite.services.plugin.grpc.v1.InterfaceService.ExecuteHookPost:output_type -> ignite.services.plugin.grpc.v1.ExecuteHookPostResponse 9, // 16: ignite.services.plugin.grpc.v1.InterfaceService.ExecuteHookCleanUp:output_type -> ignite.services.plugin.grpc.v1.ExecuteHookCleanUpResponse - 11, // 17: ignite.services.plugin.grpc.v1.AnalyzerService.Dependencies:output_type -> ignite.services.plugin.grpc.v1.DependenciesResponse + 11, // 17: ignite.services.plugin.grpc.v1.ClientAPIService.GetChainInfo:output_type -> ignite.services.plugin.grpc.v1.GetChainInfoResponse 12, // [12:18] is the sub-list for method output_type 6, // [6:12] is the sub-list for method input_type 6, // [6:6] is the sub-list for extension type_name @@ -744,7 +745,7 @@ func file_ignite_services_plugin_grpc_v1_service_proto_init() { if File_ignite_services_plugin_grpc_v1_service_proto != nil { return } - file_ignite_services_plugin_grpc_v1_analyzer_proto_init() + file_ignite_services_plugin_grpc_v1_client_api_proto_init() file_ignite_services_plugin_grpc_v1_interface_proto_init() if !protoimpl.UnsafeEnabled { file_ignite_services_plugin_grpc_v1_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { @@ -868,7 +869,7 @@ func file_ignite_services_plugin_grpc_v1_service_proto_init() { } } file_ignite_services_plugin_grpc_v1_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DependenciesRequest); i { + switch v := v.(*GetChainInfoRequest); i { case 0: return &v.state case 1: @@ -880,7 +881,7 @@ func file_ignite_services_plugin_grpc_v1_service_proto_init() { } } file_ignite_services_plugin_grpc_v1_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DependenciesResponse); i { + switch v := v.(*GetChainInfoResponse); i { case 0: return &v.state case 1: diff --git a/ignite/services/plugin/grpc/v1/service_grpc.pb.go b/ignite/services/plugin/grpc/v1/service_grpc.pb.go index 09776a0ca7..f369c94a1e 100644 --- a/ignite/services/plugin/grpc/v1/service_grpc.pb.go +++ b/ignite/services/plugin/grpc/v1/service_grpc.pb.go @@ -291,91 +291,91 @@ var InterfaceService_ServiceDesc = grpc.ServiceDesc{ } const ( - AnalyzerService_Dependencies_FullMethodName = "/ignite.services.plugin.grpc.v1.AnalyzerService/Dependencies" + ClientAPIService_GetChainInfo_FullMethodName = "/ignite.services.plugin.grpc.v1.ClientAPIService/GetChainInfo" ) -// AnalyzerServiceClient is the client API for AnalyzerService service. +// ClientAPIServiceClient is the client API for ClientAPIService 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 AnalyzerServiceClient interface { - // Dependencies returns the app dependencies. - Dependencies(ctx context.Context, in *DependenciesRequest, opts ...grpc.CallOption) (*DependenciesResponse, error) +type ClientAPIServiceClient interface { + // GetChainInfo returns basic chain info for the configured app + GetChainInfo(ctx context.Context, in *GetChainInfoRequest, opts ...grpc.CallOption) (*GetChainInfoResponse, error) } -type analyzerServiceClient struct { +type clientAPIServiceClient struct { cc grpc.ClientConnInterface } -func NewAnalyzerServiceClient(cc grpc.ClientConnInterface) AnalyzerServiceClient { - return &analyzerServiceClient{cc} +func NewClientAPIServiceClient(cc grpc.ClientConnInterface) ClientAPIServiceClient { + return &clientAPIServiceClient{cc} } -func (c *analyzerServiceClient) Dependencies(ctx context.Context, in *DependenciesRequest, opts ...grpc.CallOption) (*DependenciesResponse, error) { - out := new(DependenciesResponse) - err := c.cc.Invoke(ctx, AnalyzerService_Dependencies_FullMethodName, in, out, opts...) +func (c *clientAPIServiceClient) GetChainInfo(ctx context.Context, in *GetChainInfoRequest, opts ...grpc.CallOption) (*GetChainInfoResponse, error) { + out := new(GetChainInfoResponse) + err := c.cc.Invoke(ctx, ClientAPIService_GetChainInfo_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -// AnalyzerServiceServer is the server API for AnalyzerService service. -// All implementations must embed UnimplementedAnalyzerServiceServer +// ClientAPIServiceServer is the server API for ClientAPIService service. +// All implementations must embed UnimplementedClientAPIServiceServer // for forward compatibility -type AnalyzerServiceServer interface { - // Dependencies returns the app dependencies. - Dependencies(context.Context, *DependenciesRequest) (*DependenciesResponse, error) - mustEmbedUnimplementedAnalyzerServiceServer() +type ClientAPIServiceServer interface { + // GetChainInfo returns basic chain info for the configured app + GetChainInfo(context.Context, *GetChainInfoRequest) (*GetChainInfoResponse, error) + mustEmbedUnimplementedClientAPIServiceServer() } -// UnimplementedAnalyzerServiceServer must be embedded to have forward compatible implementations. -type UnimplementedAnalyzerServiceServer struct { +// UnimplementedClientAPIServiceServer must be embedded to have forward compatible implementations. +type UnimplementedClientAPIServiceServer struct { } -func (UnimplementedAnalyzerServiceServer) Dependencies(context.Context, *DependenciesRequest) (*DependenciesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Dependencies not implemented") +func (UnimplementedClientAPIServiceServer) GetChainInfo(context.Context, *GetChainInfoRequest) (*GetChainInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetChainInfo not implemented") } -func (UnimplementedAnalyzerServiceServer) mustEmbedUnimplementedAnalyzerServiceServer() {} +func (UnimplementedClientAPIServiceServer) mustEmbedUnimplementedClientAPIServiceServer() {} -// UnsafeAnalyzerServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to AnalyzerServiceServer will +// UnsafeClientAPIServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ClientAPIServiceServer will // result in compilation errors. -type UnsafeAnalyzerServiceServer interface { - mustEmbedUnimplementedAnalyzerServiceServer() +type UnsafeClientAPIServiceServer interface { + mustEmbedUnimplementedClientAPIServiceServer() } -func RegisterAnalyzerServiceServer(s grpc.ServiceRegistrar, srv AnalyzerServiceServer) { - s.RegisterService(&AnalyzerService_ServiceDesc, srv) +func RegisterClientAPIServiceServer(s grpc.ServiceRegistrar, srv ClientAPIServiceServer) { + s.RegisterService(&ClientAPIService_ServiceDesc, srv) } -func _AnalyzerService_Dependencies_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DependenciesRequest) +func _ClientAPIService_GetChainInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetChainInfoRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(AnalyzerServiceServer).Dependencies(ctx, in) + return srv.(ClientAPIServiceServer).GetChainInfo(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: AnalyzerService_Dependencies_FullMethodName, + FullMethod: ClientAPIService_GetChainInfo_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AnalyzerServiceServer).Dependencies(ctx, req.(*DependenciesRequest)) + return srv.(ClientAPIServiceServer).GetChainInfo(ctx, req.(*GetChainInfoRequest)) } return interceptor(ctx, in, info, handler) } -// AnalyzerService_ServiceDesc is the grpc.ServiceDesc for AnalyzerService service. +// ClientAPIService_ServiceDesc is the grpc.ServiceDesc for ClientAPIService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) -var AnalyzerService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "ignite.services.plugin.grpc.v1.AnalyzerService", - HandlerType: (*AnalyzerServiceServer)(nil), +var ClientAPIService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "ignite.services.plugin.grpc.v1.ClientAPIService", + HandlerType: (*ClientAPIServiceServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "Dependencies", - Handler: _AnalyzerService_Dependencies_Handler, + MethodName: "GetChainInfo", + Handler: _ClientAPIService_GetChainInfo_Handler, }, }, Streams: []grpc.StreamDesc{}, diff --git a/ignite/services/plugin/interface.go b/ignite/services/plugin/interface.go index e866589b93..c5a3d848d1 100644 --- a/ignite/services/plugin/interface.go +++ b/ignite/services/plugin/interface.go @@ -20,7 +20,7 @@ const ( // Type aliases for the current plugin version. type ( Command = v1.Command - Dependency = v1.Dependency + ChainInfo = v1.ChainInfo ExecutedCommand = v1.ExecutedCommand ExecutedHook = v1.ExecutedHook Flag = v1.Flag @@ -39,36 +39,36 @@ type Interface interface { // Execute will be invoked by ignite when a plugin Command is executed. // It is global for all commands declared in Manifest, if you have declared // multiple commands, use cmd.Path to distinguish them. - // The analyzer argument can be used by plugins to get chain app analysis info. - Execute(context.Context, *ExecutedCommand, Analyzer) error + // The clientAPI argument can be used by plugins to get chain app analysis info. + Execute(context.Context, *ExecutedCommand, ClientAPI) error // ExecuteHookPre is invoked by ignite when a command specified by the Hook // path is invoked. // It is global for all hooks declared in Manifest, if you have declared // multiple hooks, use hook.Name to distinguish them. - // The analyzer argument can be used by plugins to get chain app analysis info. - ExecuteHookPre(context.Context, *ExecutedHook, Analyzer) error + // The clientAPI argument can be used by plugins to get chain app analysis info. + ExecuteHookPre(context.Context, *ExecutedHook, ClientAPI) error // ExecuteHookPost is invoked by ignite when a command specified by the hook // path is invoked. // It is global for all hooks declared in Manifest, if you have declared // multiple hooks, use hook.Name to distinguish them. - // The analyzer argument can be used by plugins to get chain app analysis info. - ExecuteHookPost(context.Context, *ExecutedHook, Analyzer) error + // The clientAPI argument can be used by plugins to get chain app analysis info. + ExecuteHookPost(context.Context, *ExecutedHook, ClientAPI) error // ExecuteHookCleanUp is invoked by ignite when a command specified by the // hook path is invoked. Unlike ExecuteHookPost, it is invoked regardless of // execution status of the command and hooks. // It is global for all hooks declared in Manifest, if you have declared // multiple hooks, use hook.Name to distinguish them. - // The analyzer argument can be used by plugins to get chain app analysis info. - ExecuteHookCleanUp(context.Context, *ExecutedHook, Analyzer) error + // The clientAPI argument can be used by plugins to get chain app analysis info. + ExecuteHookCleanUp(context.Context, *ExecutedHook, ClientAPI) error } -// Analyzer defines the interface for plugins to get chain app code analysis info. +// ClientAPI defines the interface for plugins to get chain app code analysis info. // -//go:generate mockery --srcpkg . --name Analyzer --structname PluginAnalyzer --filename analyzer.go --with-expecter -type Analyzer interface { +//go:generate mockery --srcpkg . --name ClientAPI --structname PluginClientAPI --filename client_api.go --with-expecter +type ClientAPI interface { // Dependencies returns the app dependencies. - Dependencies(context.Context) ([]*Dependency, error) + GetChainInfo(context.Context) (*ChainInfo, error) } diff --git a/ignite/services/plugin/mocks/analyzer.go b/ignite/services/plugin/mocks/analyzer.go deleted file mode 100644 index 97548d9fab..0000000000 --- a/ignite/services/plugin/mocks/analyzer.go +++ /dev/null @@ -1,85 +0,0 @@ -// Code generated by mockery v2.16.0. DO NOT EDIT. - -package mocks - -import ( - context "context" - - mock "github.com/stretchr/testify/mock" - - v1 "github.com/ignite/cli/ignite/services/plugin/grpc/v1" -) - -// PluginAnalyzer is an autogenerated mock type for the Analyzer type -type PluginAnalyzer struct { - mock.Mock -} - -type PluginAnalyzer_Expecter struct { - mock *mock.Mock -} - -func (_m *PluginAnalyzer) EXPECT() *PluginAnalyzer_Expecter { - return &PluginAnalyzer_Expecter{mock: &_m.Mock} -} - -// Dependencies provides a mock function with given fields: _a0 -func (_m *PluginAnalyzer) Dependencies(_a0 context.Context) ([]*v1.Dependency, error) { - ret := _m.Called(_a0) - - var r0 []*v1.Dependency - if rf, ok := ret.Get(0).(func(context.Context) []*v1.Dependency); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*v1.Dependency) - } - } - - var r1 error - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// PluginAnalyzer_Dependencies_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Dependencies' -type PluginAnalyzer_Dependencies_Call struct { - *mock.Call -} - -// Dependencies is a helper method to define mock.On call -// - _a0 context.Context -func (_e *PluginAnalyzer_Expecter) Dependencies(_a0 interface{}) *PluginAnalyzer_Dependencies_Call { - return &PluginAnalyzer_Dependencies_Call{Call: _e.mock.On("Dependencies", _a0)} -} - -func (_c *PluginAnalyzer_Dependencies_Call) Run(run func(_a0 context.Context)) *PluginAnalyzer_Dependencies_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *PluginAnalyzer_Dependencies_Call) Return(_a0 []*v1.Dependency, _a1 error) *PluginAnalyzer_Dependencies_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -type mockConstructorTestingTNewPluginAnalyzer interface { - mock.TestingT - Cleanup(func()) -} - -// NewPluginAnalyzer creates a new instance of PluginAnalyzer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewPluginAnalyzer(t mockConstructorTestingTNewPluginAnalyzer) *PluginAnalyzer { - mock := &PluginAnalyzer{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/ignite/services/plugin/mocks/client_api.go b/ignite/services/plugin/mocks/client_api.go new file mode 100644 index 0000000000..c9bffda3e3 --- /dev/null +++ b/ignite/services/plugin/mocks/client_api.go @@ -0,0 +1,93 @@ +// Code generated by mockery v2.27.1. DO NOT EDIT. + +package mocks + +import ( + context "context" + + mock "github.com/stretchr/testify/mock" + + v1 "github.com/ignite/cli/ignite/services/plugin/grpc/v1" +) + +// PluginClientAPI is an autogenerated mock type for the ClientAPI type +type PluginClientAPI struct { + mock.Mock +} + +type PluginClientAPI_Expecter struct { + mock *mock.Mock +} + +func (_m *PluginClientAPI) EXPECT() *PluginClientAPI_Expecter { + return &PluginClientAPI_Expecter{mock: &_m.Mock} +} + +// GetChainInfo provides a mock function with given fields: _a0 +func (_m *PluginClientAPI) GetChainInfo(_a0 context.Context) (*v1.ChainInfo, error) { + ret := _m.Called(_a0) + + var r0 *v1.ChainInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*v1.ChainInfo, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(context.Context) *v1.ChainInfo); ok { + r0 = rf(_a0) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v1.ChainInfo) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// PluginClientAPI_GetChainInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetChainInfo' +type PluginClientAPI_GetChainInfo_Call struct { + *mock.Call +} + +// GetChainInfo is a helper method to define mock.On call +// - _a0 context.Context +func (_e *PluginClientAPI_Expecter) GetChainInfo(_a0 interface{}) *PluginClientAPI_GetChainInfo_Call { + return &PluginClientAPI_GetChainInfo_Call{Call: _e.mock.On("GetChainInfo", _a0)} +} + +func (_c *PluginClientAPI_GetChainInfo_Call) Run(run func(_a0 context.Context)) *PluginClientAPI_GetChainInfo_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *PluginClientAPI_GetChainInfo_Call) Return(_a0 *v1.ChainInfo, _a1 error) *PluginClientAPI_GetChainInfo_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *PluginClientAPI_GetChainInfo_Call) RunAndReturn(run func(context.Context) (*v1.ChainInfo, error)) *PluginClientAPI_GetChainInfo_Call { + _c.Call.Return(run) + return _c +} + +type mockConstructorTestingTNewPluginClientAPI interface { + mock.TestingT + Cleanup(func()) +} + +// NewPluginClientAPI creates a new instance of PluginClientAPI. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewPluginClientAPI(t mockConstructorTestingTNewPluginClientAPI) *PluginClientAPI { + mock := &PluginClientAPI{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/ignite/services/plugin/mocks/interface.go b/ignite/services/plugin/mocks/interface.go index b0a39e5df3..e03d029aa8 100644 --- a/ignite/services/plugin/mocks/interface.go +++ b/ignite/services/plugin/mocks/interface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.16.0. DO NOT EDIT. +// Code generated by mockery v2.27.1. DO NOT EDIT. package mocks @@ -25,11 +25,11 @@ func (_m *PluginInterface) EXPECT() *PluginInterface_Expecter { } // Execute provides a mock function with given fields: _a0, _a1, _a2 -func (_m *PluginInterface) Execute(_a0 context.Context, _a1 *v1.ExecutedCommand, _a2 plugin.Analyzer) error { +func (_m *PluginInterface) Execute(_a0 context.Context, _a1 *v1.ExecutedCommand, _a2 plugin.ClientAPI) error { ret := _m.Called(_a0, _a1, _a2) var r0 error - if rf, ok := ret.Get(0).(func(context.Context, *v1.ExecutedCommand, plugin.Analyzer) error); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1.ExecutedCommand, plugin.ClientAPI) error); ok { r0 = rf(_a0, _a1, _a2) } else { r0 = ret.Error(0) @@ -46,14 +46,14 @@ type PluginInterface_Execute_Call struct { // Execute is a helper method to define mock.On call // - _a0 context.Context // - _a1 *v1.ExecutedCommand -// - _a2 plugin.Analyzer +// - _a2 plugin.ClientAPI func (_e *PluginInterface_Expecter) Execute(_a0 interface{}, _a1 interface{}, _a2 interface{}) *PluginInterface_Execute_Call { return &PluginInterface_Execute_Call{Call: _e.mock.On("Execute", _a0, _a1, _a2)} } -func (_c *PluginInterface_Execute_Call) Run(run func(_a0 context.Context, _a1 *v1.ExecutedCommand, _a2 plugin.Analyzer)) *PluginInterface_Execute_Call { +func (_c *PluginInterface_Execute_Call) Run(run func(_a0 context.Context, _a1 *v1.ExecutedCommand, _a2 plugin.ClientAPI)) *PluginInterface_Execute_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*v1.ExecutedCommand), args[2].(plugin.Analyzer)) + run(args[0].(context.Context), args[1].(*v1.ExecutedCommand), args[2].(plugin.ClientAPI)) }) return _c } @@ -63,12 +63,17 @@ func (_c *PluginInterface_Execute_Call) Return(_a0 error) *PluginInterface_Execu return _c } +func (_c *PluginInterface_Execute_Call) RunAndReturn(run func(context.Context, *v1.ExecutedCommand, plugin.ClientAPI) error) *PluginInterface_Execute_Call { + _c.Call.Return(run) + return _c +} + // ExecuteHookCleanUp provides a mock function with given fields: _a0, _a1, _a2 -func (_m *PluginInterface) ExecuteHookCleanUp(_a0 context.Context, _a1 *v1.ExecutedHook, _a2 plugin.Analyzer) error { +func (_m *PluginInterface) ExecuteHookCleanUp(_a0 context.Context, _a1 *v1.ExecutedHook, _a2 plugin.ClientAPI) error { ret := _m.Called(_a0, _a1, _a2) var r0 error - if rf, ok := ret.Get(0).(func(context.Context, *v1.ExecutedHook, plugin.Analyzer) error); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1.ExecutedHook, plugin.ClientAPI) error); ok { r0 = rf(_a0, _a1, _a2) } else { r0 = ret.Error(0) @@ -85,14 +90,14 @@ type PluginInterface_ExecuteHookCleanUp_Call struct { // ExecuteHookCleanUp is a helper method to define mock.On call // - _a0 context.Context // - _a1 *v1.ExecutedHook -// - _a2 plugin.Analyzer +// - _a2 plugin.ClientAPI func (_e *PluginInterface_Expecter) ExecuteHookCleanUp(_a0 interface{}, _a1 interface{}, _a2 interface{}) *PluginInterface_ExecuteHookCleanUp_Call { return &PluginInterface_ExecuteHookCleanUp_Call{Call: _e.mock.On("ExecuteHookCleanUp", _a0, _a1, _a2)} } -func (_c *PluginInterface_ExecuteHookCleanUp_Call) Run(run func(_a0 context.Context, _a1 *v1.ExecutedHook, _a2 plugin.Analyzer)) *PluginInterface_ExecuteHookCleanUp_Call { +func (_c *PluginInterface_ExecuteHookCleanUp_Call) Run(run func(_a0 context.Context, _a1 *v1.ExecutedHook, _a2 plugin.ClientAPI)) *PluginInterface_ExecuteHookCleanUp_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*v1.ExecutedHook), args[2].(plugin.Analyzer)) + run(args[0].(context.Context), args[1].(*v1.ExecutedHook), args[2].(plugin.ClientAPI)) }) return _c } @@ -102,12 +107,17 @@ func (_c *PluginInterface_ExecuteHookCleanUp_Call) Return(_a0 error) *PluginInte return _c } +func (_c *PluginInterface_ExecuteHookCleanUp_Call) RunAndReturn(run func(context.Context, *v1.ExecutedHook, plugin.ClientAPI) error) *PluginInterface_ExecuteHookCleanUp_Call { + _c.Call.Return(run) + return _c +} + // ExecuteHookPost provides a mock function with given fields: _a0, _a1, _a2 -func (_m *PluginInterface) ExecuteHookPost(_a0 context.Context, _a1 *v1.ExecutedHook, _a2 plugin.Analyzer) error { +func (_m *PluginInterface) ExecuteHookPost(_a0 context.Context, _a1 *v1.ExecutedHook, _a2 plugin.ClientAPI) error { ret := _m.Called(_a0, _a1, _a2) var r0 error - if rf, ok := ret.Get(0).(func(context.Context, *v1.ExecutedHook, plugin.Analyzer) error); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1.ExecutedHook, plugin.ClientAPI) error); ok { r0 = rf(_a0, _a1, _a2) } else { r0 = ret.Error(0) @@ -124,14 +134,14 @@ type PluginInterface_ExecuteHookPost_Call struct { // ExecuteHookPost is a helper method to define mock.On call // - _a0 context.Context // - _a1 *v1.ExecutedHook -// - _a2 plugin.Analyzer +// - _a2 plugin.ClientAPI func (_e *PluginInterface_Expecter) ExecuteHookPost(_a0 interface{}, _a1 interface{}, _a2 interface{}) *PluginInterface_ExecuteHookPost_Call { return &PluginInterface_ExecuteHookPost_Call{Call: _e.mock.On("ExecuteHookPost", _a0, _a1, _a2)} } -func (_c *PluginInterface_ExecuteHookPost_Call) Run(run func(_a0 context.Context, _a1 *v1.ExecutedHook, _a2 plugin.Analyzer)) *PluginInterface_ExecuteHookPost_Call { +func (_c *PluginInterface_ExecuteHookPost_Call) Run(run func(_a0 context.Context, _a1 *v1.ExecutedHook, _a2 plugin.ClientAPI)) *PluginInterface_ExecuteHookPost_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*v1.ExecutedHook), args[2].(plugin.Analyzer)) + run(args[0].(context.Context), args[1].(*v1.ExecutedHook), args[2].(plugin.ClientAPI)) }) return _c } @@ -141,12 +151,17 @@ func (_c *PluginInterface_ExecuteHookPost_Call) Return(_a0 error) *PluginInterfa return _c } +func (_c *PluginInterface_ExecuteHookPost_Call) RunAndReturn(run func(context.Context, *v1.ExecutedHook, plugin.ClientAPI) error) *PluginInterface_ExecuteHookPost_Call { + _c.Call.Return(run) + return _c +} + // ExecuteHookPre provides a mock function with given fields: _a0, _a1, _a2 -func (_m *PluginInterface) ExecuteHookPre(_a0 context.Context, _a1 *v1.ExecutedHook, _a2 plugin.Analyzer) error { +func (_m *PluginInterface) ExecuteHookPre(_a0 context.Context, _a1 *v1.ExecutedHook, _a2 plugin.ClientAPI) error { ret := _m.Called(_a0, _a1, _a2) var r0 error - if rf, ok := ret.Get(0).(func(context.Context, *v1.ExecutedHook, plugin.Analyzer) error); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1.ExecutedHook, plugin.ClientAPI) error); ok { r0 = rf(_a0, _a1, _a2) } else { r0 = ret.Error(0) @@ -163,14 +178,14 @@ type PluginInterface_ExecuteHookPre_Call struct { // ExecuteHookPre is a helper method to define mock.On call // - _a0 context.Context // - _a1 *v1.ExecutedHook -// - _a2 plugin.Analyzer +// - _a2 plugin.ClientAPI func (_e *PluginInterface_Expecter) ExecuteHookPre(_a0 interface{}, _a1 interface{}, _a2 interface{}) *PluginInterface_ExecuteHookPre_Call { return &PluginInterface_ExecuteHookPre_Call{Call: _e.mock.On("ExecuteHookPre", _a0, _a1, _a2)} } -func (_c *PluginInterface_ExecuteHookPre_Call) Run(run func(_a0 context.Context, _a1 *v1.ExecutedHook, _a2 plugin.Analyzer)) *PluginInterface_ExecuteHookPre_Call { +func (_c *PluginInterface_ExecuteHookPre_Call) Run(run func(_a0 context.Context, _a1 *v1.ExecutedHook, _a2 plugin.ClientAPI)) *PluginInterface_ExecuteHookPre_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*v1.ExecutedHook), args[2].(plugin.Analyzer)) + run(args[0].(context.Context), args[1].(*v1.ExecutedHook), args[2].(plugin.ClientAPI)) }) return _c } @@ -180,11 +195,20 @@ func (_c *PluginInterface_ExecuteHookPre_Call) Return(_a0 error) *PluginInterfac return _c } +func (_c *PluginInterface_ExecuteHookPre_Call) RunAndReturn(run func(context.Context, *v1.ExecutedHook, plugin.ClientAPI) error) *PluginInterface_ExecuteHookPre_Call { + _c.Call.Return(run) + return _c +} + // Manifest provides a mock function with given fields: _a0 func (_m *PluginInterface) Manifest(_a0 context.Context) (*v1.Manifest, error) { ret := _m.Called(_a0) var r0 *v1.Manifest + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*v1.Manifest, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *v1.Manifest); ok { r0 = rf(_a0) } else { @@ -193,7 +217,6 @@ func (_m *PluginInterface) Manifest(_a0 context.Context) (*v1.Manifest, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -226,6 +249,11 @@ func (_c *PluginInterface_Manifest_Call) Return(_a0 *v1.Manifest, _a1 error) *Pl return _c } +func (_c *PluginInterface_Manifest_Call) RunAndReturn(run func(context.Context) (*v1.Manifest, error)) *PluginInterface_Manifest_Call { + _c.Call.Return(run) + return _c +} + type mockConstructorTestingTNewPluginInterface interface { mock.TestingT Cleanup(func()) diff --git a/ignite/services/plugin/plugin_test.go b/ignite/services/plugin/plugin_test.go index e37d8b6912..ed11d037e8 100644 --- a/ignite/services/plugin/plugin_test.go +++ b/ignite/services/plugin/plugin_test.go @@ -186,13 +186,17 @@ func makeGitRepo(t *testing.T, name string) (string, *git.Repository) { return repoDir, repo } +type TestClientAPI struct{ ClientAPI } + +func (TestClientAPI) GetChainInfo(context.Context) (*ChainInfo, error) { + return &ChainInfo{}, nil +} + func TestPluginLoad(t *testing.T) { wd, err := os.Getwd() require.NoError(t, err) - analyzer := &struct { - Analyzer - }{} + clientAPI := &TestClientAPI{} tests := []struct { name string @@ -359,10 +363,10 @@ func TestPluginLoad(t *testing.T) { manifest, err := p.Interface.Manifest(ctx) require.NoError(err) assert.Equal(p.binaryName, manifest.Name) - assert.NoError(p.Interface.Execute(ctx, &ExecutedCommand{}, analyzer)) - assert.NoError(p.Interface.ExecuteHookPre(ctx, &ExecutedHook{}, analyzer)) - assert.NoError(p.Interface.ExecuteHookPost(ctx, &ExecutedHook{}, analyzer)) - assert.NoError(p.Interface.ExecuteHookCleanUp(ctx, &ExecutedHook{}, analyzer)) + assert.NoError(p.Interface.Execute(ctx, &ExecutedCommand{}, clientAPI)) + assert.NoError(p.Interface.ExecuteHookPre(ctx, &ExecutedHook{}, clientAPI)) + assert.NoError(p.Interface.ExecuteHookPost(ctx, &ExecutedHook{}, clientAPI)) + assert.NoError(p.Interface.ExecuteHookCleanUp(ctx, &ExecutedHook{}, clientAPI)) }) } } diff --git a/ignite/services/plugin/protocol.go b/ignite/services/plugin/protocol.go index ef3bccda5a..ac3d638f3d 100644 --- a/ignite/services/plugin/protocol.go +++ b/ignite/services/plugin/protocol.go @@ -65,47 +65,47 @@ func (c client) Manifest(ctx context.Context) (*Manifest, error) { return r.Manifest, nil } -func (c client) Execute(ctx context.Context, cmd *ExecutedCommand, a Analyzer) error { - brokerID, stopServer := c.startAnalyzerServer(a) +func (c client) Execute(ctx context.Context, cmd *ExecutedCommand, api ClientAPI) error { + brokerID, stopServer := c.startClientAPIServer(api) _, err := c.grpc.Execute(ctx, &v1.ExecuteRequest{ - Cmd: cmd, - Analyzer: brokerID, + Cmd: cmd, + ClientApi: brokerID, }) stopServer() return err } -func (c client) ExecuteHookPre(ctx context.Context, h *ExecutedHook, a Analyzer) error { - brokerID, stopServer := c.startAnalyzerServer(a) +func (c client) ExecuteHookPre(ctx context.Context, h *ExecutedHook, api ClientAPI) error { + brokerID, stopServer := c.startClientAPIServer(api) _, err := c.grpc.ExecuteHookPre(ctx, &v1.ExecuteHookPreRequest{ - Hook: h, - Analyzer: brokerID, + Hook: h, + ClientApi: brokerID, }) stopServer() return err } -func (c client) ExecuteHookPost(ctx context.Context, h *ExecutedHook, a Analyzer) error { - brokerID, stopServer := c.startAnalyzerServer(a) +func (c client) ExecuteHookPost(ctx context.Context, h *ExecutedHook, api ClientAPI) error { + brokerID, stopServer := c.startClientAPIServer(api) _, err := c.grpc.ExecuteHookPost(ctx, &v1.ExecuteHookPostRequest{ - Hook: h, - Analyzer: brokerID, + Hook: h, + ClientApi: brokerID, }) stopServer() return err } -func (c client) ExecuteHookCleanUp(ctx context.Context, h *ExecutedHook, a Analyzer) error { - brokerID, stopServer := c.startAnalyzerServer(a) +func (c client) ExecuteHookCleanUp(ctx context.Context, h *ExecutedHook, api ClientAPI) error { + brokerID, stopServer := c.startClientAPIServer(api) _, err := c.grpc.ExecuteHookCleanUp(ctx, &v1.ExecuteHookCleanUpRequest{ - Hook: h, - Analyzer: brokerID, + Hook: h, + ClientApi: brokerID, }) stopServer() return err } -func (c client) startAnalyzerServer(a Analyzer) (uint32, func()) { +func (c client) startClientAPIServer(api ClientAPI) (uint32, func()) { var ( srv *grpc.Server brokerID = c.broker.NextId() @@ -113,7 +113,7 @@ func (c client) startAnalyzerServer(a Analyzer) (uint32, func()) { go c.broker.AcceptAndServe(brokerID, func(opts []grpc.ServerOption) *grpc.Server { srv = grpc.NewServer(opts...) - v1.RegisterAnalyzerServiceServer(srv, &analyzerServer{impl: a}) + v1.RegisterClientAPIServiceServer(srv, &clientAPIServer{impl: api}) return srv }) @@ -137,14 +137,14 @@ func (s server) Manifest(ctx context.Context, _ *v1.ManifestRequest) (*v1.Manife } func (s server) Execute(ctx context.Context, r *v1.ExecuteRequest) (*v1.ExecuteResponse, error) { - conn, err := s.broker.Dial(r.Analyzer) + conn, err := s.broker.Dial(r.ClientApi) if err != nil { return nil, err } defer conn.Close() - err = s.impl.Execute(ctx, r.GetCmd(), newAnalyzerClient(conn)) + err = s.impl.Execute(ctx, r.GetCmd(), newClientAPIClient(conn)) if err != nil { return nil, err } @@ -153,14 +153,14 @@ func (s server) Execute(ctx context.Context, r *v1.ExecuteRequest) (*v1.ExecuteR } func (s server) ExecuteHookPre(ctx context.Context, r *v1.ExecuteHookPreRequest) (*v1.ExecuteHookPreResponse, error) { - conn, err := s.broker.Dial(r.Analyzer) + conn, err := s.broker.Dial(r.ClientApi) if err != nil { return nil, err } defer conn.Close() - err = s.impl.ExecuteHookPre(ctx, r.GetHook(), newAnalyzerClient(conn)) + err = s.impl.ExecuteHookPre(ctx, r.GetHook(), newClientAPIClient(conn)) if err != nil { return nil, err } @@ -169,14 +169,14 @@ func (s server) ExecuteHookPre(ctx context.Context, r *v1.ExecuteHookPreRequest) } func (s server) ExecuteHookPost(ctx context.Context, r *v1.ExecuteHookPostRequest) (*v1.ExecuteHookPostResponse, error) { - conn, err := s.broker.Dial(r.Analyzer) + conn, err := s.broker.Dial(r.ClientApi) if err != nil { return nil, err } defer conn.Close() - err = s.impl.ExecuteHookPost(ctx, r.GetHook(), newAnalyzerClient(conn)) + err = s.impl.ExecuteHookPost(ctx, r.GetHook(), newClientAPIClient(conn)) if err != nil { return nil, err } @@ -185,14 +185,14 @@ func (s server) ExecuteHookPost(ctx context.Context, r *v1.ExecuteHookPostReques } func (s server) ExecuteHookCleanUp(ctx context.Context, r *v1.ExecuteHookCleanUpRequest) (*v1.ExecuteHookCleanUpResponse, error) { - conn, err := s.broker.Dial(r.Analyzer) + conn, err := s.broker.Dial(r.ClientApi) if err != nil { return nil, err } defer conn.Close() - err = s.impl.ExecuteHookCleanUp(ctx, r.GetHook(), newAnalyzerClient(conn)) + err = s.impl.ExecuteHookCleanUp(ctx, r.GetHook(), newClientAPIClient(conn)) if err != nil { return nil, err } @@ -200,34 +200,34 @@ func (s server) ExecuteHookCleanUp(ctx context.Context, r *v1.ExecuteHookCleanUp return &v1.ExecuteHookCleanUpResponse{}, nil } -func newAnalyzerClient(c *grpc.ClientConn) *analyzerClient { - return &analyzerClient{v1.NewAnalyzerServiceClient(c)} +func newClientAPIClient(c *grpc.ClientConn) *clientAPIClient { + return &clientAPIClient{v1.NewClientAPIServiceClient(c)} } -type analyzerClient struct { - grpc v1.AnalyzerServiceClient +type clientAPIClient struct { + grpc v1.ClientAPIServiceClient } -func (c analyzerClient) Dependencies(ctx context.Context) ([]*Dependency, error) { - r, err := c.grpc.Dependencies(ctx, &v1.DependenciesRequest{}) +func (c clientAPIClient) GetChainInfo(ctx context.Context) (*ChainInfo, error) { + r, err := c.grpc.GetChainInfo(ctx, &v1.GetChainInfoRequest{}) if err != nil { return nil, err } - return r.Dependencies, nil + return r.ChainInfo, nil } -type analyzerServer struct { - v1.UnimplementedAnalyzerServiceServer +type clientAPIServer struct { + v1.UnimplementedClientAPIServiceServer - impl Analyzer + impl ClientAPI } -func (s analyzerServer) Dependencies(ctx context.Context, _ *v1.DependenciesRequest) (*v1.DependenciesResponse, error) { - deps, err := s.impl.Dependencies(ctx) +func (s clientAPIServer) GetChainInfo(ctx context.Context, _ *v1.GetChainInfoRequest) (*v1.GetChainInfoResponse, error) { + chainInfo, err := s.impl.GetChainInfo(ctx) if err != nil { return nil, err } - return &v1.DependenciesResponse{Dependencies: deps}, nil + return &v1.GetChainInfoResponse{ChainInfo: chainInfo}, nil } diff --git a/ignite/services/plugin/template/go.mod.plush b/ignite/services/plugin/template/go.mod.plush index 7cc84e2622..e928a22f47 100644 --- a/ignite/services/plugin/template/go.mod.plush +++ b/ignite/services/plugin/template/go.mod.plush @@ -4,5 +4,5 @@ go 1.20 require ( github.com/hashicorp/go-plugin v1.4.9 - github.com/ignite/cli v0.27.1 + github.com/ignite/cli v0.27.2-0.20230904104007-0977ce42d467 ) diff --git a/ignite/services/plugin/template/main.go.plush b/ignite/services/plugin/template/main.go.plush index 2caf8a88e3..ce63b322df 100644 --- a/ignite/services/plugin/template/main.go.plush +++ b/ignite/services/plugin/template/main.go.plush @@ -41,7 +41,7 @@ func (p) Manifest(ctx context.Context) (*plugin.Manifest, error) { }, nil } -func (p) Execute(ctx context.Context, cmd *plugin.ExecutedCommand, az plugin.Analyzer) error { +func (p) Execute(ctx context.Context, cmd *plugin.ExecutedCommand, api plugin.ClientAPI) error { // TODO: write command execution here fmt.Printf("Hello I'm the example-plugin plugin\n") fmt.Printf("My executed command: %q\n", cmd.Path) @@ -73,20 +73,25 @@ func (p) Execute(ctx context.Context, cmd *plugin.ExecutedCommand, az plugin.Ana fmt.Println("Deleting stuff...") } */ + + // Calling the ClientAPI example + + fmt.Println(api.GetChainInfo(ctx)) + return nil } -func (p) ExecuteHookPre(ctx context.Context, h *plugin.ExecutedHook, az plugin.Analyzer) error { +func (p) ExecuteHookPre(ctx context.Context, h *plugin.ExecutedHook, api plugin.ClientAPI) error { fmt.Printf("Executing hook pre %q\n", h.Hook.GetName()) return nil } -func (p) ExecuteHookPost(ctx context.Context, h *plugin.ExecutedHook, az plugin.Analyzer) error { +func (p) ExecuteHookPost(ctx context.Context, h *plugin.ExecutedHook, api plugin.ClientAPI) error { fmt.Printf("Executing hook post %q\n", h.Hook.GetName()) return nil } -func (p) ExecuteHookCleanUp(ctx context.Context, h *plugin.ExecutedHook, az plugin.Analyzer) error { +func (p) ExecuteHookCleanUp(ctx context.Context, h *plugin.ExecutedHook, api plugin.ClientAPI) error { fmt.Printf("Executing hook cleanup %q\n", h.Hook.GetName()) return nil } diff --git a/integration/plugin/testdata/example-plugin/main.go b/integration/plugin/testdata/example-plugin/main.go index b4192a2e5b..4a8b177bf4 100644 --- a/integration/plugin/testdata/example-plugin/main.go +++ b/integration/plugin/testdata/example-plugin/main.go @@ -29,7 +29,7 @@ func (p) Manifest(context.Context) (*plugin.Manifest, error) { }, nil } -func (p) Execute(_ context.Context, cmd *plugin.ExecutedCommand, az plugin.Analyzer) error { +func (p) Execute(ctx context.Context, cmd *plugin.ExecutedCommand, api plugin.ClientAPI) error { fmt.Printf("Hello I'm the example-plugin plugin\n") fmt.Printf("My executed command: %q\n", cmd.Path) fmt.Printf("My args: %v\n", cmd.Args) @@ -42,20 +42,23 @@ func (p) Execute(_ context.Context, cmd *plugin.ExecutedCommand, az plugin.Analy myFlag, _ := flags.GetString("my-flag") fmt.Printf("My flags: my-flag=%q\n", myFlag) fmt.Printf("My config parameters: %v\n", cmd.With) + + fmt.Println(api.GetChainInfo(ctx)) + return nil } -func (p) ExecuteHookPre(_ context.Context, h *plugin.ExecutedHook, az plugin.Analyzer) error { +func (p) ExecuteHookPre(_ context.Context, h *plugin.ExecutedHook, _ plugin.ClientAPI) error { fmt.Printf("Executing hook pre %q\n", h.Hook.GetName()) return nil } -func (p) ExecuteHookPost(_ context.Context, h *plugin.ExecutedHook, az plugin.Analyzer) error { +func (p) ExecuteHookPost(_ context.Context, h *plugin.ExecutedHook, _ plugin.ClientAPI) error { fmt.Printf("Executing hook post %q\n", h.Hook.GetName()) return nil } -func (p) ExecuteHookCleanUp(_ context.Context, h *plugin.ExecutedHook, az plugin.Analyzer) error { +func (p) ExecuteHookCleanUp(_ context.Context, h *plugin.ExecutedHook, _ plugin.ClientAPI) error { fmt.Printf("Executing hook cleanup %q\n", h.Hook.GetName()) return nil } diff --git a/proto/ignite/services/plugin/grpc/v1/analyzer.proto b/proto/ignite/services/plugin/grpc/v1/analyzer.proto deleted file mode 100644 index 69e352cf1c..0000000000 --- a/proto/ignite/services/plugin/grpc/v1/analyzer.proto +++ /dev/null @@ -1,156 +0,0 @@ -syntax = "proto3"; - -package ignite.services.plugin.grpc.v1; - -option go_package = "github.com/ignite/cli/ignite/services/plugin/grpc/v1"; - -// Dependecy keeps data about Go module dependencies. -message Dependency { - // Path is the absolute path to the Go module. - string path = 1; - - // Modules contains the list of modules defined by the dependency. - repeated Module modules = 2; -} - -// Module keeps metadata about a Cosmos SDK module. -message Module { - // Name of the module. - string name = 1; - - // Go module path of the app where the module is defined. - string go_module_path = 2; - - // Package contains proto package info. - ProtoPackage package = 3; - - // Messages is the list of sdk.Msg that the module implements. - repeated Message messages = 4; - - // HTTP queries is a list of module queries. - repeated HTTPQuery http_queries = 5; - - // Types is a list of proto types that could be used by the module. - repeated Type types = 6; -} - -// ProtoPackage represents a proto package. -message ProtoPackage { - // Name of the proto package. - string name = 1; - - // Path of the proto package. - string path = 2; - - // Files is list of package proto files. - repeated ProtoFile files = 3; - - // Go import name for the proto package. - string go_import_name = 4; - - // Messages is list of messages defined within the proto package. - repeated ProtoMessage messages = 5; - - // Services is list of services defined within the proto package. - repeated ProtoService services = 6; -} - -// ProtoFile represents a proto file. -message ProtoFile { - // Path to the file. - string path = 1; - - // Dependencies is a list of imported proto packages. - repeated string dependencies = 2; -} - -// ProtoMessage represents a proto message. -message ProtoMessage { - // Name of the message. - string name = 1; - - // Path of the proto file where the message is defined. - string path = 2; - - // Highest field name is the highest field number among fields of the message. - // This allows to determine new field number when writing to proto message. - int32 highest_field_number = 3; - - // Fields contains message's field names and types. - map fields = 4; -} - -// ProtoService represents a proto RPC service. -message ProtoService { - // Name of the service. - string name = 1; - - // Functions is a list of RPC functions. - repeated ProtoServiceFunc functions = 2; -} - -// Proto service func represents a proto RPC function. -message ProtoServiceFunc { - // Name of the RPC function. - string name = 1; - - // Request type is the request type of the RPC function. - string request_type = 2; - - // Return type is the return type of the RPC function. - string return_type = 3; - - // Paginated indicates that the function is using pagination. - bool paginated = 4; - - // HTTP rules keeps info about HTTP annotations of query. - repeated HTTPRule http_rules = 5; -} - -// Message keeps metadata about an sdk.Msg implementation. -message Message { - // Name of the type. - string name = 1; - - // URI of the type. - string uri = 2; - - // File path is the path of the proto file where message is defined. - string file_path = 3; -} - -// HTTPQuery is an SDK query. -message HTTPQuery { - // Name of the RPC function. - string name = 1; - - // Full name of the query with service name and RPC function name. - string full_name = 2; - - // Paginated indicates that the query is using pagination. - bool paginated = 3; - - // HTTP rules keeps info about HTTP annotations of query. - repeated HTTPRule rules = 4; -} - -// HTTP rule keeps info about a configured HTTP rule of an RPC function. -message HTTPRule { - // Params is a list of parameters defined in the HTTP endpoint itself. - repeated string params = 1; - - // Has query indicates if there is a request query. - bool has_query = 2; - - // Has body indicates if there is a request payload. - bool has_body = 3; -} - -// Type is a proto type. -message Type { - // Name pf the type. - string name = 1; - - // File path is the path of the .proto file where message is defined at. - string file_path = 2; -} diff --git a/proto/ignite/services/plugin/grpc/v1/client_api.proto b/proto/ignite/services/plugin/grpc/v1/client_api.proto new file mode 100644 index 0000000000..d7b76c7bc0 --- /dev/null +++ b/proto/ignite/services/plugin/grpc/v1/client_api.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package ignite.services.plugin.grpc.v1; + +option go_package = "github.com/ignite/cli/ignite/services/plugin/grpc/v1"; + +message ChainInfo { + string chain_id = 1; + string app_path = 2; + string config_path = 3; + string rpc_address = 4; +} diff --git a/proto/ignite/services/plugin/grpc/v1/service.proto b/proto/ignite/services/plugin/grpc/v1/service.proto index 6ee292bb21..bd1d94dc8e 100644 --- a/proto/ignite/services/plugin/grpc/v1/service.proto +++ b/proto/ignite/services/plugin/grpc/v1/service.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ignite.services.plugin.grpc.v1; -import "ignite/services/plugin/grpc/v1/analyzer.proto"; +import "ignite/services/plugin/grpc/v1/client_api.proto"; import "ignite/services/plugin/grpc/v1/interface.proto"; option go_package = "github.com/ignite/cli/ignite/services/plugin/grpc/v1"; @@ -45,40 +45,42 @@ message ManifestResponse { message ExecuteRequest { ExecutedCommand cmd = 1; - uint32 analyzer = 2; + uint32 client_api = 2; } message ExecuteResponse {} message ExecuteHookPreRequest { ExecutedHook hook = 1; - uint32 analyzer = 2; + uint32 client_api = 2; } message ExecuteHookPreResponse {} message ExecuteHookPostRequest { ExecutedHook hook = 1; - uint32 analyzer = 2; + uint32 client_api = 2; } message ExecuteHookPostResponse {} message ExecuteHookCleanUpRequest { ExecutedHook hook = 1; - uint32 analyzer = 2; + uint32 client_api = 2; } message ExecuteHookCleanUpResponse {} -// AnalyzerService defines the interface that allows plugins to get chain app analysis info. -service AnalyzerService { +// ClientAPIService defines the interface that allows plugins to get chain app analysis info. +service ClientAPIService { + // GetChainInfo returns basic chain info for the configured app + rpc GetChainInfo(GetChainInfoRequest) returns (GetChainInfoResponse); + // Dependencies returns the app dependencies. - rpc Dependencies(DependenciesRequest) returns (DependenciesResponse); + //rpc Dependencies(DependenciesRequest) returns (DependenciesResponse); } +message GetChainInfoRequest {} -message DependenciesRequest {} - -message DependenciesResponse { - repeated Dependency dependencies = 2; +message GetChainInfoResponse { + ChainInfo chain_info = 1; }