libraryTable

package
v0.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Confirm

func Confirm(ctx *cli.Context, library *structureSpec.Library, prompt string) bool

func List

func List(libraries []*structureSpec.Library)
Example
package main

import (
	structureSpec "github.com/taubyte/go-specs/structure"
	libraryTable "github.com/taubyte/tau-cli/table/library"
)

func main() {
	libraries := []*structureSpec.Library{
		{
			Id:       "QmbAA8hRosp5BaXFXikADCtpkQCgQCPdRVhnxjiSHfXdWH",
			Name:     "someLibrary1",
			Provider: "github",
			RepoName: "taubyte-test/test_site1",
		},
		{
			Id:       "QmbUIDhRosp5BaXDASEWSCtpkQCgQCPdRVhnxjiSHfXdC0",
			Name:     "someLibrary2",
			Provider: "github",
			RepoName: "taubyte-test/test_site2",
		},
	}

	libraryTable.List(libraries)

}
Output:

┌─────────────────┬────────────────────────────────────────────┐
│ ID              │ NAME                                       │
│                 │ REPOSITORY                                 │
├─────────────────┼────────────────────────────────────────────┤
│ QmbAA8...HfXdWH │ someLibrary1                               │
│                 │ https://github.com/taubyte-test/test_site1 │
├─────────────────┼────────────────────────────────────────────┤
│ QmbUID...HfXdC0 │ someLibrary2                               │
│                 │ https://github.com/taubyte-test/test_site2 │
└─────────────────┴────────────────────────────────────────────┘

func Query

func Query(library *structureSpec.Library)
Example
package main

import (
	structureSpec "github.com/taubyte/go-specs/structure"
	libraryTable "github.com/taubyte/tau-cli/table/library"
)

func main() {
	library := &structureSpec.Library{
		Id:          "QmbAA8hRosp5BaXFXikADCtpkQCgQCPdRVhnxjiSHfXdWH",
		Name:        "someProject",
		Description: "this is a library of some type",
		Tags:        []string{"apple", "orange", "banana"},
		Path:        "/",
		Branch:      "master",
		Provider:    "github",
		RepoID:      "591991",
		RepoName:    "taubyte/example",
	}

	libraryTable.Query(library)

}
Output:

┌──────────────┬────────────────────────────────────────────────┐
│ ID           │ QmbAA8hRosp5BaXFXikADCtpkQCgQCPdRVhnxjiSHfXdWH │
├──────────────┼────────────────────────────────────────────────┤
│ Name         │ someProject                                    │
├──────────────┼────────────────────────────────────────────────┤
│ Description  │ this is a library of some type                 │
├──────────────┼────────────────────────────────────────────────┤
│ Tags         │ apple, orange, banana                          │
├──────────────┼────────────────────────────────────────────────┤
│ Path         │ /                                              │
├──────────────┼────────────────────────────────────────────────┤
│ Repository   │ https://github.com/taubyte/example             │
├──────────────┼────────────────────────────────────────────────┤
│  -  Name     │ taubyte/example                                │
├──────────────┼────────────────────────────────────────────────┤
│  -  ID       │ 591991                                         │
├──────────────┼────────────────────────────────────────────────┤
│  -  Provider │ github                                         │
├──────────────┼────────────────────────────────────────────────┤
│  -  Branch   │ master                                         │
└──────────────┴────────────────────────────────────────────────┘

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL