mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-23 18:13:56 +03:00
59 lines
1.4 KiB
YAML
59 lines
1.4 KiB
YAML
|
version: "1"
|
||
|
|
||
|
container:
|
||
|
|
||
|
core:
|
||
|
config:
|
||
|
provider: Configuration
|
||
|
|
||
|
gateways:
|
||
|
database_client:
|
||
|
provider: Singleton
|
||
|
provides: sqlite3.connect
|
||
|
args:
|
||
|
- provider: Callable
|
||
|
provides: schemasample.utils.return_
|
||
|
args:
|
||
|
- container.core.config.database.dsn
|
||
|
|
||
|
s3_client:
|
||
|
provider: Singleton
|
||
|
provides: boto3.client
|
||
|
kwargs:
|
||
|
service_name: s3
|
||
|
aws_access_key_id: container.core.config.aws.access_key_id
|
||
|
aws_secret_access_key: container.core.config.aws.secret_access_key
|
||
|
|
||
|
services:
|
||
|
user:
|
||
|
provider: Factory
|
||
|
provides: schemasample.services.UserService
|
||
|
kwargs:
|
||
|
db:
|
||
|
provider: Callable
|
||
|
provides: schemasample.utils.return_
|
||
|
args:
|
||
|
- container.gateways.database_client
|
||
|
|
||
|
auth:
|
||
|
provider: Factory
|
||
|
provides: schemasample.services.AuthService
|
||
|
kwargs:
|
||
|
db:
|
||
|
provider: Callable
|
||
|
provides: schemasample.utils.return_
|
||
|
args:
|
||
|
- container.gateways.database_client
|
||
|
token_ttl: container.core.config.auth.token_ttl.as_int()
|
||
|
|
||
|
photo:
|
||
|
provider: Factory
|
||
|
provides: schemasample.services.PhotoService
|
||
|
kwargs:
|
||
|
db:
|
||
|
provider: Callable
|
||
|
provides: schemasample.utils.return_
|
||
|
args:
|
||
|
- container.gateways.database_client
|
||
|
s3: container.gateways.s3_client
|