Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func List ¶
func List(smartops []*structureSpec.SmartOp)
Example ¶
package main
import (
structureSpec "github.com/taubyte/go-specs/structure"
smartopsTable "github.com/taubyte/tau-cli/table/smartops"
)
func main() {
smartops := []*structureSpec.SmartOp{
{
Id: "QmbAA8hRosp5BaXFXikADCtpkQCgQCPdRVhnxjiSHfXdWH",
Name: "someSmartOp1",
Call: "ping",
},
{
Id: "QmbUIDhRosp5BaXDASEWSCtpkQCgQCPdRVhnxjiSHfXdC0",
Name: "someSmartOp2",
Call: "testlib.ping",
},
}
smartopsTable.List(smartops)
}
Output: ┌─────────────────┬──────────────┬──────────────┐ │ ID │ NAME │ CALL │ ├─────────────────┼──────────────┼──────────────┤ │ QmbAA8...HfXdWH │ someSmartOp1 │ ping │ ├─────────────────┼──────────────┼──────────────┤ │ QmbUID...HfXdC0 │ someSmartOp2 │ testlib.ping │ └─────────────────┴──────────────┴──────────────┘
func Query ¶
func Query(smartops *structureSpec.SmartOp)
Example ¶
package main
import (
"time"
"github.com/alecthomas/units"
structureSpec "github.com/taubyte/go-specs/structure"
smartopsTable "github.com/taubyte/tau-cli/table/smartops"
)
func main() {
smartops := &structureSpec.SmartOp{
Id: "QmbAA8hRosp5BaXFXikADCtpkQCgQCPdRVhnxjiSHfXdWH",
Name: "someProject",
Description: "a simple smartops",
Tags: []string{"smartops_tag_1", "smartops_tag_2"},
Timeout: uint64(20 * time.Second),
Memory: uint64(32 * units.GB),
Call: "ping",
Source: ".",
}
smartopsTable.Query(smartops)
}
Output: ┌─────────────┬────────────────────────────────────────────────┐ │ ID │ QmbAA8hRosp5BaXFXikADCtpkQCgQCPdRVhnxjiSHfXdWH │ ├─────────────┼────────────────────────────────────────────────┤ │ Name │ someProject │ ├─────────────┼────────────────────────────────────────────────┤ │ Description │ a simple smartops │ ├─────────────┼────────────────────────────────────────────────┤ │ Tags │ smartops_tag_1, smartops_tag_2 │ ├─────────────┼────────────────────────────────────────────────┤ │ Timeout │ 20s │ ├─────────────┼────────────────────────────────────────────────┤ │ Memory │ 32GB │ ├─────────────┼────────────────────────────────────────────────┤ │ Source │ . │ ├─────────────┼────────────────────────────────────────────────┤ │ Call │ ping │ └─────────────┴────────────────────────────────────────────────┘
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.