tlc.service.object_service
¶
The 3LC Object Service.
Module Contents¶
Classes¶
Class |
Description |
---|---|
Constants for the Litestar state. |
|
Custom middleware to log object service requests and responses. |
|
Helper class to format output from NGrokHelper for the Object Service. |
Functions¶
Function |
Description |
---|---|
Catch-all for application errors. |
|
Handler for insufficient credits. |
|
Handler for timestamp skew. |
|
Setup HTTP client for connecting to 3LC Data Service |
|
Perform any required cleanup before terminating the application |
|
Root endpoint of the service |
|
Endpoint for checking if the service is running. |
|
Returns status of the service |
|
Returns status of the service |
|
Data¶
Data |
Description |
---|---|
API¶
- class LitestarStateConstants¶
Constants for the Litestar state.
- HOST_IP = HostIP¶
- OBJECT_SERVICE_RUNNING_URLS = ObjectServiceRunningsURLs¶
- NGROK_OBJECT_SERVICE_URL = NGrokObjectServiceURL¶
- insufficient_credits_handler(
- request: Request,
- exception: tlcsaas.transaction.InsufficientCredits,
Handler for insufficient credits.
- timestamp_skew_handler(
- request: Request,
- exception: TimestampSkewException,
Handler for timestamp skew.
- async shutdown(
- app: Litestar,
Perform any required cleanup before terminating the application
- class ObjectServiceFeatures(
- /,
- **data: typing.Any,
Bases:
pydantic.BaseModel
- class ObjectServiceUserInfo(
- /,
- **data: typing.Any,
Bases:
pydantic.BaseModel
- class DashboardAnnotations(
- /,
- **data: typing.Any,
Bases:
pydantic.BaseModel
- class TLCCustomLoggingMiddleware(
- app: litestar.types.ASGIApp,
- config: LoggingMiddlewareConfig,
Bases:
litestar.middleware.logging.LoggingMiddleware
Custom middleware to log object service requests and responses.
Logs request and response data to loglevel.INFO, together with the time it takes to complete the request.
Initialize
LoggingMiddleware
.Args: app: The
next
ASGI app to call. config: An instance of LoggingMiddlewareConfig.
- class NGrokOutputAdaptor(
- role: str,
- ngrok_helper: tlccli.subcommands.ngrok_helper.NGrokHelper,
Helper class to format output from NGrokHelper for the Object Service.
- T = TypeVar(...)¶
- create_litestar_app(
- host: str,
- port: int,
- use_ngrok: bool,
- dashboard: bool = False,
- after_startup_handler: list[litestar.types.callable_types.LifespanHook] | litestar.types.callable_types.LifespanHook | None = None,
- after_shutdown_handler: list[litestar.types.callable_types.LifespanHook] | litestar.types.callable_types.LifespanHook | None = None,