Goonstation 13 - Modules - TypesVar Details - Proc Details

/datum/apiHandler

Handles queries to the Goonhub APIv2

Vars

apiRetryDelaybase delay between query attempts, gets multiplied by attempt number
debugIs debug logging on? If true, detailed logs for each API request will be logged to debug
emergency_shutoff_counterhow many api errors there have been since a successful one
enabledIs the api handler available for use? only set to false if we try a bunch of times and still fail
lazy_concurrent_counterlazy count of how many are up/down
lazy_waiting_counternumber of how many are waiting
maxApiRetrieshow many times should a query attempt to run before giving up

Procs

apiErrorBuild and throw an error exception
debugLogLog an API request
queryAPIConstructs a query to send to the goonhub web API
retryApiQueryRetries an API query in the event of failure
trackRecentErrorIncrements or resets the recent error counter

Var Details

apiRetryDelay

base delay between query attempts, gets multiplied by attempt number

debug

Is debug logging on? If true, detailed logs for each API request will be logged to debug

emergency_shutoff_counter

how many api errors there have been since a successful one

enabled

Is the api handler available for use? only set to false if we try a bunch of times and still fail

lazy_concurrent_counter

lazy count of how many are up/down

lazy_waiting_counter

number of how many are waiting

maxApiRetries

how many times should a query attempt to run before giving up

Proc Details

apiError

Build and throw an error exception

debugLog

Log an API request

@method (string) HTTP method of the request @route (string) URL of the request @body (string) JSON encoded body of the request if applicable

queryAPI

Constructs a query to send to the goonhub web API

@route (/datum/apiRoute) requested route to call, ex. /datum/apiRoute/players/notes/get @attempt (int) number of times we've attempted this query @return (/datum/apiModel|boolean) model containing parsed data response from api, or boolean indicating success

retryApiQuery

Retries an API query in the event of failure

@route (/datum/apiRoute) requested route to call, ex. /datum/apiRoute/players/notes/get @attempt (int) number of times we've attempted this query @return (/datum/apiModel) model containing parsed data response from api

trackRecentError

Increments or resets the recent error counter

@reset (bool) reset the counter (eg successful request)