messagingTable

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, messaging *structureSpec.Messaging, prompt string) bool

func List

func List(channels []*structureSpec.Messaging)
Example
package main

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

func main() {
	channels := []*structureSpec.Messaging{
		{
			Id:    "QmbAA8hRosp5BaXFXikADCtpkQCgQCPdRVhnxjiSHfXdWH",
			Name:  "someMessaging1",
			Match: "/test/v1",
		},
		{
			Id:    "QmbUIDhRosp5BaXDASEWSCtpkQCgQCPdRVhnxjiSHfXdC0",
			Name:  "someMessaging2",
			Match: "/test/v2",
		},
	}

	messagingTable.List(channels)

}
Output:

┌─────────────────┬────────────────┬──────────┐
│ ID              │ NAME           │ MATCH    │
├─────────────────┼────────────────┼──────────┤
│ QmbAA8...HfXdWH │ someMessaging1 │ /test/v1 │
├─────────────────┼────────────────┼──────────┤
│ QmbUID...HfXdC0 │ someMessaging2 │ /test/v2 │
└─────────────────┴────────────────┴──────────┘

func Query

func Query(messaging *structureSpec.Messaging)
Example
package main

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

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

	messagingTable.Query(messaging)

}
Output:

┌───────────────┬────────────────────────────────────────────────┐
│ ID            │ QmbAA8hRosp5BaXFXikADCtpkQCgQCPdRVhnxjiSHfXdWH │
├───────────────┼────────────────────────────────────────────────┤
│ Name          │ someProject                                    │
├───────────────┼────────────────────────────────────────────────┤
│ Description   │ this is a messaging of some type               │
├───────────────┼────────────────────────────────────────────────┤
│ Tags          │ apple, orange, banana                          │
├───────────────┼────────────────────────────────────────────────┤
│ Local         │ false                                          │
├───────────────┼────────────────────────────────────────────────┤
│ Channel       │                                                │
├───────────────┼────────────────────────────────────────────────┤
│  -  Match     │ /test/v1                                       │
├───────────────┼────────────────────────────────────────────────┤
│  -  Use Regex │ false                                          │
├───────────────┼────────────────────────────────────────────────┤
│ Bridges       │                                                │
├───────────────┼────────────────────────────────────────────────┤
│  -  MQTT      │ true                                           │
├───────────────┼────────────────────────────────────────────────┤
│  -  WebSocket │ false                                          │
└───────────────┴────────────────────────────────────────────────┘

Types

This section is empty.

Jump to

Keyboard shortcuts

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