gorcon

package module
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2023 License: MIT Imports: 4 Imported by: 0

README

gorcon

RCON client implementation in Go

Documentation

Index

Constants

View Source
const (
	PacketLogin    PacketType = 3
	PacketCommand  PacketType = 2
	PacketResponse PacketType = 0

	RequestIDStart    int32 = 6516583
	PacketChunkLength int   = 4096
)

Variables

View Source
var (
	MCEndian        binary.ByteOrder = binary.LittleEndian
	InvalidPassword error            = errors.New("invalid RCON password")
)

Functions

This section is empty.

Types

type Packet

type Packet struct {
	RequestID int32
	Type      PacketType
	Data      string
}

type PacketType

type PacketType int32

type RCONClient

type RCONClient struct {
	Address    string
	RequestID  int32
	Connection net.Conn
}

func NewRCONClient

func NewRCONClient(host string, port uint16) *RCONClient

func (*RCONClient) Close

func (client *RCONClient) Close() error

func (*RCONClient) Login

func (client *RCONClient) Login(password string) error

func (*RCONClient) RecvPacket

func (client *RCONClient) RecvPacket() (*Packet, error)

func (*RCONClient) SendCommand

func (client *RCONClient) SendCommand(command string) (string, error)

func (*RCONClient) SendPacket

func (client *RCONClient) SendPacket(packet Packet) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL