python-dependency-injector/tests/unit/samples/schemasample/container-single.yml

40 lines
908 B
YAML
Raw Normal View History

2021-02-24 02:03:09 +03:00
version: "1"
2021-02-26 20:44:53 +03:00
container:
2021-02-24 02:03:09 +03:00
config:
provider: Configuration
database_client:
provider: Singleton
provides: sqlite3.connect
args:
2021-02-26 20:44:53 +03:00
- container.config.database.dsn
2021-02-24 02:03:09 +03:00
s3_client:
provider: Singleton
provides: boto3.client
kwargs:
service_name: s3
2021-02-26 20:44:53 +03:00
aws_access_key_id: container.config.aws.access_key_id
aws_secret_access_key: container.config.aws.secret_access_key
2021-02-24 02:03:09 +03:00
user_service:
provider: Factory
provides: schemasample.services.UserService
kwargs:
2021-02-26 20:44:53 +03:00
db: container.database_client
2021-02-24 02:03:09 +03:00
auth_service:
provider: Factory
provides: schemasample.services.AuthService
kwargs:
2021-02-26 20:44:53 +03:00
db: container.database_client
token_ttl: container.config.auth.token_ttl.as_int()
2021-02-24 02:03:09 +03:00
photo_service:
provider: Factory
provides: schemasample.services.PhotoService
kwargs:
2021-02-26 20:44:53 +03:00
db: container.database_client
s3: container.s3_client