add a lookup by path function

This commit is contained in:
Jeff Carr 2024-02-14 15:18:39 -06:00
parent 3d6002b055
commit e6eb92845a
1 changed files with 10 additions and 1 deletions

11
new.go
View File

@ -17,6 +17,15 @@ func ListAll() {
}
}
// returns the object for the path
func FindPath(path string) *RepoStatus {
if windowMap[path] == nil {
log.Log(INFO, "FindPath() not initialized yet", path)
return nil
}
return windowMap[path]
}
func NewRepoStatusWindow(path string) *RepoStatus {
if windowMap[path] == nil {
log.Log(INFO, "NewRepoStatusWindow() adding new", path)
@ -45,7 +54,7 @@ func NewRepoStatusWindow(path string) *RepoStatus {
}
rs := &RepoStatus{
ready: false,
ready: false,
}
rs.tags = make(map[string]string)
rs.window = gadgets.RawBasicWindow("GO Repo Details " + path)