Documentation ¶
Index ¶
- func IsValidGUID(val string) bool
- type BOQCell
- type BOQDB
- type BOQGeometry
- type BOQStop
- type DiskDB
- type Fort
- type FortType
- type GeoDex
- type Gym
- type MADGymScanner
- type MADPokestopScanner
- type Pokestop
- type SQLDB
- func (sdb *SQLDB) Close()
- func (sdb *SQLDB) GetGymName(GUID string) (name string, err error)
- func (sdb *SQLDB) GetPokestopName(GUID string) (name string, err error)
- func (sdb *SQLDB) GetVersion() (version string, err error)
- func (sdb *SQLDB) NewMADGymScanner() (m *MADGymScanner, err error)
- func (sdb *SQLDB) NewMADPokestopScanner() (m *MADPokestopScanner, err error)
- type TDB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidGUID ¶
IsValidGUID returns true if the value might be a valid fort GUID
Types ¶
type BOQCell ¶
type BOQCell struct {
Stops []*BOQStop `json:"stops"`
}
BOQCell are the values from the outer dict that BookOfQuests returns
type BOQDB ¶
type BOQDB struct {
// contains filtered or unexported fields
}
BOQDB is a read-only wrapper for a Book Of Quests stops JSON.
type BOQGeometry ¶
BOQGeometry always is a Point with Lat/Lon here
type BOQStop ¶
type BOQStop struct { Name string `json:"name"` IsPortal bool `json:"portal"` IsGym bool `json:"gym"` IsStop bool `json:"stop"` Timestamp int64 `json:"ts"` S2Level20 string `json:"s2l20"` Location BOQGeometry `json:"loc"` }
BOQStop has name and location for POIs
type DiskDB ¶
type DiskDB struct {
// contains filtered or unexported fields
}
DiskDB stores fort info like names
type Fort ¶
type Fort struct { GUID *string `json:"guid"` // mandatory Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` Name *string `json:"name,omitempty"` // optional Type FortType `json:"type"` }
Fort is the data structure for our tile38 table
type GeoDex ¶
GeoDex is the wrapper that should be used when using an already initialized DB
type Gym ¶
type Gym struct { GUID *string `db:"gym_id"` Latitude float64 `db:"latitude"` Longitude float64 `db:"longitude"` Name *string `db:"name"` }
Gym matches MAD's gym table joined with gymdetails
type MADGymScanner ¶
type MADGymScanner struct {
// contains filtered or unexported fields
}
MADGymScanner reads gyms from MAD
func (*MADGymScanner) ScanGym ¶
func (m *MADGymScanner) ScanGym() (f Gym, err error)
ScanGym returns the next row as a Pokestop
type MADPokestopScanner ¶
type MADPokestopScanner struct {
// contains filtered or unexported fields
}
MADPokestopScanner reads pokestops from MAD
func (*MADPokestopScanner) Next ¶
func (m *MADPokestopScanner) Next() bool
Next prepares to read the next row
func (*MADPokestopScanner) ScanPokestop ¶
func (m *MADPokestopScanner) ScanPokestop() (f Pokestop, err error)
ScanPokestop returns the next row as a Pokestop
type Pokestop ¶
type Pokestop struct { GUID *string `db:"pokestop_id"` Latitude float64 `db:"latitude"` Longitude float64 `db:"longitude"` Name *string `db:"name"` }
Pokestop matches MAD's pokestop table
type SQLDB ¶
type SQLDB struct {
// contains filtered or unexported fields
}
SQLDB connects to MAD's MariaDB to get pokestops and gyms
func (*SQLDB) GetGymName ¶
GetGymName gets the gym's name from MAD's DB
func (*SQLDB) GetPokestopName ¶
GetPokestopName gets the pokestop's name from MAD's DB
func (*SQLDB) GetVersion ¶
GetVersion gets the mysql server version
func (*SQLDB) NewMADGymScanner ¶
func (sdb *SQLDB) NewMADGymScanner() (m *MADGymScanner, err error)
NewMADGymScanner sets up the scanner
func (*SQLDB) NewMADPokestopScanner ¶
func (sdb *SQLDB) NewMADPokestopScanner() (m *MADPokestopScanner, err error)
NewMADPokestopScanner sets up the scanner
type TDB ¶
type TDB struct {
// contains filtered or unexported fields
}
TDB is the silphtelescope geodex connection
func (*TDB) GetNearestFort ¶
GetNearestFort looks in the given radius (in meters) around the point for the nearest Fort
func (*TDB) InsertFort ¶
InsertFort adds the fort to the db