API Config Parser¶
- File location
Bundled implementation:
source/client/python/cfgparser.pyCluster implementation:
cluster/app/source/python/cfgparser.py
Dataclasses¶
-
class
cfgparser.API¶ A dataclass for parsed API entry.
Sharing identifier, i.e. which MIME type the API entry is shared with.
-
inited= multiprocessing.Value('B', False)¶ Initied flag.
-
locked: multiprocessing.Lock¶ Multiprocessing runtime lock.
Functions¶
-
cfgparser.parse_cmd(context: Dict[str, Any], mimetype: str, environ: Dict[str, Any])¶ Parse API of
mimetype.- Parameters
context – API configuration context.
mimetype (str) – MIME type of the API.
environ – Global environment variables.
- Raises
ReportNotFoundError – If
reportsection not presented incontext.
Constants¶
-
cfgparser.MEDIA_TYPE: Tuple[str]¶ ('application', 'audio', # 'example', ## preserved for default API 'font', 'image', 'message', 'model', 'multipart', 'text', 'video')
Possible media types.
-
cfgparser.API_LOCK: Dict[str, multiprocessing.Lock]¶ Database for multiprocessing lock.