Documentation ¶
Index ¶
Constants ¶
const ( // NoMatches is a sentinel value returned when there are no statistics defined on the //minecraft server NoMatches = `All matches failed` // ScoreboardPlayerList is the command to see all player statistics ScoreboardPlayerList = `scoreboard players list *` )
Variables ¶
This section is empty.
Functions ¶
func ParsePlayerName ¶
ParsePlayerName takes an input string from rcon, to parse the player.
Types ¶
type Client ¶
type Client interface {
Gather(producer RCONClientProducer) ([]string, error)
}
Client is an interface for a client which gathers data from a minecraft server
type Minecraft ¶
type Minecraft struct { Server string Port string Password string // contains filtered or unexported fields }
Minecraft represents a connection to a minecraft server
func (*Minecraft) Description ¶
Description gives a brief description.
func (*Minecraft) Gather ¶
func (s *Minecraft) Gather(acc telegraf.Accumulator) error
Gather uses the RCON protocol to collect player and scoreboard stats from a minecraft server. var hasClient bool = false
func (*Minecraft) SampleConfig ¶
SampleConfig returns our sampleConfig.
type RCON ¶
type RCON struct { Server string Port string Password string // contains filtered or unexported fields }
RCON represents a RCON server connection
type RCONClient ¶
type RCONClient interface { Authorize(password string) (*rcon.Packet, error) Execute(command string) (*rcon.Packet, error) }
RCONClient is a representation of RCON command authorizaiton and exectution
type RCONClientProducer ¶
type RCONClientProducer interface {
// contains filtered or unexported methods
}
RCONClientProducer is an interface which defines how a new client will be produced in the event of a network disconnect. It exists mainly for testing purposes