mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-22 06:45:17 +00:00
Commit from m3o/m3o action
This commit is contained in:
34
examples/minecraft/README.md
Executable file
34
examples/minecraft/README.md
Executable file
@@ -0,0 +1,34 @@
|
||||
# Minecraft
|
||||
|
||||
An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/minecraft/api](https://m3o.com/minecraft/api).
|
||||
|
||||
Endpoints:
|
||||
|
||||
## Ping
|
||||
|
||||
Ping a minecraft server
|
||||
|
||||
|
||||
[https://m3o.com/minecraft/api#Ping](https://m3o.com/minecraft/api#Ping)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"go.m3o.com/minecraft"
|
||||
)
|
||||
|
||||
// Ping a minecraft server
|
||||
func PingAminecraftServer() {
|
||||
minecraftService := minecraft.NewMinecraftService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := minecraftService.Ping(&minecraft.PingRequest{
|
||||
Address: "funcraft.net",
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user