github.com/taubyte/tau-cli@v0.1.13-0.20240326000942-487f0d57edfc/table/library/table.go (about) 1 package libraryTable 2 3 import ( 4 "strings" 5 6 structureSpec "github.com/taubyte/go-specs/structure" 7 repositoryLib "github.com/taubyte/tau-cli/lib/repository" 8 ) 9 10 func getTableData(library *structureSpec.Library, showId bool) (toRender [][]string) { 11 if showId { 12 toRender = [][]string{ 13 {"ID", library.Id}, 14 } 15 } 16 17 toRender = append(toRender, [][]string{ 18 {"Name", library.Name}, 19 {"Description", library.Description}, 20 {"Tags", strings.Join(library.Tags, ", ")}, 21 {"Path", library.Path}, 22 }...) 23 24 toRender = append(toRender, [][]string{ 25 {"Repository", repositoryLib.GetRepositoryUrl(library.Provider, library.RepoName)}, 26 {"\tName", library.RepoName}, 27 {"\tID", library.RepoID}, 28 {"\tProvider", library.Provider}, 29 {"\tBranch", library.Branch}, 30 }...) 31 32 return toRender 33 }