types

package
v0.0.0-...-89ddf38 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package types contains information about responses for encoding and decoding responses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MotdExtra

type MotdExtra struct {
	Bold  bool   `json:"bold"`
	Color string `json:"color"`
	Text  string `json:"text"`
}

type ServerQuery

type ServerQuery struct {
	Status      string             `json:"status"`
	Online      bool               `json:"online"`
	Error       string             `json:"error"`
	Motd        string             `json:"motd"`
	Version     string             `json:"version"`
	GameType    string             `json:"game_type"`
	GameID      string             `json:"game_id"`
	ServerMod   string             `json:"server_mod"`
	Map         string             `json:"map"`
	Players     ServerQueryPlayers `json:"players"`
	Plugins     []string           `json:"plugins"`
	LastOnline  string             `json:"last_online"`
	LastUpdated string             `json:"last_updated"`
	Duration    int64              `json:"duration"`
}

ServerQuery contains all information available from a query request to a server. This is the most specific information you can easily get from a server.

type ServerQueryPlayers

type ServerQueryPlayers struct {
	Max  int      `json:"max"`
	Now  int      `json:"now"`
	List []string `json:"list"`
}

ServerQueryPlayers contains information about the min and max numbers of players online. It also includes a list of players online, unlike a ping request.

type ServerStatus

type ServerStatus struct {
	Status        string              `json:"status"`
	Online        bool                `json:"online"`
	Motd          string              `json:"motd"`
	MotdExtra     interface{}         `json:"motd_extra,omitempty"`
	MotdFormatted string              `json:"motd_formatted,omitempty"`
	Favicon       string              `json:"favicon,omitempty"`
	Error         string              `json:"error"`
	Players       ServerStatusPlayers `json:"players"`
	Server        ServerStatusServer  `json:"server"`
	LastOnline    string              `json:"last_online"`
	LastUpdated   string              `json:"last_updated"`
	Duration      int64               `json:"duration"`
}

ServerStatus contains all information available from a ping request. It also includes fields about the success of a request.

func (ServerStatus) Image

func (s ServerStatus) Image() (image.Image, error)

type ServerStatusPlayers

type ServerStatusPlayers struct {
	Max int `json:"max"`
	Now int `json:"now"`
}

ServerStatusPlayers contains information about the min and max numbers of players As it is a ping request, it does not contain a list of players online.

type ServerStatusServer

type ServerStatusServer struct {
	Name     string `json:"name"`
	Protocol int    `json:"protocol"`
}

ServerStatusServer contains information about the server version. As it is a ping request, it is fairly basic information.

Jump to

Keyboard shortcuts

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