diff options
author | Jeffrey Armstrong <jeff@approximatrix.com> | 2021-04-01 20:41:13 -0400 |
---|---|---|
committer | Jeffrey Armstrong <jeff@approximatrix.com> | 2021-04-01 20:41:13 -0400 |
commit | da47fdfddc46e35a939b7771eda21debec50c094 (patch) | |
tree | 0eb9ac1333dd3b17e25eca6c4c96f732da357b89 /captain/api.f90 | |
parent | 3e58313bde5e3e572d84fe014d9902dfb04712c3 (diff) | |
download | levitating-da47fdfddc46e35a939b7771eda21debec50c094.tar.gz levitating-da47fdfddc46e35a939b7771eda21debec50c094.zip |
Started work on API implementation
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 |