Go SDK
Overview
The generated Neurelo Go SDK provides easy access to your Neurelo APIs for Go applications.
Prerequisites
GO binaries are installed on your system and included in your path.
Download your generated SDK from the API pages of your project & move the generated SDK file
neurelo-sdk-go-cmt_<id>.zip
to your project root.Tools for configuring environment variables (e.g. github.com/joho/godotenv) or simply export before starting your dev server (inline).
Installation
Copy the generated sdk
neurelo-sdk-go-cmt_<>.zip
to your projectUnzip the sdk to
project_root/pkg/neurelo_sdk
Add the
pkg
directory to.gitignore
fileAdd
neurelo_sdk
to thego.mod
file by runninggo mod edit -replace=github.com/<username>/neurelo-go-sdk=./pkg/neurelo_sdk
Your
go.mod
file should look like this:
You will also need to add the go workspace file by running this command -
go work init && go work use ./pkg/neurelo_sdk .
(Additionally, you can also add other packages to the go workspace file).
Usage
Make sure to set
NEURELO_API_ENDPOINT
andNEURELO_API_KEY
env variables before using the client or you can set them in the client file.Create a client file, so that it can be used by other files in the project.
API Usage
Use the client in other files to make API calls.
Last updated