Documentation ¶
Index ¶
Constants ¶
const (
// DefaultAddr is the default address the RedisQ client queries.
DefaultAddr = "https://redisq.zkillboard.com/listen.php"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attacker ¶
type Attacker struct { CharacterID int `json:"character_id"` CorporationID int `json:"corporation_id"` AllianceID int `json:"alliance_id"` ShipTypeID int `json:"ship_type_id"` WeaponTypeID int `json:"weapon_type_id"` DamageDone int `json:"damage_done"` FinalBlow bool `json:"final_blow"` SecurityStatus float32 `json:"security_status"` }
Attacker in a killmail
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client to listen to ZKillboards RedisQ service for new Killmails recieved from EVE Online.
func NewClient ¶
NewClient takes an option parameter, which may be nil, and configures and returns a new client.
func (*Client) AddChan ¶
func (client *Client) AddChan(reciever RecieverChan)
AddChan adds a channel to the client which will be sent all future Killmails that are recieved.
func (*Client) AddFunc ¶
func (client *Client) AddFunc(reciever RecieverFunc)
AddFunc adds a function to the client which will be called andpassed all future killmails that are recieved.
func (*Client) Listen ¶
func (client *Client) Listen()
Listen starts recieving and distributing killmails to added recievers.
func (*Client) SetErrorChannel ¶
SetErrorChannel accepts a channel of type error to which errors encountered are sent by the client.
type Item ¶
type Item struct { ItemTypeID int `json:"item_type_id"` Flag int `json:"flag"` Singleton int `json:"singleton"` QuantityDropped int `json:"quantity_dropped"` QuantityDestroyed int `json:"quantity_destroyed"` }
Item dropped/destroyed in a killmail
type Killmail ¶
type Killmail struct { ID int `json:"killmail_id"` Hash string `json:"killmail_hash"` SolarSystemID int `json:"solar_system_id"` Timestamp time.Time `json:"killmail_time"` Victim Victim `json:"victim"` Attackers []Attacker `json:"attackers"` Zkb Zkb `json:"zkb"` }
Killmail from a kill
type Options ¶
type Options struct { // Addr of the target RedisQ service. When left empty, defaults to DefaultAddr. Addr string // QueueID to identify the client. Set this to a unique value if you have // multiple services hitting the RedisQ API at the same time. // // NOTE: Save this value somewhere if you don't want to miss killmails! QueueID string }
Options is used to configure the RedisQ Client.
type Payload ¶
type Payload struct { KillID int `json:"killID"` Killmail Killmail `json:"killmail"` Zkb struct { LocationID int `json:"locationID"` Hash string `json:"hash"` TotalValue float32 `json:"totalValue"` Points int `json:"points"` Href string `json:"href"` } }
Payload is the json encoded response containing the killmail that is returned as well as some meta information.
type RecieverChan ¶
type RecieverChan chan Payload
RecieverChan is a channel that may recive a payload containing information pertaining to a killmail.
type RecieverFunc ¶
type RecieverFunc func(Payload)
RecieverFunc is a function that may called and passed a new Payload model as the parameter.
type Victim ¶
type Victim struct { CharacterID int `json:"character_id"` CorporationID int `json:"corporation_id"` AllianceID int `json:"alliance_id"` ShipTypeID int `json:"ship_type_id"` DamageTaken int `json:"damage_taken"` Items []Item `json:"items"` Position struct { X float64 `json:"x"` Y float64 `json:"y"` Z float64 `json:"z"` } `json:"position"` }
Victim in a killmail
type Zkb ¶
type Zkb struct { Hash string `json:"hash"` FittedValue float32 `json:"fittedValue"` TotalValue float32 `json:"totalValue"` Points int `json:"points"` NPC bool `json:"npc"` Solo bool `json:"solo"` AWOX bool `json:"awox"` Href string `json:"href"` }
Zkb is the meta data returned from ZKillboard.