From 702c43601b5d48af64690be3de03a21bb86d9f2d Mon Sep 17 00:00:00 2001 From: Marius Kimmina <38843153+mariuskimmina@users.noreply.github.com> Date: Mon, 2 Oct 2023 15:28:36 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20provider=20scaffolding=20(?= =?UTF-8?q?#2038)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marius Kimmina --- .../template/provider/provider.go.template | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/provider-scaffold/template/provider/provider.go.template b/apps/provider-scaffold/template/provider/provider.go.template index fbaeb635b8..af12f5ca75 100644 --- a/apps/provider-scaffold/template/provider/provider.go.template +++ b/apps/provider-scaffold/template/provider/provider.go.template @@ -107,7 +107,6 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba asset.Connections[0].Id = conn.ID() s.runtimes[conn.ID()] = &plugin.Runtime{ Connection: conn, - Resources: map[string]plugin.Resource{}, Callback: callback, HasRecording: req.HasRecording, CreateResource: resources.CreateResource, @@ -154,7 +153,7 @@ func (s *Service) GetData(req *plugin.DataReq) (*plugin.DataRes, error) { }, nil } - resource, ok := runtime.Resources[req.Resource+"\x00"+req.ResourceId] + resource, ok := runtime.Resources.Get(req.Resource + "\x00" + req.ResourceId) if !ok { // Note: Since resources are internally always created, there are only very // few cases where we arrive here: @@ -184,3 +183,7 @@ func (s *Service) GetData(req *plugin.DataReq) (*plugin.DataRes, error) { func (s *Service) StoreData(req *plugin.StoreReq) (*plugin.StoreRes, error) { return nil, errors.New("not yet implemented") } + +func (s *Service) MockConnect(req *plugin.ConnectReq, callback plugin.ProviderCallback) (*plugin.ConnectRes, error) { + return nil, errors.New("mock connect not yet implemented") +}