Documentation
¶
Index ¶
Constants ¶
const (
DefaultPort uint16 = 25575
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client acts as the entrypoint to send RCON messages. Client hold all the configuration necessary to connect to Minecraft server.
func (*Client) Send ¶
Send establishes a new authenticated connection to the Minecraft server and transmits requested command. Not all commands generate a response from the server. Any response from the server is returned to requester. If connection failure occurs an error is returned.
This function is concurrency-safe since each command sent to the Minecraft server creates a new connection. Upon completion of the request the established connection is closed.
type Conn ¶ added in v0.2.0
type Conn struct {
// contains filtered or unexported fields
}
Conn represents a remote RCON connection to a Minecraft server.
The RCON connection allows server administrators to remotely execute commands on Minecraft servers.
func Dial ¶ added in v0.3.0
Dial connects and authenticates to the specified URL.
The underlying transport layer connection is created along with the configured RCON connection.
func NewConn ¶ added in v0.2.0
NewConn wraps transport layer connection with RCON configuration.
RCON authentication is performed as part of connection configuration. Failed authentication closes the transport layer connection.
func (*Conn) Close ¶ added in v0.3.0
Close closes the connection. Any blocked command executions will be unblocked and return errors.
func (*Conn) IsClosed ¶ added in v0.3.0
IsClosed returns whether the RCON connection is closed.
It is possible that an RCON connection becomes closed due to the server hanging up or other connection errors.
func (*Conn) SendCommand ¶ added in v0.2.0
SendCommand sends RCON command to server and returns response.
Commands sent are processed sequentially and the next command cannot execute until the previous completes. All connection errors result in the connection being closed.