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