types

package
v0.0.0-...-a2ba4d9 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DnsResolver

type DnsResolver interface {
	SRVResolve(host string) (bool, string, uint16) // Resolve an SRV Record and return if found, host and port
}

An DnsResolver represent an object that can resolve SRV record

type Latency

type Latency interface {
	Start()      // Start the latency
	End() uint64 // Stop the latency and calculate it
	// contains filtered or unexported methods
}

An Latency represent an object that can calculate the latency between Start() and End()

type PingResponse

type PingResponse struct {
	Latency     uint           // Latency between you and the server
	PlayerCount PlayerCount    // Players count information of the server
	Protocol    int            // Protocol number of the server
	Favicon     string         // Favicon in base64 of the server
	Motd        string         // Motd of the server without color
	Version     string         // Version of the server
	Sample      []PlayerSample // List of connected players on the server
}

An PingResponse represent the structure returned by the server

type Pinger

type Pinger interface {
	Ping(host string, port uint16) (*PingResponse, error)                                   // Ping a server with a timeout of 3s
	PingWithTimeout(host string, port uint16, timeout time.Duration) (*PingResponse, error) // Ping a server with a custom timeout
}

An Pinger represent an object that can Ping a Minecraft server

type PlayerCount

type PlayerCount struct {
	Online int // Number of connected players on the server
	Max    int // Number of maximum players on the server
}

An PlayerCount represent the player count information of an server

type PlayerSample

type PlayerSample struct {
	UUID string // UUID of the player
	Name string // Name of the player
}

An PlayerSample represent the structure, returned from the server, of a player

Jump to

Keyboard shortcuts

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