Documentation ¶
Index ¶
- func InitDBs()
- type CDB
- type SDB
- func (sdb *SDB) AddServersToDB(hostsgames map[string]string)
- func (sdb *SDB) Close()
- func (sdb *SDB) GetHostsAndGameFromIDAPIQuery(result chan map[string]string, ids []string)
- func (sdb *SDB) GetIDsAPIQuery(result chan *models.DbServerID, hosts []string)
- func (sdb *SDB) GetIDsForServerList(result chan map[string]int64, hosts map[string]string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CDB ¶
type CDB struct {
// contains filtered or unexported fields
}
CDB represents a database containing geolocation information.
var CountryDB *CDB
CountryDB is a package-level variable that contains a country geoelocation database connection. It is initialized once for re-usability when building server lists.
func OpenCountryDB ¶
OpenCountryDB opens the country lookup database for reading. The caller of this function will be responsinble for calling .Close().
type SDB ¶
type SDB struct {
// contains filtered or unexported fields
}
SDB represents a database containing the server ID and game information.
var ServerDB *SDB
ServerDB is a package-level variable that contains a server information database connection. It is initialized once for re-usability when building server lists.
func OpenServerDB ¶
OpenServerDB Opens a database connection to the server database file or if that file does not exists, creates it and then opens a database connection to it.
func (*SDB) AddServersToDB ¶
AddServersToDB inserts a specified host and port with its game name into the server database.
func (*SDB) Close ¶
func (sdb *SDB) Close()
Close closes the server database's underlying connection.
func (*SDB) GetHostsAndGameFromIDAPIQuery ¶
GetHostsAndGameFromIDAPIQuery Retrieves the hosts and game names from the server database file in response to a user-specified API query for a given set of server ID numbers. Sends the results over a channel consisting of a host to game name string mapping.
func (*SDB) GetIDsAPIQuery ¶
func (sdb *SDB) GetIDsAPIQuery(result chan *models.DbServerID, hosts []string)
GetIDsAPIQuery Retrieves the server ID numbers, hosts, and game name for a given set of hosts (represented by query string values) from the server database file in response to a query from the API. Sends the results over a DbServerID channel for consumption.
func (*SDB) GetIDsForServerList ¶
GetIDsForServerList retrieves the server ID numbers for a given set of hosts, from the server database file, in response to a request to build the master server detail list or the list of server details in response to a request coming in over the API. It sends its results over a map channel consisting of a host to id mapping.