Implementation of a client for the Polybase decentralized database in Go programming language.
To get the go-polybase
module, you need to have or install Go version >= 1.19. To check your current version of Go, use the go version
command.
The command to get the module:
go get github.com/durudex/go-polybase@latest
An example where a new instance of a client, collection, record is created, and the result of the record creation is obtained.
import (
"context"
"github.com/durudex/go-polybase"
)
// Describe the model of the collection you want to get.
type Model struct { ... }
func main() {
// Create an instance of the client with the specified configuration.
client := polybase.New(&polybase.Config{
URL: polybase.TestnetURL,
})
// Create an instance of the collection.
coll := polybase.NewCollection[Model](client, "Collection")
// Create an instance of the record with the specified ID.
record := coll.Record("id")
// Get this record from the collection.
response := record.Get(context.Background())
...
}
Note More examples can be found in the examples directory.
Copyright © 2022-2023 Durudex. Released under the MIT license.