Skip to main content

Go SDK

Complete guide to using Cocobase with Go applications.

Installation

Quick Start

Initialize Cocobase

Basic Operations


Querying Data

Simple Filters

Comparison Operators

String Operations

IN Operator

NULL Checks

Simple OR

Named OR Groups

Sorting and Pagination


Working with Structs

Define Your Types

Create with Structs

Parse Response to Struct


Authentication

Initialize Auth (restore session from storage)

Register

Login

Get Current User

Update User

Logout

Check Authentication

Check Role


Real-time Data

Watch a Collection


Error Handling


Context Support


Best Practices

1. Use Structs for Type Safety

2. Always Handle Errors

3. Use Environment Variables

4. Always Set Limits


Next Steps