Documentation ¶
Index ¶
- Variables
- func BasicQuery(host string, port uint16, options ...options.Query) (*response.BasicQuery, error)
- func FullQuery(host string, port uint16, options ...options.Query) (*response.FullQuery, error)
- func LookupSRV(host string, port uint16) (*net.SRV, error)
- func ParseAddress(address string, defaultPort uint16) (string, uint16, error)
- func SendVote(host string, port uint16, opts options.Vote) error
- func Status(host string, port uint16, options ...options.JavaStatus) (*response.JavaStatus, error)
- func StatusBedrock(host string, port uint16, options ...options.BedrockStatus) (*response.BedrockStatus, error)
- func StatusLegacy(host string, port uint16, options ...options.JavaStatusLegacy) (*response.JavaStatusLegacy, error)
- func StatusRaw(host string, port uint16, options ...options.JavaStatus) (map[string]interface{}, error)
- type RCONClient
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotConnected means the client attempted to send data but there was no connection to the server ErrNotConnected = errors.New("rcon: not connected to the server") // ErrAlreadyLoggedIn means the RCON client was already logged in but a second login attempt was made ErrAlreadyLoggedIn = errors.New("rcon: already successfully logged in") // ErrInvalidPassword means the password used in the RCON login was incorrect ErrInvalidPassword = errors.New("rcon: incorrect password") // ErrNotAuthenticated means the client attempted to execute a command before a login was successful ErrNotAuthenticated = errors.New("rcon: not authenticated with the server") )
Functions ¶
func BasicQuery ¶
BasicQuery runs a query on the server and returns basic information
func ParseAddress ¶
ParseAddress parses the host and port out of an address string
func Status ¶
func Status(host string, port uint16, options ...options.JavaStatus) (*response.JavaStatus, error)
Status retrieves the status of any 1.7+ Minecraft server
func StatusBedrock ¶
func StatusBedrock(host string, port uint16, options ...options.BedrockStatus) (*response.BedrockStatus, error)
StatusBedrock retrieves the status of a Bedrock Minecraft server
func StatusLegacy ¶
func StatusLegacy(host string, port uint16, options ...options.JavaStatusLegacy) (*response.JavaStatusLegacy, error)
StatusLegacy retrieves the status of any Java Edition Minecraft server, but with reduced properties compared to Status()
Types ¶
type RCONClient ¶
type RCONClient struct { Messages chan string // contains filtered or unexported fields }
RCONClient is a client for interacting with RCON and contains multiple methods
func NewRCON ¶
func NewRCON() *RCONClient
NewRCON creates a new RCON client from the options parameter
func (*RCONClient) Close ¶
func (r *RCONClient) Close() error
Close closes the connection to the server
func (*RCONClient) Login ¶
func (r *RCONClient) Login(password string) error
Login communicates authentication with the server using the plaintext password
func (*RCONClient) Run ¶
func (r *RCONClient) Run(command string) error
Run executes the command on the server but does not wait for a response