Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/idebeijer/satisfactory-client-go
🚧 WIP A Golang client for the Satisfactory dedicated server HTTP API.
https://github.com/idebeijer/satisfactory-client-go
client-go golang satisfactory satisfactory-api satisfactory-community
Last synced: about 1 month ago
JSON representation
🚧 WIP A Golang client for the Satisfactory dedicated server HTTP API.
- Host: GitHub
- URL: https://github.com/idebeijer/satisfactory-client-go
- Owner: idebeijer
- License: mit
- Created: 2024-10-04T12:57:37.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-10-12T18:10:32.000Z (3 months ago)
- Last Synced: 2024-10-25T03:55:50.029Z (3 months ago)
- Topics: client-go, golang, satisfactory, satisfactory-api, satisfactory-community
- Language: Go
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Satisfactory Client Go
This Go client library provides an interface to interact with the Satisfactory dedicated server HTTP API.
## Installation
To install the library, use go get:
```bash
go get github.com/idebeijer/satisfactory-client-go/satisfactory
```## Usage
Create the client and login with the password. The password is the same as the one you use to login to the server.
```go
package mainimport (
"context"
"fmt"
"os""github.com/idebeijer/satisfactory-client-go/satisfactory"
)func main() {
ctx := context.Background()
client := satisfactory.NewClient("https://localhost:7777", nil, true)password := os.Getenv("SF_PASSWD") // Replace with your password
if _, err := client.PasswordLogin(ctx, "Administrator", password); err != nil {
fmt.Println(err)
return
}
}
```## Examples
### Run a health check
```go
package mainimport (
"context"
"fmt""github.com/idebeijer/satisfactory-client-go/satisfactory"
)func main() {
ctx := context.Background()
client := satisfactory.NewClient("https://localhost:7777", nil, true)healthcheck, _, err := client.HealthCheck(ctx, "Custom data from client")
if err != nil {
return
}
if healthcheck.Health != "healthy" {
fmt.Println("Healthcheck failed")
return
}
}
```