Server Querying#
Functions#
- OmniClientRequestId omniClientGetServerInfo(char const *url, void *userData, OmniClientGetServerInfoCallback callback)
Retrieve information about the server for a specified URL.
- OmniClientRequestId omniClientRefreshAuthToken(char const *url, void *userData, OmniClientRefreshAuthTokenCallback callback)
This refreshes the auth token for a given URL.
Structs#
- OmniClientServerInfo
Server information returned by omniClientGetServerInfo .
Typedefs#
- OmniClientGetServerInfoCallback
This is called with the results of omniClientGetServerInfo .
- OmniClientRefreshAuthTokenCallback
This is called with the results of omniClientRefreshAuthToken .
Functions#
- OmniClientRequestId omniClientGetServerInfo(
- char const *url,
- void *userData,
- OmniClientGetServerInfoCallback callback,
Retrieve information about the server for a specified URL.
Note
If this function is called after omniClientShutdown, kInvalidRequestId will be returned, and the callback will not be called.
- Parameters:
url – The URL of the server to get information about
userData – User data passed to the callback
callback – The callback function to register
- Returns:
A request ID that can be used with omniClientStop
- OmniClientRequestId omniClientRefreshAuthToken(
- char const *url,
- void *userData,
- OmniClientRefreshAuthTokenCallback callback,
This refreshes the auth token for a given URL.
Nucleus auth tokens (as received by omniClientGetServerInfo) expire after some time. If you attempt to connect to an external service using that auth token, and Nucleus responds with an error indicating that the token is invalid, you may call this function to refresh the auth token. You will receive a new auth token in the callback (or an error) and all future calls to omniClientGetServerInfo will also return the new auth token.
Note
If this function is called after omniClientShutdown, kInvalidRequestId will be returned, and the callback will not be called.
- Parameters:
url – The URL of the server to refresh the auth token for
userData – User data passed to the callback
callback – The callback function to register
- Returns:
A request ID that can be used with omniClientStop
Typedefs#
-
typedef void (*OmniClientGetServerInfoCallback)(void *userData, OmniClientResult result, struct OmniClientServerInfo const *info)#
This is called with the results of omniClientGetServerInfo.
-
typedef void (*OmniClientRefreshAuthTokenCallback)(void *userData, OmniClientResult result, char const *authToken)#
This is called with the results of omniClientRefreshAuthToken.