mirror of
https://github.com/trufflesecurity/trufflehog.git
synced 2026-06-15 13:24:37 +00:00
* 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
30 lines
433 B
Go
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
|
|
}
|