Init .
(_ context.Context, repo *cache.RepoCache, conf core.Configuration)
| 40 | |
| 41 | // Init . |
| 42 | func (ge *gitlabExporter) Init(_ context.Context, repo *cache.RepoCache, conf core.Configuration) error { |
| 43 | ge.conf = conf |
| 44 | ge.identityClient = make(map[entity.Id]*gitlab.Client) |
| 45 | ge.cachedOperationIDs = make(map[string]string) |
| 46 | |
| 47 | // get repository node id |
| 48 | ge.repositoryID = ge.conf[confKeyProjectID] |
| 49 | |
| 50 | // preload all clients |
| 51 | err := ge.cacheAllClient(repo, ge.conf[confKeyGitlabBaseUrl]) |
| 52 | if err != nil { |
| 53 | return err |
| 54 | } |
| 55 | |
| 56 | return nil |
| 57 | } |
| 58 | |
| 59 | func (ge *gitlabExporter) cacheAllClient(repo *cache.RepoCache, baseURL string) error { |
| 60 | creds, err := auth.List(repo, |