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

     1  package storageTable_test
     2  
     3  import (
     4  	structureSpec "github.com/taubyte/go-specs/structure"
     5  	storageTable "github.com/taubyte/tau-cli/table/storage"
     6  )
     7  
     8  func ExampleList() {
     9  	storages := []*structureSpec.Storage{
    10  		{
    11  			Id:    "QmbAA8hRosp5BaXFXikADCtpkQCgQCPdRVhnxjiSHfXdWH",
    12  			Name:  "someStorage1",
    13  			Match: "/test/v1",
    14  		},
    15  		{
    16  			Id:    "QmbUIDhRosp5BaXDASEWSCtpkQCgQCPdRVhnxjiSHfXdC0",
    17  			Name:  "someStorage2",
    18  			Match: "/test/v2",
    19  		},
    20  	}
    21  
    22  	storageTable.List(storages)
    23  
    24  	// Output:
    25  	// ┌─────────────────┬──────────────┬──────────┐
    26  	// │ ID              │ NAME         │ MATCH    │
    27  	// ├─────────────────┼──────────────┼──────────┤
    28  	// │ QmbAA8...HfXdWH │ someStorage1 │ /test/v1 │
    29  	// ├─────────────────┼──────────────┼──────────┤
    30  	// │ QmbUID...HfXdC0 │ someStorage2 │ /test/v2 │
    31  	// └─────────────────┴──────────────┴──────────┘
    32  }