Documentation ¶
Index ¶
- Constants
- func JsonResponseHeader(w *http.ResponseWriter)
- func NewEndpointBases(webapp *web.Web, api *Api) *registry.Endpoint
- func NewEndpointHashes(webapp *web.Web, api *Api) *registry.Endpoint
- func NewEndpointOreFields(webapp *web.Web, api *Api) *registry.Endpoint
- func NewEndpointPoBGoods(webapp *web.Web, api *Api) *registry.Endpoint
- func NewEndpointPoBs(webapp *web.Web, api *Api) *registry.Endpoint
- func PostGraphPaths(webapp *web.Web, api *Api) *registry.Endpoint
- func RegisterApiRoutes(w *web.Web, app_data *router.AppData) *web.Web
- func ReturnJson(w *http.ResponseWriter, data any)
- type Api
- type GraphPathReq
- type GraphPathTime
- type GraphPathsResp
- type Hashes
Constants ¶
const ApiRoute = "/api"
Variables ¶
This section is empty.
Functions ¶
func JsonResponseHeader ¶ added in v1.56.0
func JsonResponseHeader(w *http.ResponseWriter)
func NewEndpointBases ¶ added in v1.55.0
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 NewEndpointHashes ¶
ShowAccount godoc @Summary Hashes @Tags hashes @Accept json @Produce json @Success 200 {object} api.Hashes @Router /api/hashes [get]
func NewEndpointOreFields ¶ added in v1.55.0
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 NewEndpointPoBGoods ¶
ShowAccount godoc @Summary PoB Goods @Tags pobs @Accept json @Produce json @Success 200 {array} configs_export.PoBGood @Router /api/pob_goods [get]
func NewEndpointPoBs ¶
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 PostGraphPaths ¶ added in v1.54.0
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 ReturnJson ¶ added in v1.56.0
func ReturnJson(w *http.ResponseWriter, data any)
Types ¶
type GraphPathReq ¶ added in v1.54.0
type GraphPathTime ¶ added in v1.54.0
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 }