Files
trufflehog/pkg/sources/gitlab/project_cache.go
Muneeb Ullah Khan f70218bad0 [INS-249] Updated Gitlab client from v0.129.0 to v1.12.0(latest) (#4655)
* updated gitlab client from v0.129.0 to v1.12.0(latest)

* fixed integration test

* unpinned v0.129 gitlab client and migrated code

* Migrated auth code

* Remove unused 'time' import

Removed unused 'time' import from gitlab.go

* reverted merged case statements

* splitted line like before

* splitted code into multiple lines

* resolved bugbot comments
2026-02-03 16:52:13 +05:00

30 lines
433 B
Go

package gitlab
import "sync"
type project struct {
id int64
name string
owner string
}
type repoToProjectCache struct {
sync.RWMutex
cache map[string]*project
}
func (r *repoToProjectCache) get(repo string) (*project, bool) {
r.RLock()
defer r.RUnlock()
proj, ok := r.cache[repo]
return proj, ok
}
func (r *repoToProjectCache) set(repo string, proj *project) {
r.Lock()
defer r.Unlock()
r.cache[repo] = proj
}