blob: 271e67bff601e3c3a6bb930d9cc4530269e46552 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
package gitpb
// this is becoming a standard format
// todo: autogenerate this from the .proto file?
import (
"time"
)
func (repo *Repo) DeleteGoDepByHash(hash string) {
repo.GoDeps.DeleteByHash(hash)
}
// enforces no duplicate package names
func (repo *Repo) AppendGoDep(newP *GoDep) bool {
return repo.GoDeps.AppendByGoPath(newP)
}
// returns time.Duration since last scan of go.sum & go.mod
func (repo *Repo) AgeGoDep() time.Duration {
t := time.Since(repo.Times.LastGoDep.AsTime())
return t
}
// find a dependancy by the go path
func (repo *Repo) FindGoDepByPath(gopath string) *GoDep {
return repo.GoDeps.FindByGoPath(gopath)
}
|