mindsdb_go_sdk

command module
v0.0.0-...-c0c544a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2024 License: MIT Imports: 5 Imported by: 0

README

Mindsdb Golang SDK

An unoffical golang sdk for Mindsdb.

Installation

Install the golang package from GitHub.

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.
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.

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.

References

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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