gitpb/goDep.helpers.go

29 lines
643 B
Go

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.AppendUniqueGoPath(newP)
}
// returns time.Duration since last scan of go.sum & go.mod
func (repo *Repo) AgeGoDep() time.Duration {
t := time.Since(repo.LastGoDep.AsTime())
return t
}
// find a dependancy by the go path
func (repo *Repo) FindGoDepByPath(gopath string) *GoDep {
return repo.GoDeps.FindByGoPath(gopath)
}