Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func List ¶
func List(databases []*structureSpec.Database)
Example ¶
package main
import (
structureSpec "github.com/taubyte/go-specs/structure"
databaseTable "github.com/taubyte/tau-cli/table/database"
)
func main() {
databases := []*structureSpec.Database{
{
Id: "QmbAA8hRosp5BaXFXikADCtpkQCgQCPdRVhnxjiSHfXdWH",
Name: "someDatabase1",
Match: "/test/v1",
},
{
Id: "QmbUIDhRosp5BaXDASEWSCtpkQCgQCPdRVhnxjiSHfXdC0",
Name: "someDatabase2",
Match: "/test/v2",
},
}
databaseTable.List(databases)
}
Output: ┌─────────────────┬───────────────┬──────────┐ │ ID │ NAME │ MATCH │ ├─────────────────┼───────────────┼──────────┤ │ QmbAA8...HfXdWH │ someDatabase1 │ /test/v1 │ ├─────────────────┼───────────────┼──────────┤ │ QmbUID...HfXdC0 │ someDatabase2 │ /test/v2 │ └─────────────────┴───────────────┴──────────┘
func Query ¶
func Query(database *structureSpec.Database)
Example (Key) ¶
package main
import (
"github.com/alecthomas/units"
structureSpec "github.com/taubyte/go-specs/structure"
databaseTable "github.com/taubyte/tau-cli/table/database"
)
func main() {
database := &structureSpec.Database{
Id: "QmbAA8hRosp5BaXFXikADCtpkQCgQCPdRVhnxjiSHfXdWH",
Name: "someProject",
Description: "this is a database of some type",
Tags: []string{"apple", "orange", "banana"},
Match: "/test/v1",
Regex: false,
Local: false,
Key: "someKey",
Min: 15,
Max: 30,
Size: uint64(units.MB),
}
databaseTable.Query(database)
}
Output: ┌─────────────┬────────────────────────────────────────────────┐ │ ID │ QmbAA8hRosp5BaXFXikADCtpkQCgQCPdRVhnxjiSHfXdWH │ ├─────────────┼────────────────────────────────────────────────┤ │ Name │ someProject │ ├─────────────┼────────────────────────────────────────────────┤ │ Description │ this is a database of some type │ ├─────────────┼────────────────────────────────────────────────┤ │ Tags │ apple, orange, banana │ ├─────────────┼────────────────────────────────────────────────┤ │ Encryption │ true │ ├─────────────┼────────────────────────────────────────────────┤ │ Access │ │ ├─────────────┼────────────────────────────────────────────────┤ │ - Network │ all │ ├─────────────┼────────────────────────────────────────────────┤ │ Replicas │ │ ├─────────────┼────────────────────────────────────────────────┤ │ - Min │ 15 │ ├─────────────┼────────────────────────────────────────────────┤ │ - Max │ 30 │ ├─────────────┼────────────────────────────────────────────────┤ │ Storage │ │ ├─────────────┼────────────────────────────────────────────────┤ │ - Size │ 1MB │ └─────────────┴────────────────────────────────────────────────┘
Example (No_key) ¶
package main
import (
"github.com/alecthomas/units"
structureSpec "github.com/taubyte/go-specs/structure"
databaseTable "github.com/taubyte/tau-cli/table/database"
)
func main() {
database := &structureSpec.Database{
Id: "QmbAA8hRosp5BaXFXikADCtpkQCgQCPdRVhnxjiSHfXdWH",
Name: "someProject",
Description: "this is a database of some type",
Tags: []string{"apple", "orange", "banana"},
Match: "/test/v1",
Regex: false,
Local: false,
Min: 15,
Max: 30,
Size: uint64(units.MB),
}
databaseTable.Query(database)
}
Output: ┌─────────────┬────────────────────────────────────────────────┐ │ ID │ QmbAA8hRosp5BaXFXikADCtpkQCgQCPdRVhnxjiSHfXdWH │ ├─────────────┼────────────────────────────────────────────────┤ │ Name │ someProject │ ├─────────────┼────────────────────────────────────────────────┤ │ Description │ this is a database of some type │ ├─────────────┼────────────────────────────────────────────────┤ │ Tags │ apple, orange, banana │ ├─────────────┼────────────────────────────────────────────────┤ │ Encryption │ false │ ├─────────────┼────────────────────────────────────────────────┤ │ Access │ │ ├─────────────┼────────────────────────────────────────────────┤ │ - Network │ all │ ├─────────────┼────────────────────────────────────────────────┤ │ Replicas │ │ ├─────────────┼────────────────────────────────────────────────┤ │ - Min │ 15 │ ├─────────────┼────────────────────────────────────────────────┤ │ - Max │ 30 │ ├─────────────┼────────────────────────────────────────────────┤ │ Storage │ │ ├─────────────┼────────────────────────────────────────────────┤ │ - Size │ 1MB │ └─────────────┴────────────────────────────────────────────────┘
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.