github.com/taubyte/tau-cli@v0.1.13-0.20240326000942-487f0d57edfc/table/smartops/list_test.go (about)

     1  package smartopsTable_test
     2  
     3  import (
     4  	structureSpec "github.com/taubyte/go-specs/structure"
     5  	smartopsTable "github.com/taubyte/tau-cli/table/smartops"
     6  )
     7  
     8  func ExampleList() {
     9  	smartops := []*structureSpec.SmartOp{
    10  		{
    11  			Id:   "QmbAA8hRosp5BaXFXikADCtpkQCgQCPdRVhnxjiSHfXdWH",
    12  			Name: "someSmartOp1",
    13  			Call: "ping",
    14  		},
    15  		{
    16  			Id:   "QmbUIDhRosp5BaXDASEWSCtpkQCgQCPdRVhnxjiSHfXdC0",
    17  			Name: "someSmartOp2",
    18  			Call: "testlib.ping",
    19  		},
    20  	}
    21  
    22  	smartopsTable.List(smartops)
    23  
    24  	// Output:
    25  	// ┌─────────────────┬──────────────┬──────────────┐
    26  	// │ ID              │ NAME         │ CALL         │
    27  	// ├─────────────────┼──────────────┼──────────────┤
    28  	// │ QmbAA8...HfXdWH │ someSmartOp1 │ ping         │
    29  	// ├─────────────────┼──────────────┼──────────────┤
    30  	// │ QmbUID...HfXdC0 │ someSmartOp2 │ testlib.ping │
    31  	// └─────────────────┴──────────────┴──────────────┘
    32  }