From d7cf03fdbdbda4b11326013f9e10e64dada8fa39 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Mon, 5 Jan 2026 11:49:15 +0100 Subject: [PATCH] Add killmail type from json --- types.go | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 types.go diff --git a/types.go b/types.go new file mode 100644 index 0000000..554536c --- /dev/null +++ b/types.go @@ -0,0 +1,48 @@ +package main + +import "time" + +type Killmail struct { + Attackers []Attacker `json:"attackers"` + KillmailID int64 `json:"killmail_id"` + KillmailTime time.Time `json:"killmail_time"` + SolarSystemID int64 `json:"solar_system_id"` + Victim Victim `json:"victim"` + KillmailHash string `json:"killmail_hash"` + HTTPLastModified time.Time `json:"http_last_modified"` +} + +type Attacker struct { + AllianceID int64 `json:"alliance_id"` + CharacterID int64 `json:"character_id"` + CorporationID int64 `json:"corporation_id"` + DamageDone int64 `json:"damage_done"` + FinalBlow bool `json:"final_blow"` + SecurityStatus float64 `json:"security_status"` + ShipTypeID int64 `json:"ship_type_id"` + WeaponTypeID int64 `json:"weapon_type_id"` +} + +type Victim struct { + AllianceID int64 `json:"alliance_id"` + CharacterID int64 `json:"character_id"` + CorporationID int64 `json:"corporation_id"` + DamageTaken int64 `json:"damage_taken"` + Items []Item `json:"items"` + Position Position `json:"position"` + ShipTypeID int64 `json:"ship_type_id"` +} + +type Item struct { + Flag int64 `json:"flag"` + ItemTypeID int64 `json:"item_type_id"` + QuantityDestroyed *int64 `json:"quantity_destroyed,omitempty"` + Singleton int64 `json:"singleton"` + QuantityDropped *int64 `json:"quantity_dropped,omitempty"` +} + +type Position struct { + X float64 `json:"x"` + Y float64 `json:"y"` + Z float64 `json:"z"` +}