diff options
Diffstat (limited to 'captain/api.f90')
-rw-r--r-- | captain/api.f90 | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/captain/api.f90 b/captain/api.f90 new file mode 100644 index 0000000..025251d --- /dev/null +++ b/captain/api.f90 @@ -0,0 +1,51 @@ +module api_handling +implicit none + +contains + + function api_request_gemini(req) result(resp) + use server_response + implicit none + + type(request), intent(in)::req + type(response)::resp + + integer::i + + ! Complete - "/api/player/{name}/job/{jobid}/complete" + ! Failed - "/api/player/{name}/job/{jobid}/failed" + ! Task - "/api/player/{name}/job/{jobid}/task/{task num}" + if(trim(req%component(2)) == "player" .and. trim(req%component(4)) == "job") then + if(trim(req%component(6)) == "complete") then + + end if + end if + + + end function api_request_gemini + + function api_request_titan(req) result(resp) + use server_response + implicit none + + type(request), intent(in)::req + type(response)::resp + + end function api_request_titan + + function api_request(req) result(resp) + use server_response + implicit none + + type(request), intent(in)::req + type(response)::resp + + if(req%protocol == "gemini") then + resp = api_request_gemini(req) + else if(req%protocol == "titan") then + resp = api_request_titan(req) + end if + + end function api_request + +end module api_handling
\ No newline at end of file |