SDK v3 #8

Merged
SoXX merged 77 commits from dev/issue-5 into main 2024-08-14 13:27:35 +00:00
Showing only changes of commit 2eeae0e5c7 - Show all commits

View File

@ -33,7 +33,6 @@ package main
import (
"context"
"log"
"git.anthrove.art/Anthrove/otter-space-sdk/v3/pkg/database"
"git.anthrove.art/Anthrove/otter-space-sdk/v3/pkg/models"
@ -41,15 +40,26 @@ import (
func main() {
ctx := context.Background()
cfg := models.DatabaseConfig{}
var err error
pgClient := database.NewPostgresqlConnection()
err := pgClient.Connect(ctx, cfg)
config := models.DatabaseConfig{
Endpoint: "",
Username: "",
Password: "",
Database: "",
Port: 5432,
SSL: false,
Timezone: "Europe/Berlin",
Debug: false,
}
err = database.Connect(ctx, config)
if err != nil {
log.Panic(err)
panic(err)
}
}
```
This example creates a new client, connects to the OtterSpace API, and then the client can be used to interact with the API.