Documentation
¶
Index ¶
Constants ¶
View Source
const ( //rcon packet type values FailurePacket = int32(-1) CommandPacket = int32(2) AuthPacket = int32(3) //tcp constants Protocol = "tcp" PacketRequestSize = 10 //size of headers plus padding bytes, not including Size header per RCon standard PacketHeaderSize = 8 //size of headers not including Size header per RCon standard PacketPaddingSize = 2 //size of padding required after body //default values ResetID = 1 DefaultCap = 100 DefaultTimeout = time.Second * 10 DefaultPort = 61695 )
Variables ¶
View Source
var ( ErrClientNotConnected = errors.New("client not connected. The Connect method must be called before commands can be run") ErrIntOverflow = errors.New("integer overflowed 32 bits") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
Connect(password string) error
Command(cmd string) (string, error)
CommandNoResponse(cmd string) error
Close() error
RequestID() int32
SetRequestID(id int32)
Timeout() time.Duration
Connection() net.Conn
Port() int
Address() string
// contains filtered or unexported methods
}
type Option ¶ added in v0.2.0
type Option func(cn *client)
request option func skeleton
func WithConnection ¶ added in v1.1.1
option to allow for use of custom connections
func WithTimeout ¶ added in v0.2.0
option to allow for custom timeout values
Click to show internal directories.
Click to hide internal directories.