An unoffical golang sdk for Mindsdb.
Install the golang package from GitHub.
go get github.com/Mr-Destructive/mindsdb_go_sdk
- Create a .env file for storing your credentials to authenticate to the mindsdb server.
email=abc@def.com
password=secret_password
-
Access the credentials from .env file using the helper functions
LoadEnvFromFile
with parameter as the key name in the file. Here we haveemail
andpassword
. -
Use
connectors.Login
method to log in into the server.
package main
import (
"fmt"
"os"
"github.com/mr-destructive/mindsdb_go_sdk/mindsdb"
"github.com/mr-destructive/mindsdb_go_sdk/mindsdb/connectors"
)
func PanicError(err error) {
if err != nil {
panic(err)
}
}
func main() {
// read email and password from the .env file
err := mindsdb.LoadEnvFromFile(".env")
PanicError(err)
email := os.Getenv("email")
password := os.Getenv("password")
// Login in with an email and password
api, err := connectors.Login(email, password)
PanicError(err)
}
-
Tha
api
variable will be used to access the sdk methods. -
Refer the examples for further reference, till all the methods in the sdk are functional and tested properly.
- Also this sdk is refered from the mindsdb-python-sdk for the inspiration and development.
- Mindsdb Docs for creating REST API adapters.