/datum/apiHandler 
Handles queries to the Goonhub APIv2
Vars | |
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 |
Procs | |
apiError | Build and throw an error exception |
debugLogRequest | Log an API request |
debugLogResponse | Log an API response |
queryAPI | Constructs a query to send to the goonhub web API |
retryApiQuery | Retries an API query in the event of failure |
trackRecentError | Increments 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
debugLogRequest
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
debugLogResponse
Log an API response
@method (string) HTTP method of the request @route (string) URL of the request @body (string) JSON encoded body of the response @headers (list) Response headers @status (int) Response status code
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)