Providers¶
Define an alternate way to retrieve the query responses.
Interface¶
- class starmap_client.providers.StarmapProvider[source]¶
- Define the interface for a local mappings provider. - api = 'default'¶
- The provider’s API level implementation. 
 - abstract query(params)[source]¶
- Retrieve the mapping without using the server. - It relies in the local provider to retrieve the correct mapping according to the parameters. 
 
Implementations¶
Memory Based¶
APIv2¶
- class starmap_client.providers.InMemoryMapProviderV2(container, *args, **kwargs)[source]¶
- Provide in memory (RAM) QueryResponseContainer objects for APIv2. - __init__(container, *args, **kwargs)[source]¶
- Crete a new InMemoryMapProvider object. - Parameters:
- container (QueryResponseContainer) – QueryResponseContainer object to load into memory. It will be used by query to return the correct response based on name and workflow. 
 
 - query(params)[source]¶
- Retrieve the mapping without using the server. - It relies in the local provider to retrieve the correct mappings according to the parameters. - Parameters:
- params (dict) – The request params to retrieve the mapping. 
- Return type:
- Returns:
- The requested container with mappings when found.