Skip to content

Commit a4d03b9

Browse files
committed
[DOP-37884] Fix programmatic app creation example
1 parent 0cd3ef2 commit a4d03b9

6 files changed

Lines changed: 35 additions & 12 deletions

File tree

data_rentgen/consumer/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@
2222
from data_rentgen.db.factory import session_generator
2323
from data_rentgen.logging.setup_logging import setup_logging
2424

25+
__all__ = [
26+
"ConsumerApplicationSettings",
27+
"application_factory",
28+
"broker_factory",
29+
"get_application",
30+
]
31+
2532
logger = logging.getLogger(__name__)
2633

2734

data_rentgen/http2kafka/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@
2323
PersonalTokenAuthProvider,
2424
)
2525

26+
__all__ = [
27+
"Http2KafkaApplicationSettings",
28+
"application_factory",
29+
"get_application",
30+
]
31+
32+
2633
logger = logging.getLogger(__name__)
2734

2835

data_rentgen/server/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919
if TYPE_CHECKING:
2020
from data_rentgen.server.providers.auth import AuthProvider
2121

22+
__all__ = [
23+
"ServerApplicationSettings",
24+
"application_factory",
25+
"get_application",
26+
]
27+
2228
logger = logging.getLogger(__name__)
2329

2430

mddocs/docs/reference/consumer/index.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,11 @@ Data.Rentgen fetches messages from a [`message-broker`][message-broker] using a
7979

8080
Instead of relying on environment variables, application can also be configured by explicitly building it in Python code:
8181

82-
::: data_rentgen.consumer.application_factory
83-
options:
84-
show_root_heading: true
85-
show_root_full_path: true
82+
```python
83+
from data_rentgen.consumer import application_factory, ConsumerApplicationSettings
84+
85+
app = application_factory(ConsumerApplicationSettings)
86+
```
8687

8788
## See also
8889

mddocs/docs/reference/http2kafka/index.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,11 @@ If this is not possible, http2kafka is the way to go.
9090

9191
Instead of relying on environment variables, application can also be configured by explicitly building it in Python code:
9292

93-
::: data_rentgen.http2kafka.application_factory
94-
options:
95-
show_root_heading: true
96-
show_root_full_path: true
93+
```python
94+
from data_rentgen.http2kafka import application_factory, Http2KafkaApplicationSettings
95+
96+
app = application_factory(Http2KafkaApplicationSettings(...))
97+
```
9798

9899
## See also
99100

mddocs/docs/reference/server/index.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,11 @@ Implemented using [FastAPI](https://fastapi.tiangolo.com/).
7373

7474
Instead of relying on environment variables, application can also be configured by explicitly building it in Python code:
7575

76-
::: data_rentgen.server.application_factory
77-
options:
78-
show_root_heading: true
79-
show_root_full_path: true
76+
```python
77+
from data_rentgen.server import application_factory, ServerApplicationSettings
78+
79+
app = application_factory(ServerApplicationSettings(...))
80+
```
8081

8182
## See also
8283

0 commit comments

Comments
 (0)