darkhttp

package
v1.71.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2025 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const ApiRoute = "/api"

Variables

This section is empty.

Functions

func GetAmmos

func GetAmmos(webapp *web.Web, api *Api) *registry.Endpoint

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

func GetBases(webapp *web.Web, api *Api) *registry.Endpoint

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

func GetCMs(webapp *web.Web, api *Api) *registry.Endpoint

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

func GetCommodities(webapp *web.Web, api *Api) *registry.Endpoint

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

func GetEngines(webapp *web.Web, api *Api) *registry.Endpoint

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

func GetFactions(webapp *web.Web, api *Api) *registry.Endpoint

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

func GetGuns(webapp *web.Web, api *Api) *registry.Endpoint

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

func GetHashes(webapp *web.Web, api *Api) *registry.Endpoint

ShowAccount godoc @Summary Hashes @Tags misc @Accept json @Produce json @Success 200 {object} darkgrpc.Hashes @Router /api/hashes [post]

func GetInfocards

func GetInfocards(webapp *web.Web, app_data *appdata.AppData, api *Api) *registry.Endpoint

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

func GetMines(webapp *web.Web, api *Api) *registry.Endpoint

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

func GetMissiles(webapp *web.Web, api *Api) *registry.Endpoint

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

func GetOreFields(webapp *web.Web, api *Api) *registry.Endpoint

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

func GetPoBBases(webapp *web.Web, api *Api) *registry.Endpoint

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

func GetPoBs(webapp *web.Web, api *Api) *registry.Endpoint

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

func GetPobGoods(webapp *web.Web, api *Api) *registry.Endpoint

ShowAccount godoc @Summary PoB Goods @Tags bases @Accept json @Produce json @Success 200 {array} configs_export.PoBGood @Router /api/pob_goods [post]

func GetScanners

func GetScanners(webapp *web.Web, api *Api) *registry.Endpoint

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

func GetShields(webapp *web.Web, api *Api) *registry.Endpoint

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

func GetShips(webapp *web.Web, api *Api) *registry.Endpoint

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 GetThrusters

func GetThrusters(webapp *web.Web, api *Api) *registry.Endpoint

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

func GetTractors(webapp *web.Web, api *Api) *registry.Endpoint

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

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 PostAmmoMarketGoods

func PostAmmoMarketGoods(webapp *web.Web, api *Api) *registry.Endpoint

func PostAmmoTechcompatibilities

func PostAmmoTechcompatibilities(webapp *web.Web, api *Api) *registry.Endpoint

func PostBaseMarketGoods

func PostBaseMarketGoods(webapp *web.Web, api *Api) *registry.Endpoint

func PostCMsMarketGoods

func PostCMsMarketGoods(webapp *web.Web, api *Api) *registry.Endpoint

func PostCMsTechcompatibilities

func PostCMsTechcompatibilities(webapp *web.Web, api *Api) *registry.Endpoint

func PostCommodityMarketGoods

func PostCommodityMarketGoods(webapp *web.Web, api *Api) *registry.Endpoint

func PostEnginesMarketGoods

func PostEnginesMarketGoods(webapp *web.Web, api *Api) *registry.Endpoint

func PostEnginesTechcompatibilities

func PostEnginesTechcompatibilities(webapp *web.Web, api *Api) *registry.Endpoint

func PostGraphPaths

func PostGraphPaths(webapp *web.Web, api *Api) *registry.Endpoint

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 PostGunsMarketGoods

func PostGunsMarketGoods(webapp *web.Web, api *Api) *registry.Endpoint

func PostGunsTechcompatibilities

func PostGunsTechcompatibilities(webapp *web.Web, api *Api) *registry.Endpoint

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

func PostMinesMarketGoods(webapp *web.Web, api *Api) *registry.Endpoint

func PostMinesTechcompatibilities

func PostMinesTechcompatibilities(webapp *web.Web, api *Api) *registry.Endpoint

func PostMissilesMarketGoods

func PostMissilesMarketGoods(webapp *web.Web, api *Api) *registry.Endpoint

func PostMissilesTechcompatibilities

func PostMissilesTechcompatibilities(webapp *web.Web, api *Api) *registry.Endpoint

func PostScannersMarketGoods

func PostScannersMarketGoods(webapp *web.Web, api *Api) *registry.Endpoint

func PostScannersTechcompatibilities

func PostScannersTechcompatibilities(webapp *web.Web, api *Api) *registry.Endpoint

func PostShieldsMarketGoods

func PostShieldsMarketGoods(webapp *web.Web, api *Api) *registry.Endpoint

func PostShieldsTechcompatibilities

func PostShieldsTechcompatibilities(webapp *web.Web, api *Api) *registry.Endpoint

func PostShipMarketGoods

func PostShipMarketGoods(webapp *web.Web, api *Api) *registry.Endpoint

func PostShipTechcompatibilities

func PostShipTechcompatibilities(webapp *web.Web, api *Api) *registry.Endpoint

func PostThrustersMarketGoods

func PostThrustersMarketGoods(webapp *web.Web, api *Api) *registry.Endpoint

func PostThrustersTechcompatibilities

func PostThrustersTechcompatibilities(webapp *web.Web, api *Api) *registry.Endpoint

func PostTractorMarketGoods

func PostTractorMarketGoods(webapp *web.Web, api *Api) *registry.Endpoint

func ReadJsonInput

func ReadJsonInput[T any](w http.ResponseWriter, r *http.Request, data *T) error

func RegisterApiRoutes

func RegisterApiRoutes(w *web.Web, app_data *appdata.AppData) *web.Web

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
}

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 *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

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"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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