Documentation ¶
Index ¶
- func Confirm(ctx *cli.Context, project *projectLib.Project, prompt string) bool
- func List(projects []*client.Project, descriptor Descriptor)
- func ListNoRender(projects []*client.Project, descriptor Descriptor) table.Writer
- func Query(project *client.Project, repos *client.RawRepoDataOuter, description string)
- type Descriptor
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func List ¶
func List(projects []*client.Project, descriptor Descriptor)
Example ¶
package main import ( "fmt" projectTable "github.com/taubyte/tau-cli/table/project" client "github.com/taubyte/tau/clients/http/auth" ) func main() { project := []*client.Project{ { Id: "QmbAA8hRosp5BaXFXikADCtpkQCgQCPdRVhnxjiSHfXdWH", Name: "someProject1", }, { Id: "QmbUIDhRosp5BaXDASEWSCtpkQCgQCPdRVhnxjiSHfXdC0", Name: "someProject2", }, } projectTable.List(project, func(project *client.Project) string { return fmt.Sprintf("This is a description of `%s` it does cool stuff I promise", project.Name) }) }
Output: ┌─────────────────┬──────────────┬──────────────────────────────────────────┐ │ ID │ NAME │ DESCRIPTION │ ├─────────────────┼──────────────┼──────────────────────────────────────────┤ │ QmbAA8...HfXdWH │ someProject1 │ This is a description of `someProject1` │ │ │ │ it does cool stuff I promise │ ├─────────────────┼──────────────┼──────────────────────────────────────────┤ │ QmbUID...HfXdC0 │ someProject2 │ This is a description of `someProject2` │ │ │ │ it does cool stuff I promise │ └─────────────────┴──────────────┴──────────────────────────────────────────┘
func ListNoRender ¶
func ListNoRender(projects []*client.Project, descriptor Descriptor) table.Writer
func Query ¶
func Query(project *client.Project, repos *client.RawRepoDataOuter, description string)
Example ¶
package main import ( projectTable "github.com/taubyte/tau-cli/table/project" client "github.com/taubyte/tau/clients/http/auth" ) func main() { project := &client.Project{ Id: "QmbAA8hRosp5BaXFXikADCtpkQCgQCPdRVhnxjiSHfXdWH", Name: "someProject", } repoData := &client.RawRepoDataOuter{ Configuration: client.RawRepoData{ Fullname: "taubyte-test/tb_test_project", Url: "https://api.github.com/repos/taubyte-test/tb_test_project", }, Code: client.RawRepoData{ Fullname: "taubyte-test/tb_code_test_project", Url: "https://api.github.com/repos/taubyte-test/tb_code_test_project", }, Provider: "github", } projectTable.Query(project, repoData, "some") }
Output: ┌─────────────┬──────────────────────────────────────────────────────┐ │ ID │ QmbAA8hRosp5BaXFXikADCtpkQCgQCPdRVhnxjiSHfXdWH │ ├─────────────┼──────────────────────────────────────────────────────┤ │ Name │ someProject │ ├─────────────┼──────────────────────────────────────────────────────┤ │ Description │ some │ ├─────────────┼──────────────────────────────────────────────────────┤ │ │ Code │ │ Name: │ taubyte-test/tb_code_test_project │ │ URL: │ https://github.com/taubyte-test/tb_code_test_project │ ├─────────────┼──────────────────────────────────────────────────────┤ │ │ Config │ │ Name: │ taubyte-test/tb_test_project │ │ URL: │ https://github.com/taubyte-test/tb_test_project │ └─────────────┴──────────────────────────────────────────────────────┘
Types ¶
type Descriptor ¶
Takes a project and returns a description
Click to show internal directories.
Click to hide internal directories.