2025-01-28 13:27:11 +01:00

2024-07-19 10:03:35 +02:00
[](https://sonarqube.dragse.de/dashboard?id=Anthrove---OtterSpace-SDK)
[](https://sonarqube.dragse.de/dashboard?id=Anthrove---OtterSpace-SDK)
[](https://sonarqube.dragse.de/dashboard?id=Anthrove---OtterSpace-SDK)
[](https://sonarqube.dragse.de/dashboard?id=Anthrove---OtterSpace-SDK)
[](https://sonarqube.dragse.de/dashboard?id=Anthrove---OtterSpace-SDK)
[](https://sonarqube.dragse.de/dashboard?id=Anthrove---OtterSpace-SDK)
[](https://sonarqube.dragse.de/dashboard?id=Anthrove---OtterSpace-SDK)
[](https://sonarqube.dragse.de/dashboard?id=Anthrove---OtterSpace-SDK)
[](https://sonarqube.dragse.de/dashboard?id=Anthrove---OtterSpace-SDK)
[](https://sonarqube.dragse.de/dashboard?id=Anthrove---OtterSpace-SDK)
[](https://sonarqube.dragse.de/dashboard?id=Anthrove---OtterSpace-SDK)
# OtterSpace SDK
The OtterSpace SDK is a Go package for interacting with the OtterSpace API. It provides methods for connecting to the API, adding and linking users, posts, and sources, and retrieving information about users and posts.
## Installation
To install the OtterSpace SDK, you can use `go get` :
```shell
2025-01-28 13:27:11 +01:00
go get git.anthrove.art/Anthrove/otter-space-sdk/v6
2024-07-19 10:03:35 +02:00
````
## Usage
Here's a simple usage example:
```go
package main
import (
"context"
2025-01-28 13:27:11 +01:00
"git.anthrove.art/Anthrove/otter-space-sdk/v6/pkg/database"
"git.anthrove.art/Anthrove/otter-space-sdk/v6/pkg/models"
2024-07-19 10:03:35 +02:00
)
func main() {
2024-08-14 15:03:26 +02:00
ctx := context.Background()
var err error
config := models.DatabaseConfig{
Endpoint: "",
Username: "",
Password: "",
Database: "",
Port: 5432,
SSL: false,
Timezone: "Europe/Berlin",
Debug: false,
}
err = database.Connect(ctx, config)
2024-07-19 10:03:35 +02:00
if err != nil {
2024-08-14 15:03:26 +02:00
panic(err)
2024-07-19 10:03:35 +02:00
}
2024-08-14 15:03:26 +02:00
2024-07-19 10:03:35 +02:00
}
2024-08-14 15:03:26 +02:00
2024-07-19 10:03:35 +02:00
```
This example creates a new client, connects to the OtterSpace API, and then the client can be used to interact with the API.