serviceTable

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

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Confirm

func Confirm(ctx *cli.Context, service *structureSpec.Service, prompt string) bool

func List

func List(services []*structureSpec.Service)
Example
package main

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

func main() {
	services := []*structureSpec.Service{
		{
			Id:       "QmbAA8hRosp5BaXFXikADCtpkQCgQCPdRVhnxjiSHfXdWH",
			Name:     "someService1",
			Protocol: "/test/v1",
		},
		{
			Id:       "QmbUIDhRosp5BaXDASEWSCtpkQCgQCPdRVhnxjiSHfXdC0",
			Name:     "someService2",
			Protocol: "/test/v2",
		},
	}

	serviceTable.List(services)

}
Output:

┌─────────────────┬──────────────┬──────────┐
│ ID              │ NAME         │ PROTOCOL │
├─────────────────┼──────────────┼──────────┤
│ QmbAA8...HfXdWH │ someService1 │ /test/v1 │
├─────────────────┼──────────────┼──────────┤
│ QmbUID...HfXdC0 │ someService2 │ /test/v2 │
└─────────────────┴──────────────┴──────────┘

func Query

func Query(service *structureSpec.Service)
Example
package main

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

func main() {
	service := &structureSpec.Service{
		Id:          "QmbAA8hRosp5BaXFXikADCtpkQCgQCPdRVhnxjiSHfXdWH",
		Name:        "someProject",
		Description: "this is a service of some type",
		Tags:        []string{"apple", "orange", "banana"},
		Protocol:    "/test/v1",
	}

	serviceTable.Query(service)

}
Output:

┌─────────────┬────────────────────────────────────────────────┐
│ ID          │ QmbAA8hRosp5BaXFXikADCtpkQCgQCPdRVhnxjiSHfXdWH │
├─────────────┼────────────────────────────────────────────────┤
│ Name        │ someProject                                    │
├─────────────┼────────────────────────────────────────────────┤
│ Description │ this is a service of some type                 │
├─────────────┼────────────────────────────────────────────────┤
│ Tags        │ apple, orange, banana                          │
├─────────────┼────────────────────────────────────────────────┤
│ Protocol    │ /test/v1                                       │
└─────────────┴────────────────────────────────────────────────┘

Types

This section is empty.

Jump to

Keyboard shortcuts

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