github.com/taubyte/tau-cli@v0.1.13-0.20240326000942-487f0d57edfc/table/smartops/query_test.go (about) 1 package smartopsTable_test 2 3 import ( 4 "time" 5 6 "github.com/alecthomas/units" 7 structureSpec "github.com/taubyte/go-specs/structure" 8 smartopsTable "github.com/taubyte/tau-cli/table/smartops" 9 ) 10 11 func ExampleQuery() { 12 smartops := &structureSpec.SmartOp{ 13 Id: "QmbAA8hRosp5BaXFXikADCtpkQCgQCPdRVhnxjiSHfXdWH", 14 Name: "someProject", 15 Description: "a simple smartops", 16 Tags: []string{"smartops_tag_1", "smartops_tag_2"}, 17 Timeout: uint64(20 * time.Second), 18 Memory: uint64(32 * units.GB), 19 Call: "ping", 20 Source: ".", 21 } 22 smartopsTable.Query(smartops) 23 24 // Output: 25 // ┌─────────────┬────────────────────────────────────────────────┐ 26 // │ ID │ QmbAA8hRosp5BaXFXikADCtpkQCgQCPdRVhnxjiSHfXdWH │ 27 // ├─────────────┼────────────────────────────────────────────────┤ 28 // │ Name │ someProject │ 29 // ├─────────────┼────────────────────────────────────────────────┤ 30 // │ Description │ a simple smartops │ 31 // ├─────────────┼────────────────────────────────────────────────┤ 32 // │ Tags │ smartops_tag_1, smartops_tag_2 │ 33 // ├─────────────┼────────────────────────────────────────────────┤ 34 // │ Timeout │ 20s │ 35 // ├─────────────┼────────────────────────────────────────────────┤ 36 // │ Memory │ 32GB │ 37 // ├─────────────┼────────────────────────────────────────────────┤ 38 // │ Source │ . │ 39 // ├─────────────┼────────────────────────────────────────────────┤ 40 // │ Call │ ping │ 41 // └─────────────┴────────────────────────────────────────────────┘ 42 }