Documentation
¶
Overview ¶
Package mcclient is a generated GoMock package.
Index ¶
Constants ¶
const ( // ClientStateUnknown is the default state ClientStateUnknown = 0 // ClientStateStatus is for sending unauthenticated ping and status messages ClientStateStatus = 1 // ClientStateLogin is for authenticating with the client ClientStateLogin = 2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handshake ¶
type Handshake struct {
Version client.VarInt
Address client.VarString
Port uint16
State client.VarInt
}
Handshake represents the opening handshake with the server
func (*Handshake) DecodeBinary ¶
DecodeBinary decodes the handshake from the binary format on the wire
type MinecraftClient ¶
type MinecraftClient interface {
Handshake(ClientState) error
Status() (*StatusResponse, error)
Close() error
}
MinecraftClient represents a client connection to a Minecraft server
func NewMinecraftClient ¶
func NewMinecraftClient(client client.Client) (MinecraftClient, error)
NewMinecraftClient wraps an existing client connection as a MinecraftClient
func NewMinecraftClientFromAddress ¶
func NewMinecraftClientFromAddress(address string) (MinecraftClient, error)
NewMinecraftClientFromAddress creates a new client connection with a Minecraft server
type MockMinecraftClient ¶
type MockMinecraftClient struct {
// contains filtered or unexported fields
}
MockMinecraftClient is a mock of MinecraftClient interface
func NewMockMinecraftClient ¶
func NewMockMinecraftClient(ctrl *gomock.Controller) *MockMinecraftClient
NewMockMinecraftClient creates a new mock instance
func (*MockMinecraftClient) Close ¶
func (m *MockMinecraftClient) Close() error
Close mocks base method
func (*MockMinecraftClient) EXPECT ¶
func (m *MockMinecraftClient) EXPECT() *MockMinecraftClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockMinecraftClient) Handshake ¶
func (m *MockMinecraftClient) Handshake(arg0 ClientState) error
Handshake mocks base method
func (*MockMinecraftClient) Status ¶
func (m *MockMinecraftClient) Status() (*StatusResponse, error)
Status mocks base method
type MockMinecraftClientMockRecorder ¶
type MockMinecraftClientMockRecorder struct {
// contains filtered or unexported fields
}
MockMinecraftClientMockRecorder is the mock recorder for MockMinecraftClient
func (*MockMinecraftClientMockRecorder) Close ¶
func (mr *MockMinecraftClientMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close
func (*MockMinecraftClientMockRecorder) Handshake ¶
func (mr *MockMinecraftClientMockRecorder) Handshake(arg0 interface{}) *gomock.Call
Handshake indicates an expected call of Handshake
func (*MockMinecraftClientMockRecorder) Status ¶
func (mr *MockMinecraftClientMockRecorder) Status() *gomock.Call
Status indicates an expected call of Status
type StatusDescription ¶
type StatusDescription struct {
Text string `json:"text" firestore:"text"`
}
StatusDescription represents the message of the day reported by the server
type StatusPlayers ¶
type StatusPlayers struct {
Max int `json:"max" firestore:"max"`
Online int `json:"online" firestore:"online"`
Users []User `json:"sample" firestore:"users"`
}
StatusPlayers represents the players logged in to the server
type StatusResponse ¶
type StatusResponse struct {
Version StatusVersion `json:"version" firestore:"version"`
Players StatusPlayers `json:"players" firestore:"players"`
Description StatusDescription `json:"description" firestore:"description"`
Favicon string `json:"favicon" firestore:"favicon"`
}
StatusResponse is the response to a status request to the server
type StatusVersion ¶
type StatusVersion struct {
Name string `json:"name" firestore:"name"`
Protocol int `json:"protocol" firestore:"protocol"`
}
StatusVersion represents the server version