2024-06-24 20:29:01 +00:00
![Build Check Runner ](https://git.dragse.it/anthrove/otter-space-sdk/actions/workflows/build_check.yaml/badge.svg )
2024-06-24 20:18:34 +00:00
[![Bugs ](https://sonarqube.dragse.de/api/project_badges/measure?project=Anthrove---OtterSpace-SDK&metric=bugs&token=sqb_96012ffdd64ce721d7f9c82bfa77aa27a5c1fd38 )](https://sonarqube.dragse.de/dashboard?id=Anthrove---OtterSpace-SDK)
[![Code Smells ](https://sonarqube.dragse.de/api/project_badges/measure?project=Anthrove---OtterSpace-SDK&metric=code_smells&token=sqb_96012ffdd64ce721d7f9c82bfa77aa27a5c1fd38 )](https://sonarqube.dragse.de/dashboard?id=Anthrove---OtterSpace-SDK)
[![Coverage ](https://sonarqube.dragse.de/api/project_badges/measure?project=Anthrove---OtterSpace-SDK&metric=coverage&token=sqb_96012ffdd64ce721d7f9c82bfa77aa27a5c1fd38 )](https://sonarqube.dragse.de/dashboard?id=Anthrove---OtterSpace-SDK)
2024-06-24 20:30:57 +00:00
2024-06-24 20:18:34 +00:00
[![Duplicated Lines (%) ](https://sonarqube.dragse.de/api/project_badges/measure?project=Anthrove---OtterSpace-SDK&metric=duplicated_lines_density&token=sqb_96012ffdd64ce721d7f9c82bfa77aa27a5c1fd38 )](https://sonarqube.dragse.de/dashboard?id=Anthrove---OtterSpace-SDK)
[![Lines of Code ](https://sonarqube.dragse.de/api/project_badges/measure?project=Anthrove---OtterSpace-SDK&metric=ncloc&token=sqb_96012ffdd64ce721d7f9c82bfa77aa27a5c1fd38 )](https://sonarqube.dragse.de/dashboard?id=Anthrove---OtterSpace-SDK)
[![Maintainability Rating ](https://sonarqube.dragse.de/api/project_badges/measure?project=Anthrove---OtterSpace-SDK&metric=sqale_rating&token=sqb_96012ffdd64ce721d7f9c82bfa77aa27a5c1fd38 )](https://sonarqube.dragse.de/dashboard?id=Anthrove---OtterSpace-SDK)
[![Quality Gate Status ](https://sonarqube.dragse.de/api/project_badges/measure?project=Anthrove---OtterSpace-SDK&metric=alert_status&token=sqb_96012ffdd64ce721d7f9c82bfa77aa27a5c1fd38 )](https://sonarqube.dragse.de/dashboard?id=Anthrove---OtterSpace-SDK)
2024-06-24 20:30:57 +00:00
2024-06-24 20:18:34 +00:00
[![Reliability Rating ](https://sonarqube.dragse.de/api/project_badges/measure?project=Anthrove---OtterSpace-SDK&metric=reliability_rating&token=sqb_96012ffdd64ce721d7f9c82bfa77aa27a5c1fd38 )](https://sonarqube.dragse.de/dashboard?id=Anthrove---OtterSpace-SDK)
[![Security Hotspots ](https://sonarqube.dragse.de/api/project_badges/measure?project=Anthrove---OtterSpace-SDK&metric=security_hotspots&token=sqb_96012ffdd64ce721d7f9c82bfa77aa27a5c1fd38 )](https://sonarqube.dragse.de/dashboard?id=Anthrove---OtterSpace-SDK)
[![Security Rating ](https://sonarqube.dragse.de/api/project_badges/measure?project=Anthrove---OtterSpace-SDK&metric=security_rating&token=sqb_96012ffdd64ce721d7f9c82bfa77aa27a5c1fd38 )](https://sonarqube.dragse.de/dashboard?id=Anthrove---OtterSpace-SDK)
[![Vulnerabilities ](https://sonarqube.dragse.de/api/project_badges/measure?project=Anthrove---OtterSpace-SDK&metric=vulnerabilities&token=sqb_96012ffdd64ce721d7f9c82bfa77aa27a5c1fd38 )](https://sonarqube.dragse.de/dashboard?id=Anthrove---OtterSpace-SDK)
2024-06-24 20:30:05 +00:00
# OtterSpace SDK
2024-02-17 15:42:38 +00:00
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
go get git.dragse.it/anthrove/otter-space-sdk
````
## Usage
Here's a simple usage example:
```go
package main
import (
2024-06-03 17:31:25 +00:00
"context"
"fmt"
"git.dragse.it/anthrove/otter-space-sdk/pkg/database"
2024-06-24 20:18:34 +00:00
"git.dragse.it/anthrove/otter-space-sdk/pkg/models"
2024-02-17 15:42:38 +00:00
)
func main() {
2024-06-14 13:43:40 +00:00
var err error
dbDebug := false
ctx := context.Background()
2024-06-24 20:18:34 +00:00
2024-06-14 13:43:40 +00:00
pgClient := database.NewPostgresqlConnection(dbDebug)
err = pgClient.Connect(ctx, "your-endpoint", "your-username", "your-password", "anthrove", 5432, "disable", "Europe/Berlin")
if err != nil {
fmt.Println(err)
return
}
2024-06-03 17:31:25 +00:00
// further usage of the client...
2024-02-17 15:42:38 +00:00
}
```
This example creates a new client, connects to the OtterSpace API, and then the client can be used to interact with the API.