first commit
This commit is contained in:
60
README.md
Normal file
60
README.md
Normal file
@@ -0,0 +1,60 @@
|
||||
# mcstatus
|
||||
|
||||
Small Go library for querying Minecraft Java and Bedrock server status.
|
||||
|
||||
The package is extracted from `DuExpBot/backend/pkg/mcstatus`, but without any app-specific model/database layer.
|
||||
|
||||
## Features
|
||||
|
||||
- Java status ping
|
||||
- Java full query
|
||||
- Bedrock RakNet ping
|
||||
- Bedrock full query
|
||||
- Optional SRV lookup
|
||||
- Simple MOTD cleanup helper
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
go get github.com/VexoraDevelopment/mcstatus
|
||||
```
|
||||
|
||||
## Quick Start
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/VexoraDevelopment/mcstatus"
|
||||
)
|
||||
|
||||
func main() {
|
||||
client := mcstatus.NewAll(3 * time.Second)
|
||||
|
||||
info, err := client.Java.Connect("hypixel.net", 25565)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(info.Edition)
|
||||
fmt.Println(info.Address, info.Port)
|
||||
fmt.Println(info.Version)
|
||||
fmt.Println(info.Online, "/", info.Slots)
|
||||
fmt.Println(info.MOTD)
|
||||
}
|
||||
```
|
||||
|
||||
## Packages
|
||||
|
||||
- `github.com/VexoraDevelopment/mcstatus`
|
||||
- `github.com/VexoraDevelopment/mcstatus/java`
|
||||
- `github.com/VexoraDevelopment/mcstatus/bedrock`
|
||||
- `github.com/VexoraDevelopment/mcstatus/text`
|
||||
|
||||
## Notes
|
||||
|
||||
- No GORM or persistence layer is included.
|
||||
- `ServerInfo` is a plain struct and can be stored however you want.
|
||||
Reference in New Issue
Block a user