api

package
v1.61.1-a.1 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2025 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const ApiRoute = "/api"

Variables

This section is empty.

Functions

func GetBases added in v1.60.0

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} configs_export.Base @Router /api/npc_bases [get]

func GetHashes added in v1.60.0

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

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

func GetOreFields added in v1.60.0

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} configs_export.Base @Router /api/mining_operations [get]

func GetPoBs added in v1.60.0

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 pobs @Accept json @Produce json @Success 200 {array} configs_export.PoB @Router /api/pobs [get]

func GetPobGoods added in v1.60.0

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

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

func GetShips added in v1.60.0

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

ShowAccount godoc @Summary Getting list of Ships @Tags ships @Accept json @Produce json @Success 200 {array} configs_export.Base @Router /api/ships [get]

func JsonResponseHeader added in v1.56.0

func JsonResponseHeader(w *http.ResponseWriter)

func PostBaseMarketGoods added in v1.60.0

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

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 PostGraphPaths added in v1.54.0

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 graph @Accept json @Produce json @Param request body []api.GraphPathReq true "Request body" @Success 200 {array} api.GraphPathsResp @Router /api/graph/paths [post]

func PostShipMarketGoods added in v1.60.0

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

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 added in v1.60.0

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

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 RegisterApiRoutes

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

func ReturnJson added in v1.56.0

func ReturnJson(w *http.ResponseWriter, data any)

Types

type Api

type Api struct {
	// contains filtered or unexported fields
}

type GraphPathReq added in v1.54.0

type GraphPathReq struct {
	From string `json:"from" example:"li01_01_base"` // Write NPC base nickname, or PoB nickname (Name in base64 encoding) or Ore field name
	To   string `json:"to" example:"br01_01_base"`   // Write NPC base nickname, or PoB nickname (Name in base64 encoding) or Ore field name
}

type GraphPathTime added in v1.54.0

type GraphPathTime struct {
	Transport *cfg.SecondsI `json:"transport"` // time in seconds
	Frigate   *cfg.SecondsI `json:"frigate"`   // time in seconds
	Freighter *cfg.SecondsI `json:"freighter"` // time in seconds
}

type GraphPathsResp added in v1.54.0

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 Hashes

type Hashes struct {
	NicknameToHash map[string]flhash.HashCode `json:"nickname_to_hash"`
}

type MarketGoodResp added in v1.60.0

type MarketGoodResp struct {
	MarketGoods []*configs_export.MarketGood `json:"market_goods"`
	Nickname    string                       `json:"nickname"`
	Error       *string                      `json:"error"`
}

type TechCompatResp added in v1.60.0

type TechCompatResp struct {
	TechCompat *configs_export.DiscoveryTechCompat `json:"tech_compat"`
	Nickname   string                              `json:"nickname"`
	Error      *string                             `json:"error"`
}

Jump to

Keyboard shortcuts

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