killtype

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package killtype is the kill-list type registry.

A "type" is one of the named subsets the site slices killmails by — highsec, titans, solo, 10b and so on. Two things consume it and they must never disagree: the SQL predicates that select a subset for a page, and the classifier that bumps the kills_daily_count rollup as each killmail arrives. If they drift, the count in the navigation stops matching the list behind it.

The subsets are deliberately not mutually exclusive. A seven-billion ISK solo titan loss in nullsec belongs to `latest`, `nullsec`, `solo`, `big`, `5b` and `titans` at once, and each of those counts it.

Index

Constants

View Source
const (
	BigISK   = 1_000_000_000
	FiveBISK = 5_000_000_000
	TenBISK  = 10_000_000_000
)

ISK thresholds. Non-exclusive: a 7b kill is both `big` and `5b`.

View Source
const (
	WSpaceRegionMin  = 11_000_001
	WSpaceRegionMax  = 11_000_033
	AbyssalRegionMin = 12_000_001
	AbyssalRegionMax = 12_000_005
	PochvenRegionID  = 10_000_070

	// NullsecMaxRegionID is the w-space floor: nullsec is security <= 0 in any
	// region below it, which excludes wormholes and abyssal pockets that also
	// have non-positive security.
	NullsecMaxRegionID = 11_000_000
)

Region ranges. Wormhole and abyssal space occupy contiguous blocks of region ids, which is why they are ranges rather than lists.

View Source
const (
	CategoryIDCitadel = 65
	MetaT2            = 2
	MetaFaction       = 4
	MetaT3Strategic   = 14
)

SDE-derived constants used by the meta-group subsets.

Variables

View Source
var JoveRegionIDs = []int32{10_000_004, 10_000_017, 10_000_019}

JoveRegionIDs are the unreachable Jove regions.

View Source
var ShipGroups = map[string][]int32{
	"frigates":       {25, 324, 830, 831, 834, 893, 1283, 1527},
	"destroyers":     {420, 1305, 1534},
	"cruisers":       {26, 358, 832, 833, 906, 894, 963, 1972},
	"battlecruisers": {419, 1201, 540},
	"battleships":    {27, 898, 900},
	"capitals":       {547, 485, 1538, 883, 659, 30, 4594},
	"freighters":     {513, 902},
	"supercarriers":  {659},
	"titans":         {30},
}

ShipGroups are the victim ship group ids per hull class, taken from the SDE and stable across patches.

View Source
var Types = []string{
	"latest",
	"highsec", "lowsec", "nullsec", "wspace", "abyssal", "pochven", "jove",
	"solo", "npc",
	"big", "5b", "10b",
	"frigates", "destroyers", "cruisers", "battlecruisers", "battleships",
	"capitals", "freighters", "supercarriers", "titans",
	"citadels", "t1", "t2", "t3", "faction",
}

Types is every kill-list type, in display order.

Functions

func Classify

func Classify(s Subject) []string

Classify returns every subset a killmail belongs to.

This must agree exactly with Predicates: the counts it produces are what the navigation shows, and the predicates are what the list behind that number selects. A kill counted here but not selected there is a page that says 41 and shows 40.

func Predicates

func Predicates() map[string]string

Predicates returns the SQL WHERE fragment for each type, written against the `k` alias of the killmails table.

These are fragments rather than parameterised queries because they are composed into an INSERT ... SELECT that groups over a date range; every value in them is a compile-time constant from this file, never input.

`latest` is "TRUE" on purpose so the same INSERT ... SELECT shape works for it without a special case.

func RegionBucket

func RegionBucket(regionID int32) string

RegionBucket classifies a kill by the kind of space its region is.

Checked before the wormhole range because Pochven and the Jove regions sit outside it but are likewise not ordinary nullsec.

func SecurityBucket

func SecurityBucket(security float64, hasSecurity bool, regionID int32) string

SecurityBucket classifies a kill by the security of the system it happened in, mirroring the highsec/lowsec/nullsec predicates exactly.

Returns "" for kills that belong to none of them — wormhole, abyssal, Pochven and Jove space are region-based and handled by RegionBucket instead.

func ShipClass

func ShipClass(groupID int32) []string

ShipClass returns the hull class subset a victim ship group belongs to, or "" when it belongs to none.

A group can appear in more than one class — 30 (titans) and 659 (supercarriers) are both also capitals — so this reports the most specific one and Classify records the rest.

Types

type Subject

type Subject struct {
	Security    float64
	HasSecurity bool
	RegionID    int32

	IsSolo bool
	IsNPC  bool

	TotalValue    float64
	HasTotalValue bool

	VictimShipGroupID int32

	// GroupCategoryID is the SDE category of the victim's hull group. Only
	// CategoryIDCitadel is interesting, but the caller has it for free from the
	// same lookup that produced the group.
	GroupCategoryID int32

	// MetaGroupID is the victim hull's meta group. Zero and one both mean T1 —
	// the SDE leaves it null for ordinary hulls.
	MetaGroupID    int32
	HasVictimShip  bool
	HasVictimGroup bool
}

Subject is the part of a killmail that decides which subsets it belongs to.

Assembled by the caller rather than read from the killmail row, because the two things it needs beyond the row — the system's security and the victim hull's meta group — live in the SDE cache, and the classifier must not reach for a database.

Jump to

Keyboard shortcuts

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