websiteTable

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: 8 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Confirm

func Confirm(ctx *cli.Context, website *structureSpec.Website, prompt string) bool

func List

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

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

func main() {
	websites := []*structureSpec.Website{
		{
			Id:       "QmbAA8hRosp5BaXFXikADCtpkQCgQCPdRVhnxjiSHfXdWH",
			Name:     "someWebsite1",
			Provider: "github",
			RepoName: "taubyte-test/test_site1",
		},
		{
			Id:       "QmbUIDhRosp5BaXDASEWSCtpkQCgQCPdRVhnxjiSHfXdC0",
			Name:     "someWebsite2",
			Provider: "github",
			RepoName: "taubyte-test/test_site2",
		},
	}

	websiteTable.List(websites)

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

func Query

func Query(website *structureSpec.Website)
Example
package main

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

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

	websiteTable.Query(website)

}
Output:
┌──────────────┬────────────────────────────────────────────────┐
│ ID           │ QmbAA8hRosp5BaXFXikADCtpkQCgQCPdRVhnxjiSHfXdWH │
├──────────────┼────────────────────────────────────────────────┤
│ Name         │ someProject                                    │
├──────────────┼────────────────────────────────────────────────┤
│ Description  │ this is a website of some type                 │
├──────────────┼────────────────────────────────────────────────┤
│ Tags         │ apple, orange, banana                          │
├──────────────┼────────────────────────────────────────────────┤
│ Paths        │ /                                              │
├──────────────┼────────────────────────────────────────────────┤
│ Domains      │ hal.computers.com                              │
├──────────────┼────────────────────────────────────────────────┤
│ 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