github.com/taubyte/tau-cli@v0.1.13-0.20240326000942-487f0d57edfc/table/messaging/table.go (about) 1 package messagingTable 2 3 import ( 4 "strconv" 5 "strings" 6 7 structureSpec "github.com/taubyte/go-specs/structure" 8 ) 9 10 func getTableData(messaging *structureSpec.Messaging, showId bool) (toRender [][]string) { 11 if showId { 12 toRender = [][]string{ 13 {"ID", messaging.Id}, 14 } 15 } 16 17 toRender = append(toRender, [][]string{ 18 {"Name", messaging.Name}, 19 {"Description", messaging.Description}, 20 {"Tags", strings.Join(messaging.Tags, ", ")}, 21 {"Local", strconv.FormatBool(messaging.Local)}, 22 {"Channel", ""}, 23 {"\tMatch", messaging.Match}, 24 {"\tUse Regex", strconv.FormatBool(messaging.Regex)}, 25 {"Bridges", ""}, 26 {"\tMQTT", strconv.FormatBool(messaging.MQTT)}, 27 {"\tWebSocket", strconv.FormatBool(messaging.WebSocket)}, 28 }...) 29 30 return toRender 31 }