github.com/taubyte/tau-cli@v0.1.13-0.20240326000942-487f0d57edfc/table/service/list_test.go (about) 1 package serviceTable_test 2 3 import ( 4 structureSpec "github.com/taubyte/go-specs/structure" 5 serviceTable "github.com/taubyte/tau-cli/table/service" 6 ) 7 8 func ExampleList() { 9 services := []*structureSpec.Service{ 10 { 11 Id: "QmbAA8hRosp5BaXFXikADCtpkQCgQCPdRVhnxjiSHfXdWH", 12 Name: "someService1", 13 Protocol: "/test/v1", 14 }, 15 { 16 Id: "QmbUIDhRosp5BaXDASEWSCtpkQCgQCPdRVhnxjiSHfXdC0", 17 Name: "someService2", 18 Protocol: "/test/v2", 19 }, 20 } 21 22 serviceTable.List(services) 23 24 // Output: 25 // ┌─────────────────┬──────────────┬──────────┐ 26 // │ ID │ NAME │ PROTOCOL │ 27 // ├─────────────────┼──────────────┼──────────┤ 28 // │ QmbAA8...HfXdWH │ someService1 │ /test/v1 │ 29 // ├─────────────────┼──────────────┼──────────┤ 30 // │ QmbUID...HfXdC0 │ someService2 │ /test/v2 │ 31 // └─────────────────┴──────────────┴──────────┘ 32 }