| 36 | var raScopeSearch *api.DsRemoteApiScopeSearchHelper[models.GitlabConnection, models.GitlabProject] |
| 37 | |
| 38 | func Init(br context.BasicRes, p plugin.PluginMeta) { |
| 39 | vld = validator.New() |
| 40 | basicRes = br |
| 41 | dsHelper = api.NewDataSourceHelper[ |
| 42 | models.GitlabConnection, models.GitlabProject, models.GitlabScopeConfig, |
| 43 | ]( |
| 44 | br, |
| 45 | p.Name(), |
| 46 | []string{"name"}, |
| 47 | func(c models.GitlabConnection) models.GitlabConnection { |
| 48 | return c.Sanitize() |
| 49 | }, |
| 50 | nil, |
| 51 | nil, |
| 52 | ) |
| 53 | // TODO: remove connectionHelper and refactor remoteHelper |
| 54 | raProxy = api.NewDsRemoteApiProxyHelper[models.GitlabConnection](dsHelper.ConnApi.ModelApiHelper) |
| 55 | raScopeList = api.NewDsRemoteApiScopeListHelper[models.GitlabConnection, models.GitlabProject, GitlabRemotePagination](raProxy, listGitlabRemoteScopes) |
| 56 | raScopeSearch = api.NewDsRemoteApiScopeSearchHelper[models.GitlabConnection, models.GitlabProject](raProxy, searchGitlabScopes) |
| 57 | } |