Documentation
¶
Overview ¶
Package minecraft contains utilities for obtaining statistics on minecraft servers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrStatus = errors.New("unexpected status code")
ErrStatus is the error given when an HTTP call to the minecraft status endpoint returns an error status code.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
The Client type is used to obtain statistical information on Minecraft servers. It makes HTTP requests to https://ac.mcsrvstat.us, using their API to get server info.
type MOTD ¶
type MOTD struct { Raw []string `json:"raw"` Clean []string `json:"clean"` HTML []string `json:"html"` }
MOTD contains the "message of the day" data for a Minecraft server.
type ServerStatus ¶
type ServerStatus struct { IP string `json:"ip"` Port int `json:"port"` MOTD MOTD `json:"motd"` Players Players `json:"players"` Version string `json:"version"` Online bool `json:"online"` Protocol int `json:"protocol"` }
ServerStatus represents the JSON response when querying the status of a Minecraft server.
Click to show internal directories.
Click to hide internal directories.