Documentation
¶
Index ¶
- Constants
- func GetAmmos(webapp *web.Web, api *Api) *registry.Endpoint
- func GetBases(webapp *web.Web, api *Api) *registry.Endpoint
- func GetCMs(webapp *web.Web, api *Api) *registry.Endpoint
- func GetCommodities(webapp *web.Web, api *Api) *registry.Endpoint
- func GetEngines(webapp *web.Web, api *Api) *registry.Endpoint
- func GetFactions(webapp *web.Web, api *Api) *registry.Endpoint
- func GetGuns(webapp *web.Web, api *Api) *registry.Endpoint
- func GetHashes(webapp *web.Web, api *Api) *registry.Endpoint
- func GetInfocards(webapp *web.Web, app_data *appdata.AppData, api *Api) *registry.Endpoint
- func GetItemsT[T Nicknamable](webapp *web.Web, items []T, filter func(items []T) []T) func(w http.ResponseWriter, r *http.Request)
- func GetMines(webapp *web.Web, api *Api) *registry.Endpoint
- func GetMissiles(webapp *web.Web, api *Api) *registry.Endpoint
- func GetOreFields(webapp *web.Web, api *Api) *registry.Endpoint
- func GetPoBBases(webapp *web.Web, api *Api) *registry.Endpoint
- func GetPoBs(webapp *web.Web, api *Api) *registry.Endpoint
- func GetPobGoods(webapp *web.Web, api *Api) *registry.Endpoint
- func GetScanners(webapp *web.Web, api *Api) *registry.Endpoint
- func GetShields(webapp *web.Web, api *Api) *registry.Endpoint
- func GetShips(webapp *web.Web, api *Api) *registry.Endpoint
- func GetThrusters(webapp *web.Web, api *Api) *registry.Endpoint
- func GetTractors(webapp *web.Web, api *Api) *registry.Endpoint
- func GunHandler(webapp *web.Web, api *Api, guns []configs_export.Gun) func(w http.ResponseWriter, r *http.Request)
- func JsonResponseHeader(w *http.ResponseWriter)
- func PostAmmoMarketGoods(webapp *web.Web, api *Api) *registry.Endpoint
- func PostAmmoTechcompatibilities(webapp *web.Web, api *Api) *registry.Endpoint
- func PostBaseMarketGoods(webapp *web.Web, api *Api) *registry.Endpoint
- func PostCMsMarketGoods(webapp *web.Web, api *Api) *registry.Endpoint
- func PostCMsTechcompatibilities(webapp *web.Web, api *Api) *registry.Endpoint
- func PostCommodityMarketGoods(webapp *web.Web, api *Api) *registry.Endpoint
- func PostEnginesMarketGoods(webapp *web.Web, api *Api) *registry.Endpoint
- func PostEnginesTechcompatibilities(webapp *web.Web, api *Api) *registry.Endpoint
- func PostGraphPaths(webapp *web.Web, api *Api) *registry.Endpoint
- func PostGunsMarketGoods(webapp *web.Web, api *Api) *registry.Endpoint
- func PostGunsTechcompatibilities(webapp *web.Web, api *Api) *registry.Endpoint
- func PostItemsMarketGoodsT[T Marketable](webapp *web.Web, items []T) func(w http.ResponseWriter, r *http.Request)
- func PostItemsTechCompatT[T TechCompatable](webapp *web.Web, items []T) func(w http.ResponseWriter, r *http.Request)
- func PostMinesMarketGoods(webapp *web.Web, api *Api) *registry.Endpoint
- func PostMinesTechcompatibilities(webapp *web.Web, api *Api) *registry.Endpoint
- func PostMissilesMarketGoods(webapp *web.Web, api *Api) *registry.Endpoint
- func PostMissilesTechcompatibilities(webapp *web.Web, api *Api) *registry.Endpoint
- func PostScannersMarketGoods(webapp *web.Web, api *Api) *registry.Endpoint
- func PostScannersTechcompatibilities(webapp *web.Web, api *Api) *registry.Endpoint
- func PostShieldsMarketGoods(webapp *web.Web, api *Api) *registry.Endpoint
- func PostShieldsTechcompatibilities(webapp *web.Web, api *Api) *registry.Endpoint
- func PostShipMarketGoods(webapp *web.Web, api *Api) *registry.Endpoint
- func PostShipTechcompatibilities(webapp *web.Web, api *Api) *registry.Endpoint
- func PostThrustersMarketGoods(webapp *web.Web, api *Api) *registry.Endpoint
- func PostThrustersTechcompatibilities(webapp *web.Web, api *Api) *registry.Endpoint
- func PostTractorMarketGoods(webapp *web.Web, api *Api) *registry.Endpoint
- func RegisterApiRoutes(w *web.Web, app_data *appdata.AppData) *web.Web
- func ReturnJson(w *http.ResponseWriter, data any)
- type Ammo
- type Api
- type Base
- type Commodity
- type CounterMeasure
- type Engine
- type Gun
- type Hash
- type Hashes
- type InfocardResp
- type MarketGoodResp
- type Marketable
- type Mine
- type Nicknamable
- type Scanner
- type Shield
- type Ship
- type TechCompatResp
- type TechCompatable
- type Thruster
- type Tractor
Constants ¶
const ApiRoute = "/api"
Variables ¶
This section is empty.
Functions ¶
func GetAmmos ¶
ShowAccount godoc @Summary Getting list of Ammos @Tags equipment @Accept json @Produce json @Success 200 {array} darkapi.Ammo @Router /api/ammos [get] @Param filter_to_useful query string false "insert 'true' if wish to filter items only to useful, usually they are sold, or have goods, or craftable or findable in loot, or bases that are flight reachable from manhattan" @Param include_market_goods query string false "insert 'true' if wish to include market goods under 'market goods' key or not. Such data can add a lot of extra weight" @Param include_tech_compat query string false "insert 'true' if wish to include tech compat info too for the item. Such data can add a lot of extra weight"
func GetBases ¶
ShowAccount godoc @Summary Getting list of NPC Bases @Tags bases @Accept json @Produce json @Success 200 {array} darkapi.Base @Router /api/npc_bases [get] @Param filter_to_useful query string false "insert 'true' if wish to filter items only to useful, usually they are sold, or have goods, or craftable or findable in loot, or bases that are flight reachable from manhattan" @Param include_market_goods query string false "insert 'true' if wish to include market goods under 'market goods' key or not. Such data can add a lot of extra weight"
func GetCMs ¶
ShowAccount godoc @Summary Getting list of CounterMeasure @Tags equipment @Accept json @Produce json @Success 200 {array} darkapi.CounterMeasure @Router /api/counter_measures [get] @Param filter_to_useful query string false "insert 'true' if wish to filter items only to useful, usually they are sold, or have goods, or craftable or findable in loot, or bases that are flight reachable from manhattan" @Param include_market_goods query string false "insert 'true' if wish to include market goods under 'market goods' key or not. Such data can add a lot of extra weight" @Param include_tech_compat query string false "insert 'true' if wish to include tech compat info too for the item. Such data can add a lot of extra weight"
func GetCommodities ¶
ShowAccount godoc @Summary Getting list of Commodities @Tags equipment @Accept json @Produce json @Success 200 {array} darkapi.Commodity @Router /api/commodities [get] @Param filter_to_useful query string false "insert 'true' if wish to filter items only to useful, usually they are sold, or have goods, or craftable or findable in loot, or bases that are flight reachable from manhattan" @Param include_market_goods query string false "insert 'true' if wish to include market goods under 'market goods' key or not. Such data can add a lot of extra weight"
func GetEngines ¶
ShowAccount godoc @Summary Getting list of Engines @Tags equipment @Accept json @Produce json @Success 200 {array} darkapi.Engine @Router /api/engines [get] @Param filter_to_useful query string false "insert 'true' if wish to filter items only to useful, usually they are sold, or have goods, or craftable or findable in loot, or bases that are flight reachable from manhattan" @Param include_market_goods query string false "insert 'true' if wish to include market goods under 'market goods' key or not. Such data can add a lot of extra weight" @Param include_tech_compat query string false "insert 'true' if wish to include tech compat info too for the item. Such data can add a lot of extra weight"
func GetFactions ¶
ShowAccount godoc @Summary Getting list of Factions @Tags factions @Accept json @Produce json @Success 200 {array} configs_export.Faction @Router /api/factions [get] @Param filter_to_useful query string false "filter items only to useful, usually they are sold, or have goods, or craftable or findable in loot, or bases that are flight reachable from manhattan"
func GetGuns ¶
ShowAccount godoc @Summary Getting list of Guns @Tags equipment @Accept json @Produce json @Success 200 {array} darkapi.Gun @Router /api/guns [get] @Param filter_to_useful query string false "insert 'true' if wish to filter items only to useful, usually they are sold, or have goods, or craftable or findable in loot, or bases that are flight reachable from manhattan" @Param include_market_goods query string false "insert 'true' if wish to include market goods under 'market goods' key or not. Such data can add a lot of extra weight" @Param include_tech_compat query string false "insert 'true' if wish to include tech compat info too for the item. Such data can add a lot of extra weight"
func GetHashes ¶
ShowAccount godoc @Summary Hashes @Tags misc @Accept json @Produce json @Success 200 {object} Hashes @Router /api/hashes [get]
func GetInfocards ¶
ShowAccount godoc @Summary Getting infocards @Tags misc @Accept json @Produce json @Param request body []string true "Array of nicknames as input, for example [fc_or_gun01_mark02]" @Success 200 {array} InfocardResp @Router /api/infocards [post]
func GetItemsT ¶
func GetItemsT[T Nicknamable](webapp *web.Web, items []T, filter func(items []T) []T) func(w http.ResponseWriter, r *http.Request)
func GetMines ¶
ShowAccount godoc @Summary Getting list of Mines @Tags equipment @Accept json @Produce json @Success 200 {array} darkapi.Mine @Router /api/mines [get] @Param filter_to_useful query string false "insert 'true' if wish to filter items only to useful, usually they are sold, or have goods, or craftable or findable in loot, or bases that are flight reachable from manhattan" @Param include_market_goods query string false "insert 'true' if wish to include market goods under 'market goods' key or not. Such data can add a lot of extra weight" @Param include_tech_compat query string false "insert 'true' if wish to include tech compat info too for the item. Such data can add a lot of extra weight"
func GetMissiles ¶
ShowAccount godoc @Summary Getting list of Missiles @Tags equipment @Accept json @Produce json @Success 200 {array} darkapi.Gun @Router /api/missiles [get] @Param filter_to_useful query string false "insert 'true' if wish to filter items only to useful, usually they are sold, or have goods, or craftable or findable in loot, or bases that are flight reachable from manhattan" @Param include_market_goods query string false "insert 'true' if wish to include market goods under 'market goods' key or not. Such data can add a lot of extra weight" @Param include_tech_compat query string false "insert 'true' if wish to include tech compat info too for the item. Such data can add a lot of extra weight"
func GetOreFields ¶
ShowAccount godoc @Summary Getting list of Mining Operations @Tags bases @Accept json @Produce json @Success 200 {array} darkapi.Base @Router /api/mining_operations [get] @Param filter_to_useful query string false "filter items only to useful, usually they are sold, or have goods, or craftable or findable in loot, or bases that are flight reachable from manhattan" @Param include_market_goods query string false "include market goods under 'market goods' key or not. Such data can add a lot of extra weight"
func GetPoBBases ¶
ShowAccount godoc @Summary Getting list of Player Owned Bases in Bases format. Lists only pobs that have known position coordinates @Tags bases @Accept json @Produce json @Success 200 {array} configs_export.Base @Router /api/pobs/bases [get]
func GetPoBs ¶
ShowAccount godoc @Summary Getting list of Player Owned Bases @Description in difference to Disco API, it is enriched with Nicknames/Infocard Names,Region names @Description Sector coordinates, and extra information written in Infocard (totally reflecting Darkstat itself) @Tags bases @Accept json @Produce json @Success 200 {array} configs_export.PoB @Router /api/pobs [get]
func GetPobGoods ¶
ShowAccount godoc @Summary PoB Goods @Tags bases @Accept json @Produce json @Success 200 {array} configs_export.PoBGood @Router /api/pob_goods [get]
func GetScanners ¶
ShowAccount godoc @Summary Getting list of Scanners @Tags equipment @Accept json @Produce json @Success 200 {array} darkapi.Scanner @Router /api/scanners [get] @Param filter_to_useful query string false "insert 'true' if wish to filter items only to useful, usually they are sold, or have goods, or craftable or findable in loot, or bases that are flight reachable from manhattan" @Param include_market_goods query string false "insert 'true' if wish to include market goods under 'market goods' key or not. Such data can add a lot of extra weight" @Param include_tech_compat query string false "insert 'true' if wish to include tech compat info too for the item. Such data can add a lot of extra weight"
func GetShields ¶
ShowAccount godoc @Summary Getting list of Shields @Tags equipment @Accept json @Produce json @Success 200 {array} darkapi.Shield @Router /api/shields [get] @Param filter_to_useful query string false "insert 'true' if wish to filter items only to useful, usually they are sold, or have goods, or craftable or findable in loot, or bases that are flight reachable from manhattan" @Param include_market_goods query string false "insert 'true' if wish to include market goods under 'market goods' key or not. Such data can add a lot of extra weight" @Param include_tech_compat query string false "insert 'true' if wish to include tech compat info too for the item. Such data can add a lot of extra weight"
func GetShips ¶
ShowAccount godoc @Summary Getting list of Ships @Tags equipment @Accept json @Produce json @Success 200 {array} darkapi.Ship @Router /api/ships [get] @Param filter_to_useful query string false "insert 'true' if wish to filter items only to useful, usually they are sold, or have goods, or craftable or findable in loot, or bases that are flight reachable from manhattan" @Param include_market_goods query string false "insert 'true' if wish to include market goods under 'market goods' key or not. Such data can add a lot of extra weight" @Param include_tech_compat query string false "insert 'true' if wish to include tech compat info too for the item. Such data can add a lot of extra weight"
func GetThrusters ¶
ShowAccount godoc @Summary Getting list of Thrusters @Tags equipment @Accept json @Produce json @Success 200 {array} darkapi.Thruster @Router /api/thrusters [get] @Param filter_to_useful query string false "insert 'true' if wish to filter items only to useful, usually they are sold, or have goods, or craftable or findable in loot, or bases that are flight reachable from manhattan" @Param include_market_goods query string false "insert 'true' if wish to include market goods under 'market goods' key or not. Such data can add a lot of extra weight" @Param include_tech_compat query string false "insert 'true' if wish to include tech compat info too for the item. Such data can add a lot of extra weight"
func GetTractors ¶
ShowAccount godoc @Summary Getting list of tractors @Tags equipment @Accept json @Produce json @Success 200 {array} darkapi.Tractor @Router /api/tractors [get] @Param filter_to_useful query string false "insert 'true' if wish to filter items only to useful, usually they are sold, or have goods, or craftable or findable in loot, or bases that are flight reachable from manhattan" @Param include_market_goods query string false "insert 'true' if wish to include market goods under 'market goods' key or not. Such data can add a lot of extra weight"
func GunHandler ¶ added in v1.67.0
func GunHandler(webapp *web.Web, api *Api, guns []configs_export.Gun) func(w http.ResponseWriter, r *http.Request)
func JsonResponseHeader ¶
func JsonResponseHeader(w *http.ResponseWriter)
func PostEnginesMarketGoods ¶
func PostGraphPaths ¶
ShowAccount godoc @Summary List of time measurements between two NPC bases/PoBs/Ore fields and etc. @Description You query by nicknames of objects from which base/pob/ore fields to which one @Description You receive result how many seconds it takes to reach destination for Transport, Frigate and Freighter @Description If destination is not reachable, you get time equal to Maximum of int32 = 9223372036854775807 @Tags misc @Accept json @Produce json @Param request body []appdata.GraphPathReq true "Request body" @Success 200 {array} appdata.GraphPathsResp @Router /api/graph/paths [post]
func PostItemsMarketGoodsT ¶
func PostItemsMarketGoodsT[T Marketable](webapp *web.Web, items []T) func(w http.ResponseWriter, r *http.Request)
func PostItemsTechCompatT ¶
func PostItemsTechCompatT[T TechCompatable](webapp *web.Web, items []T) func(w http.ResponseWriter, r *http.Request)
func PostMissilesMarketGoods ¶
func PostScannersMarketGoods ¶
func PostShieldsMarketGoods ¶
func PostTractorMarketGoods ¶
func ReturnJson ¶
func ReturnJson(w *http.ResponseWriter, data any)
Types ¶
type Ammo ¶ added in v1.67.0
type Ammo struct {
*configs_export.Ammo
MarketGoods []*configs_export.MarketGood `json:"market_goods"`
TechCompat *configs_export.DiscoveryTechCompat `json:"tech_compat"`
}
type Base ¶ added in v1.67.0
type Base struct {
*configs_export.Base
MarketGoods []*configs_export.MarketGood `json:"market_goods"`
}
type Commodity ¶ added in v1.67.0
type Commodity struct {
*configs_export.Commodity
MarketGoods []*configs_export.MarketGood `json:"market_goods"`
}
type CounterMeasure ¶ added in v1.67.0
type CounterMeasure struct {
*configs_export.CounterMeasure
MarketGoods []*configs_export.MarketGood `json:"market_goods"`
TechCompat *configs_export.DiscoveryTechCompat `json:"tech_compat"`
}
type Engine ¶ added in v1.67.0
type Engine struct {
*configs_export.Engine
MarketGoods []*configs_export.MarketGood `json:"market_goods"`
TechCompat *configs_export.DiscoveryTechCompat `json:"tech_compat"`
}
type Gun ¶ added in v1.67.0
type Gun struct {
*configs_export.Gun
MarketGoods []*configs_export.MarketGood `json:"market_goods"`
TechCompat *configs_export.DiscoveryTechCompat `json:"tech_compat"`
}
type InfocardResp ¶
type InfocardResp struct {
Infocard *configs_export.Infocard `json:"infocard,omitempty"`
Error *string `json:"error,omitempty"`
}
type MarketGoodResp ¶
type MarketGoodResp struct {
MarketGoods []*configs_export.MarketGood `json:"market_goods"`
Nickname string `json:"nickname" validate:"required"`
Error *string `json:"error,omitempty"`
}
type Marketable ¶
type Marketable interface {
Nicknamable
GetBases() map[cfg.BaseUniNick]*configs_export.MarketGood
}
type Mine ¶ added in v1.67.0
type Mine struct {
*configs_export.Mine
MarketGoods []*configs_export.MarketGood `json:"market_goods"`
TechCompat *configs_export.DiscoveryTechCompat `json:"tech_compat"`
}
type Nicknamable ¶
type Nicknamable interface {
GetNickname() string
}
type Scanner ¶ added in v1.67.0
type Scanner struct {
*configs_export.Scanner
MarketGoods []*configs_export.MarketGood `json:"market_goods"`
TechCompat *configs_export.DiscoveryTechCompat `json:"tech_compat"`
}
type Shield ¶ added in v1.67.0
type Shield struct {
*configs_export.Shield
MarketGoods []*configs_export.MarketGood `json:"market_goods"`
TechCompat *configs_export.DiscoveryTechCompat `json:"tech_compat"`
}
type Ship ¶ added in v1.67.0
type Ship struct {
*configs_export.Ship
MarketGoods []*configs_export.MarketGood `json:"market_goods"`
TechCompat *configs_export.DiscoveryTechCompat `json:"tech_compat"`
}
type TechCompatResp ¶
type TechCompatResp struct {
TechCompat *configs_export.DiscoveryTechCompat `json:"tech_compat"`
Nickname string `json:"nickname" validate:"required"`
Error *string `json:"error,omitempty"`
}
type TechCompatable ¶
type TechCompatable interface {
Nicknamable
GetDiscoveryTechCompat() *configs_export.DiscoveryTechCompat
}
type Thruster ¶ added in v1.67.0
type Thruster struct {
*configs_export.Thruster
MarketGoods []*configs_export.MarketGood `json:"market_goods"`
TechCompat *configs_export.DiscoveryTechCompat `json:"tech_compat"`
}
type Tractor ¶ added in v1.67.0
type Tractor struct {
*configs_export.Tractor
MarketGoods []*configs_export.MarketGood `json:"market_goods"`
TechCompat *configs_export.DiscoveryTechCompat `json:"tech_compat"`
}