parser

package
v0.0.0-...-167cc0b Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2015 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package parser provides the zKillboard parsing functionality used by the application to retrieve required information.

Index

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

func (parser *Parser) FetchCRESTRoot() error

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

func (*Parser) Start

func (parser *Parser) Start()

Start starts the parsing operations and retrieves kills and losses for every tracked corporation regularly

func (*Parser) Update

func (parser *Parser) Update(corporation *models.Corporation) error

Update retrieves the latest kills and losses and posts them to Slack if required

Jump to

Keyboard shortcuts

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