Documentation
¶
Index ¶
- Constants
- Variables
- func GetAmmos(webapp *web.Web, api *Api) *registry.Endpoint
- func GetBases(webapp *web.Web, api *Api) *registry.Endpoint
- func GetBasesInput(w http.ResponseWriter, r *http.Request) (*pb.GetBasesInput, error)
- 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 GetEquipmentInput(w http.ResponseWriter, r *http.Request) (*pb.GetEquipmentInput, error)
- func GetFactions(webapp *web.Web, api *Api) *registry.Endpoint
- func GetGuns(webapp *web.Web, api *Api) *registry.Endpoint
- func GetGunsInput(w http.ResponseWriter, r *http.Request) (*pb.GetGunsInput, error)
- func GetHashes(webapp *web.Web, api *Api) *registry.Endpoint
- func GetInfocards(webapp *web.Web, app_data *appdata.AppData, api *Api) *registry.Endpoint
- 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 GetSystems(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 ReadJsonInput[T any](w http.ResponseWriter, r *http.Request, data *T) error
- func RegisterApiRoutes(w *web.Web, app_data *appdata.AppData) *web.Web
- type Ammo
- type Api
- type Base
- type Commodity
- type CounterMeasure
- type Engine
- type Gun
- 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 ¶
var (
Log = logus.Log.WithScope("darkhttp")
)
Functions ¶
func GetAmmos ¶
ShowAccount godoc @Summary Getting list of Ammos @Tags equipment @Accept json @Produce json @Success 200 {array} darkhttp.Ammo @Router /api/ammos [post] @Param request body pb.GetEquipmentInput true "input variables" @Description include_market_goods: "insert 'true' if wish to include market goods under 'market goods' key or not. Such data can add a lot of extra weight" @Description include_tech_compat: insert 'true' if wish to include tech compatibility data. can be adding a lot of extra weight @Description filter_to_useful: Apply filtering same as darkstat does by default for its tab. Usually means showing only items that can be bought/crafted/or found @Description filter_nicknames: filters by item nicknames
func GetBases ¶
ShowAccount godoc @Summary Getting list of NPC Bases @Tags bases @Accept json @Produce json @Success 200 {array} darkhttp.Base @Router /api/npc_bases [post] @Param request body pb.GetBasesInput true "input variables" @Description include_market_goods: "insert 'true' if wish to include market goods under 'market goods' key or not. Such data can add a lot of extra weight" @Description filter_to_useful: Apply filtering same as darkstat does by default for its tab. Usually means showing only items that can be bought/crafted/or found @Description filter_nicknames: filters by item nicknames (in those case by base nicknames) @Description filter_market_good_category: filters market goods to specific category. valid categories are written in market goods in same named attribute. for example 'commodity'
func GetBasesInput ¶
func GetBasesInput(w http.ResponseWriter, r *http.Request) (*pb.GetBasesInput, error)
func GetCMs ¶
ShowAccount godoc @Summary Getting list of CounterMeasure @Tags equipment @Accept json @Produce json @Success 200 {array} darkhttp.CounterMeasure @Router /api/counter_measures [post] @Param request body pb.GetEquipmentInput true "input variables" @Description include_market_goods: "insert 'true' if wish to include market goods under 'market goods' key or not. Such data can add a lot of extra weight" @Description include_tech_compat: insert 'true' if wish to include tech compatibility data. can be adding a lot of extra weight @Description filter_to_useful: Apply filtering same as darkstat does by default for its tab. Usually means showing only items that can be bought/crafted/or found @Description filter_nicknames: filters by item nicknames
func GetCommodities ¶
ShowAccount godoc @Summary Getting list of Commodities @Tags equipment @Accept json @Produce json @Success 200 {array} darkhttp.Commodity @Router /api/commodities [post] @Param request body pb.GetCommoditiesInput true "input variables" @Description include_market_goods: "insert 'true' if wish to include market goods under 'market goods' key or not. Such data can add a lot of extra weight" @Description filter_to_useful: Apply filtering same as darkstat does by default for its tab. Usually means showing only items that can be bought/crafted/or found @Description filter_nicknames: filters by item nicknames
func GetEngines ¶
ShowAccount godoc @Summary Getting list of Engines @Tags equipment @Accept json @Produce json @Success 200 {array} darkhttp.Engine @Router /api/engines [post] @Param request body pb.GetEquipmentInput true "input variables" @Description include_market_goods: "insert 'true' if wish to include market goods under 'market goods' key or not. Such data can add a lot of extra weight" @Description include_tech_compat: insert 'true' if wish to include tech compatibility data. can be adding a lot of extra weight @Description filter_to_useful: Apply filtering same as darkstat does by default for its tab. Usually means showing only items that can be bought/crafted/or found @Description filter_nicknames: filters by item nicknames
func GetEquipmentInput ¶
func GetEquipmentInput(w http.ResponseWriter, r *http.Request) (*pb.GetEquipmentInput, error)
func GetFactions ¶
ShowAccount godoc @Summary Getting list of Factions @Tags factions @Accept json @Produce json @Success 200 {array} configs_export.Faction @Router /api/factions [post] @Param request body pb.GetFactionsInput true "input variables" @Description filter_to_useful: Apply filtering same as darkstat does by default for its tab. Usually means showing only items that can be bought/crafted/or found
func GetGuns ¶
ShowAccount godoc @Summary Getting list of Guns @Tags equipment @Accept json @Produce json @Success 200 {array} darkhttp.Gun @Router /api/guns [post] @Param request body pb.GetGunsInput true "input variables" @Description include_market_goods: "insert 'true' if wish to include market goods under 'market goods' key or not. Such data can add a lot of extra weight" @Description include_tech_compat: insert 'true' if wish to include tech compatibility data. can be adding a lot of extra weight @Description filter_to_useful: Apply filtering same as darkstat does by default for its tab. Usually means showing only items that can be bought/crafted/or found @Description filter_nicknames: filters by item nicknames @Description include_damage_bonuses: insert 'true' if u wish added damage bonuses against specific shield types
func GetGunsInput ¶
func GetGunsInput(w http.ResponseWriter, r *http.Request) (*pb.GetGunsInput, error)
func GetHashes ¶
ShowAccount godoc @Summary Hashes @Tags misc @Accept json @Produce json @Success 200 {object} darkgrpc_deprecated.Hashes @Router /api/hashes [post]
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 GetMines ¶
ShowAccount godoc @Summary Getting list of Mines @Tags equipment @Accept json @Produce json @Success 200 {array} darkhttp.Mine @Router /api/mines [post] @Param request body pb.GetEquipmentInput true "input variables" @Description include_market_goods: "insert 'true' if wish to include market goods under 'market goods' key or not. Such data can add a lot of extra weight" @Description include_tech_compat: insert 'true' if wish to include tech compatibility data. can be adding a lot of extra weight @Description filter_to_useful: Apply filtering same as darkstat does by default for its tab. Usually means showing only items that can be bought/crafted/or found @Description filter_nicknames: filters by item nicknames
func GetMissiles ¶
ShowAccount godoc @Summary Getting list of Missiles @Tags equipment @Accept json @Produce json @Success 200 {array} darkhttp.Gun @Router /api/missiles [post] @Param request body pb.GetGunsInput true "input variables" @Description include_market_goods: "insert 'true' if wish to include market goods under 'market goods' key or not. Such data can add a lot of extra weight" @Description include_tech_compat: insert 'true' if wish to include tech compatibility data. can be adding a lot of extra weight @Description filter_to_useful: Apply filtering same as darkstat does by default for its tab. Usually means showing only items that can be bought/crafted/or found @Description filter_nicknames: filters by item nicknames @Description include_damage_bonuses: insert 'true' if u wish added damage bonuses against specific shield types
func GetOreFields ¶
ShowAccount godoc @Summary Getting list of Mining Operations @Tags bases @Accept json @Produce json @Success 200 {array} darkhttp.Base @Router /api/mining_operations [post] @Param request body pb.GetBasesInput true "input variables" @Description include_market_goods: "insert 'true' if wish to include market goods under 'market goods' key or not. Such data can add a lot of extra weight" @Description filter_to_useful: Apply filtering same as darkstat does by default for its tab. Usually means showing only items that can be bought/crafted/or found @Description filter_nicknames: filters by item nicknames (in those case by base nicknames) @Description filter_market_good_category: filters market goods to specific category. valid categories are written in market goods in same named attribute. for example 'commodity'
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} darkhttp.Base @Router /api/pobs/bases [post] @Param request body pb.GetBasesInput true "input variables" @Description include_market_goods: "insert 'true' if wish to include market goods under 'market goods' key or not. Such data can add a lot of extra weight" @Description filter_to_useful: Apply filtering same as darkstat does by default for its tab. Usually means showing only items that can be bought/crafted/or found @Description filter_nicknames: filters by item nicknames (in those case by base nicknames) @Description filter_market_good_category: filters market goods to specific category. valid categories are written in market goods in same named attribute. for example 'commodity'
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 [post]
func GetPobGoods ¶
ShowAccount godoc @Summary PoB Goods @Tags bases @Accept json @Produce json @Success 200 {array} configs_export.PoBGood @Router /api/pob_goods [post]
func GetScanners ¶
ShowAccount godoc @Summary Getting list of Scanners @Tags equipment @Accept json @Produce json @Success 200 {array} darkhttp.Scanner @Router /api/scanners [post] @Param request body pb.GetEquipmentInput true "input variables" @Description include_market_goods: "insert 'true' if wish to include market goods under 'market goods' key or not. Such data can add a lot of extra weight" @Description include_tech_compat: insert 'true' if wish to include tech compatibility data. can be adding a lot of extra weight @Description filter_to_useful: Apply filtering same as darkstat does by default for its tab. Usually means showing only items that can be bought/crafted/or found @Description filter_nicknames: filters by item nicknames
func GetShields ¶
ShowAccount godoc @Summary Getting list of Shields @Tags equipment @Accept json @Produce json @Success 200 {array} darkhttp.Shield @Router /api/shields [post] @Param request body pb.GetEquipmentInput true "input variables" @Description include_market_goods: "insert 'true' if wish to include market goods under 'market goods' key or not. Such data can add a lot of extra weight" @Description include_tech_compat: insert 'true' if wish to include tech compatibility data. can be adding a lot of extra weight @Description filter_to_useful: Apply filtering same as darkstat does by default for its tab. Usually means showing only items that can be bought/crafted/or found @Description filter_nicknames: filters by item nicknames
func GetShips ¶
ShowAccount godoc @Summary Getting list of Ships @Tags equipment @Accept json @Produce json @Success 200 {array} darkhttp.Ship @Router /api/ships [post] @Param request body pb.GetEquipmentInput true "input variables" @Description include_market_goods: "insert 'true' if wish to include market goods under 'market goods' key or not. Such data can add a lot of extra weight" @Description include_tech_compat: insert 'true' if wish to include tech compatibility data. can be adding a lot of extra weight @Description filter_to_useful: Apply filtering same as darkstat does by default for its tab. Usually means showing only items that can be bought/crafted/or found @Description filter_nicknames: filters by item nicknames
func GetSystems ¶ added in v1.97.0
ShowAccount godoc @Summary Getting list of Systems @Tags equipment @Accept json @Produce json @Success 200 {array} export_front.System @Router /api/systems [post]
func GetThrusters ¶
ShowAccount godoc @Summary Getting list of Thrusters @Tags equipment @Accept json @Produce json @Success 200 {array} darkhttp.Thruster @Router /api/thrusters [post] @Param request body pb.GetEquipmentInput true "input variables" @Description include_market_goods: "insert 'true' if wish to include market goods under 'market goods' key or not. Such data can add a lot of extra weight" @Description include_tech_compat: insert 'true' if wish to include tech compatibility data. can be adding a lot of extra weight @Description filter_to_useful: Apply filtering same as darkstat does by default for its tab. Usually means showing only items that can be bought/crafted/or found @Description filter_nicknames: filters by item nicknames
func GetTractors ¶
ShowAccount godoc @Summary Getting list of tractors @Tags equipment @Accept json @Produce json @Success 200 {array} darkhttp.Tractor @Router /api/tractors [post] @Param request body pb.GetTractorsInput true "input variables" @Description include_market_goods: "insert 'true' if wish to include market goods under 'market goods' key or not. Such data can add a lot of extra weight" @Description filter_to_useful: Apply filtering same as darkstat does by default for its tab. Usually means showing only items that can be bought/crafted/or found @Description filter_nicknames: filters by item nicknames @Description include_rephacks: "insert 'true' if wish to include ID rephacks usable for Freelancer Discovery
func GunHandler ¶
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 ReadJsonInput ¶
Types ¶
type Ammo ¶
type Ammo struct {
*configs_export.Ammo
MarketGoods []*configs_export.MarketGood `json:"market_goods"`
TechCompat *configs_export.DiscoveryTechCompat `json:"tech_compat"`
}
type Api ¶
type Api struct {
// contains filtered or unexported fields
}
func (*Api) GetAppData ¶ added in v1.86.5
type Base ¶
type Base struct {
*configs_export.Base
MarketGoods []*configs_export.MarketGood `json:"market_goods"`
}
type Commodity ¶
type Commodity struct {
*configs_export.Commodity
MarketGoods []*configs_export.MarketGood `json:"market_goods"`
}
type CounterMeasure ¶
type CounterMeasure struct {
*configs_export.CounterMeasure
MarketGoods []*configs_export.MarketGood `json:"market_goods"`
TechCompat *configs_export.DiscoveryTechCompat `json:"tech_compat"`
}
type Engine ¶
type Engine struct {
*configs_export.Engine
MarketGoods []*configs_export.MarketGood `json:"market_goods"`
TechCompat *configs_export.DiscoveryTechCompat `json:"tech_compat"`
}
type Gun ¶
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 *infocarder.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 ¶
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 ¶
type Scanner struct {
*configs_export.Scanner
MarketGoods []*configs_export.MarketGood `json:"market_goods"`
TechCompat *configs_export.DiscoveryTechCompat `json:"tech_compat"`
}
type Shield ¶
type Shield struct {
*configs_export.Shield
MarketGoods []*configs_export.MarketGood `json:"market_goods"`
TechCompat *configs_export.DiscoveryTechCompat `json:"tech_compat"`
}
type Ship ¶
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 ¶
type Thruster struct {
*configs_export.Thruster
MarketGoods []*configs_export.MarketGood `json:"market_goods"`
TechCompat *configs_export.DiscoveryTechCompat `json:"tech_compat"`
}
type Tractor ¶
type Tractor struct {
*configs_export.Tractor
MarketGoods []*configs_export.MarketGood `json:"market_goods"`
TechCompat *configs_export.DiscoveryTechCompat `json:"tech_compat"`
Rephacks []*configs_export.Rephack `json:"rephacks"`
}