Documentation ¶
Index ¶
Constants ¶
const ( JavaEdition string = "java" BedrockEdition string = "bedrock" )
const ( // Default ping timeout DefaultTimeout = time.Second * 10 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BedrockPinger ¶
Minecraft server pinger using go-bedrockping
func (*BedrockPinger) IsTimeoutZero ¶
func (p *BedrockPinger) IsTimeoutZero() bool
Checks if the current timeout duration is zero
func (*BedrockPinger) Ping ¶
func (p *BedrockPinger) Ping() (*ServerInfo, error)
Pings the bedrock minecraft server and returns server info. Returns error on failed ping
func (*BedrockPinger) PingWithTimeout ¶
func (p *BedrockPinger) PingWithTimeout() (*ServerInfo, error)
Pings the bedrock minecraft server and returns server info. Returns error on failed ping or timeout
type McPinger ¶
Minecraft server pinger using mc-pinger
func (*McPinger) IsTimeoutZero ¶
Checks if the current timeout duration is zero
func (*McPinger) Ping ¶
func (p *McPinger) Ping() (*ServerInfo, error)
Pings minecraft server and returns info obj. Returns error on failed ping
func (*McPinger) PingWithTimeout ¶
func (p *McPinger) PingWithTimeout() (*ServerInfo, error)
Pings minecraft server and return info obj. Return error on failed ping or timed out context
type Pinger ¶
type Pinger interface { Ping() (*ServerInfo, error) PingWithTimeout() (*ServerInfo, error) IsTimeoutZero() bool }
Interface for pinger implementation
type ServerInfo ¶
type ServerPinger ¶
type ServerPinger struct {
// contains filtered or unexported fields
}
Minecraft server pinger and SDK state manager
func New ¶
func New(host string, port uint16, edition string) (*ServerPinger, error)
Creates a new AgonesPinger with that will ping the minecraft server at the given host and on the given port. Also initializes a connection with the local Agones server on localhost port 9357. Blocks until connection and handshake is made. Timesout and returns an error after 30 seconds
func NewTimed ¶
func NewTimed(host string, port uint16, timeout time.Duration, edition string) (*ServerPinger, error)
Creates a new AgonesPinger with that will ping the minecraft server at the given host and on the given port. Ping will timeout after the give timeout duration. Also initializes a connection with the local Agones server on localhost port 9357. Blocks until connection and handshake is made. Timesout and returns an error after 30 seconds
func (*ServerPinger) HealthPing ¶
func (p *ServerPinger) HealthPing() error
Pings the minecraft server and sends Health() signal to the local Agones server on localhost port 9357 Returns an error if the ping is unsuccessful
func (*ServerPinger) HealthPingWithTimeout ¶
func (p *ServerPinger) HealthPingWithTimeout() error
Pings the minecraft server and sends Health() signal to the local Agones server on localhost port 9357 Returns an error if the ping is unsuccessful or timeouts
func (*ServerPinger) ReadyPing ¶
func (p *ServerPinger) ReadyPing() error
Pings the minecraft server and sends Ready() signal to the local Agones server on localhost port 9357 Returns an error if the ping is unsuccessful
func (*ServerPinger) ReadyPingWithTimeout ¶
func (p *ServerPinger) ReadyPingWithTimeout() error
Pings the minecraft server and sends Ready() signal to the local Agones server on localhost port 9357 Returns an error if the ping is unsuccessful or timeouts
type StartingUpErr ¶
type StartingUpErr struct{}
Custom Error for failed pings due to server startup
func (StartingUpErr) Error ¶
func (e StartingUpErr) Error() string