github.com/criteo/command-launcher@v0.0.0-20230407142452-fb616f546e98/internal/repository/default-repo-index-entry.go (about) 1 package repository 2 3 import "github.com/criteo/command-launcher/internal/command" 4 5 type defaultRepoIndexEntry struct { 6 PkgName string `json:"pkgName"` 7 PkgVersion string `json:"version"` 8 PkgCommands []*command.DefaultCommand `json:"cmds"` 9 } 10 11 func (pkg *defaultRepoIndexEntry) Name() string { 12 return pkg.PkgName 13 } 14 15 func (pkg *defaultRepoIndexEntry) Version() string { 16 return pkg.PkgVersion 17 } 18 19 func (pkg *defaultRepoIndexEntry) Commands() []command.Command { 20 cmds := []command.Command{} 21 for _, c := range pkg.PkgCommands { 22 cmds = append(cmds, c) 23 } 24 return cmds 25 }