Go SDK
Install
Section titled “Install”What the next release does
Section titled “What the next release does”The Go client in development covers your app’s users, table queries, file storage and functions. It uses only the Go standard library, every call takes a context.Context, and it is safe for concurrent use. This page describes that client, so you can plan for it. Until it can be installed, call the REST API from Go.
import vaif "github.com/vaifllc/vaif-go"
client, err := vaif.NewClient("YOUR_PROJECT_ID", "vk_pub_...")if err != nil {log.Fatal(err)}ctx := context.Background()
if _, err := client.Auth.SignIn(ctx, "ada@example.com", "a strong password"); err != nil {log.Fatal(err)}
todos, err := client.From("todos").Eq("done", false).Order("created_at", true).Limit(20).List(ctx)if err != nil {log.Fatal(err)}fmt.Println(todos.Count, todos.Data)- Auth:
SignUp,SignIn,VerifyMFA,GetUser,RequestPasswordReset,ResetPasswordandSignOut. The access token refreshes itself 30 seconds before it expires. - Tables:
From(table)withEq,Neq,Gt,Gte,Lt,Lte,Like,ILikeandIn, thenList,Paginate,Get,First,Insert,InsertMany,Upsert,UpdateandDelete. - Storage:
Upload,Download,CreateSignedURLandCreateSignedUploadURL. - Functions:
Invoke. - Retries:
GET,HEADandOPTIONSrequests are retried on 429 and 5xx responses and on network errors. Writes are never replayed once they may have reached the server.
Use a publishable vk_pub_ key in apps. A secret vk_srv_ key bypasses row rules and belongs on trusted servers only.