python-dependency-injector/tests/unit/samples/schemasample/container-multiple-reordered.yml
2021-03-19 20:36:49 -04:00

44 lines
1015 B
YAML

version: "1"
container:
services:
user:
provider: Factory
provides: schemasample.services.UserService
kwargs:
db: container.gateways.database_client
auth:
provider: Factory
provides: schemasample.services.AuthService
kwargs:
db: container.gateways.database_client
token_ttl: container.core.config.auth.token_ttl.as_int()
photo:
provider: Factory
provides: schemasample.services.PhotoService
kwargs:
db: container.gateways.database_client
s3: container.gateways.s3_client
gateways:
database_client:
provider: Singleton
provides: sqlite3.connect
args:
- container.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
core:
config:
provider: Configuration