Documentation
¶
Overview ¶
Package finditem answers "where can I buy this item?" by composing the market database's sell-side availability with jump distances from the knowledge base's system graph. It is the shared core behind the play_as find_item command and is callable from worker roles and tools.
Index ¶
Constants ¶
const DefaultLimit = 5
DefaultLimit is how many stations Find returns when the caller passes limit <= 0.
const JumpsUnknown = -1
JumpsUnknown marks a result whose distance could not be computed (no knowledge base, or the station's system is absent from the graph).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Result ¶
type Result struct {
market.ItemSeller
Jumps int `json:"jumps"` // JumpsUnknown if not computable
}
Result is one station selling the item, ranked by distance then price.
func Find ¶
func Find(ctx context.Context, col *market.Collector, kb knowledge.Base, itemID string, minQty float64, fromSystem string, limit int) ([]Result, error)
Find returns the stations selling itemID with at least minQty total sell-side depth (0 = no floor), sorted by jump distance from fromSystem, then by price, and truncated to limit (DefaultLimit if <= 0).
kb may be nil: results then carry JumpsUnknown and sort by price alone. Stations in systems unreachable from fromSystem sort last.