Documentation
¶
Overview ¶
Package parser provides the zKillboard parsing functionality used by the application to retrieve required information.
Index ¶
- type Parser
- func (parser *Parser) FetchCRESTRoot() error
- func (parser *Parser) FetchKills(corporation *models.Corporation) ([]models.ZKillboardEntry, error)
- func (parser *Parser) FetchLosses(corporation *models.Corporation) ([]models.ZKillboardEntry, error)
- func (parser *Parser) SendMessage(corporation *models.Corporation, entry models.ZKillboardEntry, killEntry bool) error
- func (parser *Parser) Start()
- func (parser *Parser) Update(corporation *models.Corporation) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Parser ¶
type Parser struct { Corporations []*models.Corporation // contains filtered or unexported fields }
Parser represents the parser used for retrieving kills from zKillboard and posting them to Slack
func SetupParser ¶
func SetupParser(conf *misc.Configuration, db database.Connection, interval time.Duration) (*Parser, error)
SetupParser sets up a new parser with the given information
func (*Parser) FetchCRESTRoot ¶
FetchCRESTRoot fetches the CREST root endpoint and checks the server version before performing other lookup requests
func (*Parser) FetchKills ¶
func (parser *Parser) FetchKills(corporation *models.Corporation) ([]models.ZKillboardEntry, error)
FetchKills retrieves and parses the latest kills from the zKillboard API
func (*Parser) FetchLosses ¶
func (parser *Parser) FetchLosses(corporation *models.Corporation) ([]models.ZKillboardEntry, error)
FetchLosses retrieves and parses the latest losses from the zKillboard API
func (*Parser) SendMessage ¶
func (parser *Parser) SendMessage(corporation *models.Corporation, entry models.ZKillboardEntry, killEntry bool) error
SendMessage prepares a payload and sends a formatted kill/loss message to the Slack webhook