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 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 Api
- type GraphPathReq
- type GraphPathTime
- type GraphPathsResp
- type Hashes
- type InfocardResp
- type MarketGoodResp
- type Marketable
- type Nicknamable
- type TechCompatResp
- type TechCompatable
Constants ¶
const ApiRoute = "/api"
Variables ¶
This section is empty.
Functions ¶
func GetAmmos ¶
ShowAccount godoc @Summary Getting list of Ammos @Tags ammos @Accept json @Produce json @Success 200 {array} configs_export.Ammo @Router /api/ammos [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" example("true")
func GetBases ¶
ShowAccount godoc @Summary Getting list of NPC Bases @Tags bases @Accept json @Produce json @Success 200 {array} configs_export.Base @Router /api/npc_bases [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" example("true")
func GetCMs ¶
ShowAccount godoc @Summary Getting list of CounterMeasure @Tags counter_measures @Accept json @Produce json @Success 200 {array} configs_export.CounterMeasure @Router /api/counter_measures [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" example("true")
func GetCommodities ¶
ShowAccount godoc @Summary Getting list of Commodities @Tags commodities @Accept json @Produce json @Success 200 {array} configs_export.Commodity @Router /api/commodities [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" example("true")
func GetEngines ¶
ShowAccount godoc @Summary Getting list of Engines @Tags engines @Accept json @Produce json @Success 200 {array} configs_export.Engine @Router /api/engines [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" example("true")
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" example("true")
func GetGuns ¶
ShowAccount godoc @Summary Getting list of Guns @Tags guns @Accept json @Produce json @Success 200 {array} configs_export.Gun @Router /api/guns [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" example("true")
func GetHashes ¶
ShowAccount godoc @Summary Hashes @Tags hashes @Accept json @Produce json @Success 200 {object} Hashes @Router /api/hashes [get]
func GetInfocards ¶
ShowAccount godoc @Summary Getting infocards @Tags infocards @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 mines @Accept json @Produce json @Success 200 {array} configs_export.Mine @Router /api/mines [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" example("true")
func GetMissiles ¶
ShowAccount godoc @Summary Getting list of Missiles @Tags guns @Accept json @Produce json @Success 200 {array} configs_export.Gun @Router /api/missiles [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" example("true")
func GetOreFields ¶
ShowAccount godoc @Summary Getting list of Mining Operations @Tags bases @Accept json @Produce json @Success 200 {array} configs_export.Base @Router /api/mining_operations [get]
func GetPoBBases ¶
ShowAccount godoc @Summary Getting list of Player Owned Bases in Bases format. Lists only pobs that have known position coordinates @Tags player_owned_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 player_owned_bases @Accept json @Produce json @Success 200 {array} configs_export.PoB @Router /api/pobs [get]
func GetPobGoods ¶
ShowAccount godoc @Summary PoB Goods @Tags player_owned_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 scanners @Accept json @Produce json @Success 200 {array} configs_export.Scanner @Router /api/scanners [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" example("true")
func GetShields ¶
ShowAccount godoc @Summary Getting list of Shields @Tags shields @Accept json @Produce json @Success 200 {array} configs_export.Shield @Router /api/shields [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" example("true")
func GetShips ¶
ShowAccount godoc @Summary Getting list of Ships @Tags ships @Accept json @Produce json @Success 200 {array} configs_export.Ship @Router /api/ships [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" example("true")
func GetThrusters ¶
ShowAccount godoc @Summary Getting list of Thrusters @Tags thrusters @Accept json @Produce json @Success 200 {array} configs_export.Thruster @Router /api/thrusters [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" example("true")
func GetTractors ¶
ShowAccount godoc @Summary Getting list of tractors @Tags tractors @Accept json @Produce json @Success 200 {array} configs_export.Tractor @Router /api/tractors [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" example("true")
func JsonResponseHeader ¶
func JsonResponseHeader(w *http.ResponseWriter)
func PostAmmoMarketGoods ¶
ShowAccount godoc @Summary Getting list of Ammo Market Goods @Tags ammos @Accept json @Produce json @Param request body []string true "Array of ammo nicknames as input, for example [dsy_annihilator_torpedo_ammo]" @Success 200 {array} MarketGoodResp @Router /api/ammos/market_goods [post]
func PostAmmoTechcompatibilities ¶
ShowAccount godoc @Summary Getting list of Ammos Tech compats @Tags ammos @Accept json @Produce json @Param request body []string true "Array of ammo nicknames as input" @Success 200 {array} TechCompatResp @Router /api/ammos/tech_compats [post]
func PostBaseMarketGoods ¶
ShowAccount godoc @Summary Getting list of NPC Bases Market Goods @Tags bases @Accept json @Produce json @Param request body []cfg.BaseUniNick true "Array of npc base nicknames as input, for example [li01_01_base]" example("li01_01_base") @Success 200 {array} MarketGoodResp @Router /api/npc_bases/market_goods [post]
func PostCMsMarketGoods ¶
ShowAccount godoc @Summary Getting list of CounterMeasure Market Goods @Tags counter_measures @Accept json @Produce json @Param request body []string true "Array of counter nicknames as input, for example [ge_s_cm_01]" @Success 200 {array} MarketGoodResp @Router /api/counter_measures/market_goods [post]
func PostCMsTechcompatibilities ¶
ShowAccount godoc @Summary Getting list of CounterMeasure Tech compats @Tags counter_measures @Accept json @Produce json @Param request body []string true "Array of counter measure nicknames as input" @Success 200 {array} TechCompatResp @Router /api/counter_measures/tech_compats [post]
func PostCommodityMarketGoods ¶
ShowAccount godoc @Summary Getting list of Commodities Market Goods @Tags commodities @Accept json @Produce json @Param request body []string true "Array of commodity nicknames as input, for example [commodity_military_salvage]" example("commodity_military_salvage") @Success 200 {array} MarketGoodResp @Router /api/commodities/market_goods [post]
func PostEnginesMarketGoods ¶
ShowAccount godoc @Summary Getting list of Engine Market Goods @Tags engines @Accept json @Produce json @Param request body []string true "Array of engines nicknames as input, for example [ge_kfr_engine_01_add]" @Success 200 {array} MarketGoodResp @Router /api/engines/market_goods [post]
func PostEnginesTechcompatibilities ¶
ShowAccount godoc @Summary Getting list of Engine Tech compats @Tags engines @Accept json @Produce json @Param request body []string true "Array of engines nicknames as input" @Success 200 {array} TechCompatResp @Router /api/engines/tech_compats [post]
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 graph @Accept json @Produce json @Param request body []GraphPathReq true "Request body" @Success 200 {array} GraphPathsResp @Router /api/graph/paths [post]
func PostGunsMarketGoods ¶
ShowAccount godoc @Summary Getting list of Guns Market Goods @Tags guns @Accept json @Produce json @Param request body []string true "Array of ship nicknames as input, for example [ai_bomber]" example("ai_bomber") @Success 200 {array} MarketGoodResp @Router /api/guns/market_goods [post]
func PostGunsTechcompatibilities ¶
ShowAccount godoc @Summary Getting list of Guns Tech compats @Tags guns @Accept json @Produce json @Param request body []string true "Array of gun nicknames as input, for example [ai_bomber]" example("ai_bomber") @Success 200 {array} TechCompatResp @Router /api/guns/tech_compats [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 PostMinesMarketGoods ¶
ShowAccount godoc @Summary Getting list of Mines Market Goods @Tags mines @Accept json @Produce json @Param request body []string true "Array of mine nicknames as input, for example [mine02_mark02]" @Success 200 {array} MarketGoodResp @Router /api/mines/market_goods [post]
func PostMinesTechcompatibilities ¶
ShowAccount godoc @Summary Getting list of Mines Tech compats @Tags mines @Accept json @Produce json @Param request body []string true "Array of gun nicknames as input, for example [ai_bomber]" example("ai_bomber") @Success 200 {array} TechCompatResp @Router /api/mines/tech_compats [post]
func PostMissilesMarketGoods ¶
ShowAccount godoc @Summary Getting list of Missiles Market Goods @Tags guns @Accept json @Produce json @Param request body []string true "Array of ship nicknames as input, for example [fc_or_gun01_mark02]" @Success 200 {array} MarketGoodResp @Router /api/missiles/market_goods [post]
func PostMissilesTechcompatibilities ¶
ShowAccount godoc @Summary Getting list of Missiles Tech compats @Tags guns @Accept json @Produce json @Param request body []string true "Array of missile nicknames as input, for example [fc_or_gun01_mark02]" @Success 200 {array} TechCompatResp @Router /api/missiles/tech_compats [post]
func PostScannersMarketGoods ¶
ShowAccount godoc @Summary Getting list of Scanners Market Goods @Tags scanners @Accept json @Produce json @Param request body []string true "Array of ammo nicknames as input, for example [dsy_annihilator_torpedo_ammo]" @Success 200 {array} MarketGoodResp @Router /api/scanners/market_goods [post]
func PostScannersTechcompatibilities ¶
ShowAccount godoc @Summary Getting list of Scanners Tech compats @Tags scanners @Accept json @Produce json @Param request body []string true "Array of ammo nicknames as input" @Success 200 {array} TechCompatResp @Router /api/scanners/tech_compats [post]
func PostShieldsMarketGoods ¶
ShowAccount godoc @Summary Getting list of Shields Market Goods @Tags shields @Accept json @Produce json @Param request body []string true "Array of ammo nicknames as input, for example [ai_shield_hf]" @Success 200 {array} MarketGoodResp @Router /api/shields/market_goods [post]
func PostShieldsTechcompatibilities ¶
ShowAccount godoc @Summary Getting list of Shields Tech compats @Tags shields @Accept json @Produce json @Param request body []string true "Array of ammo nicknames as input" @Success 200 {array} TechCompatResp @Router /api/shields/tech_compats [post]
func PostShipMarketGoods ¶
ShowAccount godoc @Summary Getting list of Ship Market Goods @Tags ships @Accept json @Produce json @Param request body []string true "Array of ship nicknames as input, for example [ai_bomber]" example("ai_bomber") @Success 200 {array} MarketGoodResp @Router /api/ships/market_goods [post]
func PostShipTechcompatibilities ¶
ShowAccount godoc @Summary Getting list of Ship Tech compats @Tags ships @Accept json @Produce json @Param request body []string true "Array of ship nicknames as input, for example [ai_bomber]" example("ai_bomber") @Success 200 {array} TechCompatResp @Router /api/ships/tech_compats [post]
func PostThrustersMarketGoods ¶
ShowAccount godoc @Summary Getting list of Thrusters Market Goods @Tags thrusters @Accept json @Produce json @Param request body []string true "Array of thrusters nicknames as input, for example [dsy_thruster_bd]" @Success 200 {array} MarketGoodResp @Router /api/thrusters/market_goods [post]
func PostThrustersTechcompatibilities ¶
ShowAccount godoc @Summary Getting list of Thrusters Tech compats @Tags thrusters @Accept json @Produce json @Param request body []string true "Array of thrusters nicknames as input" @Success 200 {array} TechCompatResp @Router /api/thrusters/tech_compats [post]
func PostTractorMarketGoods ¶
ShowAccount godoc @Summary Getting list of Tractor Market Goods @Tags tractors @Accept json @Produce json @Param request body []string true "Array of ship nicknames as input, for example [dsy_license_srp_28]" @Success 200 {array} MarketGoodResp @Router /api/tractors/market_goods [post]
func ReturnJson ¶
func ReturnJson(w *http.ResponseWriter, data any)
Types ¶
type GraphPathReq ¶
type GraphPathTime ¶
type GraphPathsResp ¶
type GraphPathsResp struct { Route GraphPathReq `json:"route"` // writes requested input Time *GraphPathTime `json:"time,omitempty"` Error *string `json:"error,omitempty"` // writes error if requesting not existing nicknames in from/to fields }
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"` Error *string `json:"error,omitempty"` }
type Marketable ¶
type Marketable interface { Nicknamable GetBases() map[cfg.BaseUniNick]*configs_export.MarketGood }
type Nicknamable ¶
type Nicknamable interface {
GetNickname() string
}
type TechCompatResp ¶
type TechCompatResp struct { TechCompat *configs_export.DiscoveryTechCompat `json:"tech_compat"` Nickname string `json:"nickname"` Error *string `json:"error,omitempty"` }
type TechCompatable ¶
type TechCompatable interface { Nicknamable GetDiscoveryTechCompat() *configs_export.DiscoveryTechCompat }