finditem

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
const DefaultLimit = 5

DefaultLimit is how many stations Find returns when the caller passes limit <= 0.

View Source
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.

Jump to

Keyboard shortcuts

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