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

     1  package websiteTable_test
     2  
     3  import (
     4  	structureSpec "github.com/taubyte/go-specs/structure"
     5  	websiteTable "github.com/taubyte/tau-cli/table/website"
     6  )
     7  
     8  func ExampleList() {
     9  	websites := []*structureSpec.Website{
    10  		{
    11  			Id:       "QmbAA8hRosp5BaXFXikADCtpkQCgQCPdRVhnxjiSHfXdWH",
    12  			Name:     "someWebsite1",
    13  			Provider: "github",
    14  			RepoName: "taubyte-test/test_site1",
    15  		},
    16  		{
    17  			Id:       "QmbUIDhRosp5BaXDASEWSCtpkQCgQCPdRVhnxjiSHfXdC0",
    18  			Name:     "someWebsite2",
    19  			Provider: "github",
    20  			RepoName: "taubyte-test/test_site2",
    21  		},
    22  	}
    23  
    24  	websiteTable.List(websites)
    25  
    26  	// Output:
    27  	// ┌─────────────────┬────────────────────────────────────────────┐
    28  	// │ ID              │ NAME                                       │
    29  	// │                 │ REPOSITORY                                 │
    30  	// ├─────────────────┼────────────────────────────────────────────┤
    31  	// │ QmbAA8...HfXdWH │ someWebsite1                               │
    32  	// │                 │ https://github.com/taubyte-test/test_site1 │
    33  	// ├─────────────────┼────────────────────────────────────────────┤
    34  	// │ QmbUID...HfXdC0 │ someWebsite2                               │
    35  	// │                 │ https://github.com/taubyte-test/test_site2 │
    36  	// └─────────────────┴────────────────────────────────────────────┘
    37  }