Documentation
¶
Index ¶
- func Parse(data []byte, cmd string) any
- func ParseWithGeo(data []byte, cmd string, geoReader *geoip2.Reader) (any, error)
- func ParseWithGeoDB(data []byte, cmd string, geoDB string) (any, error)
- type Admin
- type Admins
- type BanGUID
- type BanIP
- type Bans
- type BansGUID
- type BansIP
- type Messages
- type Player
- type Players
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Parse ¶
Return struct by passed command:
- `players` -> []Player
- `admins` -> []Admin
- `bans` -> []Bans
- others -> []string
func ParseWithGeo ¶ added in v0.2.0
Return struct by passed command like Parse with country from IP fields by geoip2.Reader
Types ¶
type Admin ¶
type Admin struct { IP string `json:"ip"` Country string `json:"country,omitempty"` Port uint16 `json:"port"` ID byte `json:"id"` }
Admin represents a connected RCon admin.
type Admins ¶
type Admins []Admin
Admins represents a []Admin list.
func (*Admins) SetCountryCode ¶
func (a *Admins) SetCountryCode(geoDB *geoip2.Reader)
Set country code from geoDB for admin IP
type BanGUID ¶
type BanGUID struct { GUID string `json:"guid"` Reason string `json:"reason"` ID int `json:"id"` MinutesLeft int `json:"minutes"` Valid bool `json:"valid"` }
BanGUID represents a GUID ban entry.
type BanIP ¶
type BanIP struct { IP string `json:"ip"` Reason string `json:"reason"` Country string `json:"country,omitempty"` ID int `json:"id"` MinutesLeft int `json:"minutes"` Valid bool `json:"valid"` }
BanIP represents an IP ban entry.
type Bans ¶
Bans represents a structure for all types of bans.
func (*Bans) SetCountryCode ¶
func (b *Bans) SetCountryCode(geoDB *geoip2.Reader)
Set country code from geoDB for IP bans in global Bans struct
type BansIP ¶
type BansIP []BanIP
BansIP represents a []BanIP list.
func (*BansIP) SetCountryCode ¶
func (b *BansIP) SetCountryCode(geoDB *geoip2.Reader)
Set country code from geoDB for IP bans
type Player ¶
type Player struct { IP string `json:"ip"` GUID string `json:"guid"` Name string `json:"name"` Country string `json:"country,omitempty"` Port uint16 `json:"port"` Ping uint16 `json:"ping"` ID byte `json:"id"` Valid bool `json:"valid"` Lobby bool `json:"lobby"` }
Player represents a single player.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.