client

package
v0.0.0-...-aa68bd4 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package client is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Addr() string
	Send(Packet) error
	Recv() (*Packet, error)
	Close() error
}

Client handles low level communication with Minecraft servers

func NewClient

func NewClient(address string) (Client, error)

NewClient creates a new client connection

type MockClient

type MockClient struct {
	// contains filtered or unexported fields
}

MockClient is a mock of Client interface

func NewMockClient

func NewMockClient(ctrl *gomock.Controller) *MockClient

NewMockClient creates a new mock instance

func (*MockClient) Addr

func (m *MockClient) Addr() string

Addr mocks base method

func (*MockClient) Close

func (m *MockClient) Close() error

Close mocks base method

func (*MockClient) EXPECT

func (m *MockClient) EXPECT() *MockClientMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockClient) Recv

func (m *MockClient) Recv() (*Packet, error)

Recv mocks base method

func (*MockClient) Send

func (m *MockClient) Send(arg0 Packet) error

Send mocks base method

type MockClientMockRecorder

type MockClientMockRecorder struct {
	// contains filtered or unexported fields
}

MockClientMockRecorder is the mock recorder for MockClient

func (*MockClientMockRecorder) Addr

func (mr *MockClientMockRecorder) Addr() *gomock.Call

Addr indicates an expected call of Addr

func (*MockClientMockRecorder) Close

func (mr *MockClientMockRecorder) Close() *gomock.Call

Close indicates an expected call of Close

func (*MockClientMockRecorder) Recv

func (mr *MockClientMockRecorder) Recv() *gomock.Call

Recv indicates an expected call of Recv

func (*MockClientMockRecorder) Send

func (mr *MockClientMockRecorder) Send(arg0 interface{}) *gomock.Call

Send indicates an expected call of Send

type Packet

type Packet struct {
	ID   VarInt
	Data []byte
}

Packet encapulsates all messages on the wire

func (*Packet) DecodeBinary

func (pkt *Packet) DecodeBinary(reader io.Reader) error

DecodeBinary decodes the packet from the binary format on the wire

func (Packet) EncodeBinary

func (pkt Packet) EncodeBinary(writer io.Writer) error

EncodeBinary encodes the packet in the binary format for the wire

type VarInt

type VarInt int32

VarInt is a 32 bit integer with variable encoding

func (*VarInt) DecodeBinary

func (vint *VarInt) DecodeBinary(reader io.Reader) error

DecodeBinary decodes a VarInt from its binary format

func (VarInt) EncodeBinary

func (vint VarInt) EncodeBinary(writer io.Writer) error

EncodeBinary encodes the VarInt in its binary format

func (VarInt) Length

func (vint VarInt) Length() int

Length represents the encoded length of the integer

type VarString

type VarString string

VarString is a string prefixed with a VarInt

func (*VarString) DecodeBinary

func (vstr *VarString) DecodeBinary(reader io.Reader) error

DecodeBinary decodes a VarString from its binary format

func (VarString) EncodeBinary

func (vstr VarString) EncodeBinary(writer io.Writer) error

EncodeBinary encodes the VarString in its binary format

func (VarString) Length

func (vstr VarString) Length() int

Length represents the encoded length of the string

Jump to

Keyboard shortcuts

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