smartopsTable

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 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, smartops *structureSpec.SmartOp, prompt string) bool

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.

Jump to

Keyboard shortcuts

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