https://github.com/mr-destructive/mindsdb_go_sdk
Unofficial go SDK for MindsDB API
https://github.com/mr-destructive/mindsdb_go_sdk
Last synced: about 1 year ago
JSON representation
Unofficial go SDK for MindsDB API
- Host: GitHub
- URL: https://github.com/mr-destructive/mindsdb_go_sdk
- Owner: Mr-Destructive
- License: mit
- Created: 2023-05-19T15:10:52.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-12T15:40:08.000Z (over 2 years ago)
- Last Synced: 2025-01-29T20:37:19.353Z (over 1 year ago)
- Language: Go
- Homepage: https://pkg.go.dev/github.com/mr-destructive/mindsdb_go_sdk
- Size: 46.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Mindsdb Golang SDK
An unoffical golang sdk for [Mindsdb](https://mindsdb.com/).
### Installation
Install the golang package from GitHub.
```bash
go get github.com/Mr-Destructive/mindsdb_go_sdk
```
### Usage
#### Basic Authentication
- Create a .env file for storing your credentials to authenticate to the mindsdb server.
```env
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 have `email` and `password`.
- Use `connectors.Login` method to log in into the server.
```go
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](https://github.com/Mr-Destructive/mindsdb_go_sdk/tree/main/examples) for further reference, till all the methods in the sdk are functional and tested properly.
### References
- Also this sdk is refered from the [mindsdb-python-sdk](https://github.com/mindsdb/mindsdb_python_sdk) for the inspiration and development.
- [Mindsdb Docs](https://docs.mindsdb.com/what-is-mindsdb) for creating REST API adapters.