4 Dynamic
(require (planet gh/gapi:1:=2/dynamic)) |
Another way to use the API discovery service is to query it at runtime, or to parse a locally-stored discovery file at runtime. This may be desirable if you want to be able to discover newly-added services, for example.
A service? is a jsexpr? to which procedures have been added.
procedure
(discovery-document->service discovery-document) → service?
discovery-document : jsexpr?
procedure
(local-discovery-document->service filename) → service?
filename : (or/c symbol? path-string?)
If filename is a symbol?, then the file is looked for in the vendor subdirectory of the PLaneT cache. (This is very roughly similar to doing a normal Racket require using a symbol vs. a string. The symbol version means, "look in a standard place".)
procedure
(online-discovery-document->service name ver) → service? name : string? ver : string?
procedure
(method-proc service resource-name method-name) → procedure? service : service? resource-name : symbol? method-name : symbol?
The procedure returned by method-proc is like that created by require-gapi-doc; see that for more information.