proto

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WireWrite

func WireWrite(resp *bytes.Buffer, w WireEncoder, data interface{}) error

WireWrite writes the provided data to resp with the provided WireEncoder w.

Types

type QueryResponder

type QueryResponder interface {
	Respond(clientAddress string, buf []byte) ([]byte, error)
}

QueryResponder represents an interface to a concrete type which responds to query requests.

type QueryState

type QueryState struct {
	CurrentPlayers int32
	MaxPlayers     int32
	ServerName     string
	GameType       string
	Map            string
	Port           uint16
}

QueryState represents the state of a currently running game.

type WireEncoder

type WireEncoder interface {
	WriteString(resp *bytes.Buffer, s string) error
	Write(resp *bytes.Buffer, v interface{}) error
}

WireEncoder is an interface which allows for different query implementations to write data to a byte buffer in a specific format.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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