aury-boot 0.0.4__py3-none-any.whl → 0.0.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aury/boot/__init__.py +2 -2
- aury/boot/_version.py +2 -2
- aury/boot/application/__init__.py +60 -36
- aury/boot/application/adapter/__init__.py +112 -0
- aury/boot/application/adapter/base.py +511 -0
- aury/boot/application/adapter/config.py +242 -0
- aury/boot/application/adapter/decorators.py +259 -0
- aury/boot/application/adapter/exceptions.py +202 -0
- aury/boot/application/adapter/http.py +325 -0
- aury/boot/application/app/__init__.py +12 -8
- aury/boot/application/app/base.py +12 -0
- aury/boot/application/app/components.py +137 -44
- aury/boot/application/app/middlewares.py +9 -4
- aury/boot/application/app/startup.py +249 -0
- aury/boot/application/config/__init__.py +36 -1
- aury/boot/application/config/multi_instance.py +216 -0
- aury/boot/application/config/settings.py +398 -149
- aury/boot/application/constants/components.py +6 -0
- aury/boot/application/errors/handlers.py +17 -3
- aury/boot/application/middleware/logging.py +21 -120
- aury/boot/application/rpc/__init__.py +2 -2
- aury/boot/commands/__init__.py +30 -10
- aury/boot/commands/app.py +131 -1
- aury/boot/commands/docs.py +104 -17
- aury/boot/commands/generate.py +22 -22
- aury/boot/commands/init.py +68 -17
- aury/boot/commands/server/app.py +2 -3
- aury/boot/commands/templates/project/AGENTS.md.tpl +221 -0
- aury/boot/commands/templates/project/README.md.tpl +2 -2
- aury/boot/commands/templates/project/aury_docs/00-overview.md.tpl +59 -0
- aury/boot/commands/templates/project/aury_docs/01-model.md.tpl +184 -0
- aury/boot/commands/templates/project/aury_docs/02-repository.md.tpl +206 -0
- aury/boot/commands/templates/project/aury_docs/03-service.md.tpl +398 -0
- aury/boot/commands/templates/project/aury_docs/04-schema.md.tpl +95 -0
- aury/boot/commands/templates/project/aury_docs/05-api.md.tpl +116 -0
- aury/boot/commands/templates/project/aury_docs/06-exception.md.tpl +118 -0
- aury/boot/commands/templates/project/aury_docs/07-cache.md.tpl +122 -0
- aury/boot/commands/templates/project/aury_docs/08-scheduler.md.tpl +32 -0
- aury/boot/commands/templates/project/aury_docs/09-tasks.md.tpl +38 -0
- aury/boot/commands/templates/project/aury_docs/10-storage.md.tpl +115 -0
- aury/boot/commands/templates/project/aury_docs/11-logging.md.tpl +131 -0
- aury/boot/commands/templates/project/aury_docs/12-admin.md.tpl +56 -0
- aury/boot/commands/templates/project/aury_docs/13-channel.md.tpl +104 -0
- aury/boot/commands/templates/project/aury_docs/14-mq.md.tpl +102 -0
- aury/boot/commands/templates/project/aury_docs/15-events.md.tpl +147 -0
- aury/boot/commands/templates/project/aury_docs/16-adapter.md.tpl +403 -0
- aury/boot/commands/templates/project/{CLI.md.tpl → aury_docs/99-cli.md.tpl} +19 -19
- aury/boot/commands/templates/project/config.py.tpl +10 -10
- aury/boot/commands/templates/project/env_templates/_header.tpl +10 -0
- aury/boot/commands/templates/project/env_templates/admin.tpl +49 -0
- aury/boot/commands/templates/project/env_templates/cache.tpl +14 -0
- aury/boot/commands/templates/project/env_templates/database.tpl +22 -0
- aury/boot/commands/templates/project/env_templates/log.tpl +18 -0
- aury/boot/commands/templates/project/env_templates/messaging.tpl +46 -0
- aury/boot/commands/templates/project/env_templates/rpc.tpl +28 -0
- aury/boot/commands/templates/project/env_templates/scheduler.tpl +18 -0
- aury/boot/commands/templates/project/env_templates/service.tpl +18 -0
- aury/boot/commands/templates/project/env_templates/storage.tpl +38 -0
- aury/boot/commands/templates/project/env_templates/third_party.tpl +43 -0
- aury/boot/commands/templates/project/modules/tasks.py.tpl +1 -1
- aury/boot/common/logging/__init__.py +26 -674
- aury/boot/common/logging/context.py +132 -0
- aury/boot/common/logging/decorators.py +118 -0
- aury/boot/common/logging/format.py +315 -0
- aury/boot/common/logging/setup.py +214 -0
- aury/boot/contrib/admin_console/auth.py +2 -3
- aury/boot/contrib/admin_console/install.py +1 -1
- aury/boot/domain/models/mixins.py +48 -1
- aury/boot/domain/pagination/__init__.py +94 -0
- aury/boot/domain/repository/impl.py +1 -1
- aury/boot/domain/repository/interface.py +1 -1
- aury/boot/domain/transaction/__init__.py +8 -9
- aury/boot/infrastructure/__init__.py +86 -29
- aury/boot/infrastructure/cache/backends.py +102 -18
- aury/boot/infrastructure/cache/base.py +12 -0
- aury/boot/infrastructure/cache/manager.py +153 -91
- aury/boot/infrastructure/channel/__init__.py +24 -0
- aury/boot/infrastructure/channel/backends/__init__.py +9 -0
- aury/boot/infrastructure/channel/backends/memory.py +83 -0
- aury/boot/infrastructure/channel/backends/redis.py +88 -0
- aury/boot/infrastructure/channel/base.py +92 -0
- aury/boot/infrastructure/channel/manager.py +203 -0
- aury/boot/infrastructure/clients/__init__.py +22 -0
- aury/boot/infrastructure/clients/rabbitmq/__init__.py +9 -0
- aury/boot/infrastructure/clients/rabbitmq/config.py +46 -0
- aury/boot/infrastructure/clients/rabbitmq/manager.py +288 -0
- aury/boot/infrastructure/clients/redis/__init__.py +28 -0
- aury/boot/infrastructure/clients/redis/config.py +51 -0
- aury/boot/infrastructure/clients/redis/manager.py +264 -0
- aury/boot/infrastructure/database/config.py +7 -16
- aury/boot/infrastructure/database/manager.py +16 -38
- aury/boot/infrastructure/events/__init__.py +18 -21
- aury/boot/infrastructure/events/backends/__init__.py +11 -0
- aury/boot/infrastructure/events/backends/memory.py +86 -0
- aury/boot/infrastructure/events/backends/rabbitmq.py +193 -0
- aury/boot/infrastructure/events/backends/redis.py +162 -0
- aury/boot/infrastructure/events/base.py +127 -0
- aury/boot/infrastructure/events/manager.py +224 -0
- aury/boot/infrastructure/mq/__init__.py +24 -0
- aury/boot/infrastructure/mq/backends/__init__.py +9 -0
- aury/boot/infrastructure/mq/backends/rabbitmq.py +179 -0
- aury/boot/infrastructure/mq/backends/redis.py +167 -0
- aury/boot/infrastructure/mq/base.py +143 -0
- aury/boot/infrastructure/mq/manager.py +239 -0
- aury/boot/infrastructure/scheduler/manager.py +7 -3
- aury/boot/infrastructure/storage/__init__.py +9 -9
- aury/boot/infrastructure/storage/base.py +17 -5
- aury/boot/infrastructure/storage/factory.py +0 -1
- aury/boot/infrastructure/tasks/__init__.py +2 -2
- aury/boot/infrastructure/tasks/config.py +5 -13
- aury/boot/infrastructure/tasks/manager.py +55 -33
- {aury_boot-0.0.4.dist-info → aury_boot-0.0.7.dist-info}/METADATA +20 -2
- aury_boot-0.0.7.dist-info/RECORD +197 -0
- aury/boot/commands/templates/project/DEVELOPMENT.md.tpl +0 -1397
- aury/boot/commands/templates/project/env.example.tpl +0 -213
- aury/boot/infrastructure/events/bus.py +0 -362
- aury/boot/infrastructure/events/config.py +0 -52
- aury/boot/infrastructure/events/consumer.py +0 -134
- aury/boot/infrastructure/events/models.py +0 -63
- aury_boot-0.0.4.dist-info/RECORD +0 -137
- {aury_boot-0.0.4.dist-info → aury_boot-0.0.7.dist-info}/WHEEL +0 -0
- {aury_boot-0.0.4.dist-info → aury_boot-0.0.7.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
# =============================================================================
|
|
3
|
+
# 调度器配置 (SCHEDULER__)
|
|
4
|
+
# =============================================================================
|
|
5
|
+
# 是否在 API 服务中启用内嵌调度器
|
|
6
|
+
# SCHEDULER__ENABLED=true
|
|
7
|
+
# 定时任务模块列表(为空时自动发现 schedules 模块)
|
|
8
|
+
# SCHEDULER__SCHEDULE_MODULES=[]
|
|
9
|
+
|
|
10
|
+
# =============================================================================
|
|
11
|
+
# 任务队列配置 (TASK__)
|
|
12
|
+
# =============================================================================
|
|
13
|
+
# 任务队列代理 URL(如 Redis 或 RabbitMQ)
|
|
14
|
+
# TASK__BROKER_URL=redis://localhost:6379/1
|
|
15
|
+
# 最大重试次数
|
|
16
|
+
# TASK__MAX_RETRIES=3
|
|
17
|
+
# 任务超时时间(秒)
|
|
18
|
+
# TASK__TIMEOUT=3600
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
# =============================================================================
|
|
3
|
+
# 服务配置 (SERVICE__)
|
|
4
|
+
# =============================================================================
|
|
5
|
+
# 服务名称,用于日志目录区分
|
|
6
|
+
SERVICE__NAME={project_name_snake}
|
|
7
|
+
# 服务类型: api / worker
|
|
8
|
+
# SERVICE__TYPE=api
|
|
9
|
+
|
|
10
|
+
# =============================================================================
|
|
11
|
+
# 服务器配置 (SERVER__)
|
|
12
|
+
# =============================================================================
|
|
13
|
+
# SERVER__HOST=*********
|
|
14
|
+
# SERVER__PORT=8000
|
|
15
|
+
# 工作进程数(生产环境建议设为 CPU 核心数)
|
|
16
|
+
# SERVER__WORKERS=1
|
|
17
|
+
# 是否启用热重载(生产环境应设为 false)
|
|
18
|
+
# SERVER__RELOAD=true
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
|
|
2
|
+
# =============================================================================
|
|
3
|
+
# 数据库迁移配置 (MIGRATION__)
|
|
4
|
+
# =============================================================================
|
|
5
|
+
# Alembic 配置文件路径
|
|
6
|
+
# MIGRATION__CONFIG_PATH=alembic.ini
|
|
7
|
+
# Alembic 迁移脚本目录
|
|
8
|
+
# MIGRATION__SCRIPT_LOCATION=migrations
|
|
9
|
+
# 是否自动创建迁移配置和目录
|
|
10
|
+
# MIGRATION__AUTO_CREATE=true
|
|
11
|
+
|
|
12
|
+
# =============================================================================
|
|
13
|
+
# 对象存储配置 (STORAGE__) - 基于 aury-sdk-storage
|
|
14
|
+
# =============================================================================
|
|
15
|
+
# 是否启用存储组件
|
|
16
|
+
# STORAGE__ENABLED=true
|
|
17
|
+
# 存储类型: local / s3 / cos / oss
|
|
18
|
+
# STORAGE__TYPE=local
|
|
19
|
+
#
|
|
20
|
+
# 本地存储(开发环境)
|
|
21
|
+
# STORAGE__BASE_PATH=./storage
|
|
22
|
+
#
|
|
23
|
+
# S3/COS/OSS 通用配置
|
|
24
|
+
# STORAGE__ACCESS_KEY_ID=AKIDxxxxx
|
|
25
|
+
# STORAGE__ACCESS_KEY_SECRET=xxxxx
|
|
26
|
+
# STORAGE__SESSION_TOKEN=
|
|
27
|
+
# STORAGE__ENDPOINT=https://cos.ap-guangzhou.myqcloud.com
|
|
28
|
+
# STORAGE__REGION=ap-guangzhou
|
|
29
|
+
# STORAGE__BUCKET_NAME=my-bucket-1250000000
|
|
30
|
+
# STORAGE__ADDRESSING_STYLE=virtual
|
|
31
|
+
#
|
|
32
|
+
# STS AssumeRole(可选,服务端自动刷新凭证)
|
|
33
|
+
# STORAGE__ROLE_ARN=
|
|
34
|
+
# STORAGE__ROLE_SESSION_NAME=aury-storage
|
|
35
|
+
# STORAGE__EXTERNAL_ID=
|
|
36
|
+
# STORAGE__STS_ENDPOINT=
|
|
37
|
+
# STORAGE__STS_REGION=
|
|
38
|
+
# STORAGE__STS_DURATION_SECONDS=3600
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
|
|
2
|
+
# =============================================================================
|
|
3
|
+
# 第三方接口适配器配置 (THIRD_PARTY__)
|
|
4
|
+
# =============================================================================
|
|
5
|
+
# 用于配置支付、短信、微信等第三方接口的模式切换和挡板设置
|
|
6
|
+
# 格式: THIRD_PARTY__{{ADAPTER_NAME}}__{{FIELD}}
|
|
7
|
+
#
|
|
8
|
+
# 模式说明:
|
|
9
|
+
# - real: 真实调用第三方接口(生产环境)
|
|
10
|
+
# - sandbox: 调用第三方沙箱环境(如果有)
|
|
11
|
+
# - mock: 使用本地挡板实现,不发出真实请求(测试/开发环境)
|
|
12
|
+
# - disabled: 禁用该接口,调用时抛出 AdapterDisabledError
|
|
13
|
+
#
|
|
14
|
+
# ---------- 支付接口示例 (PAYMENT) ----------
|
|
15
|
+
# THIRD_PARTY__PAYMENT__ENABLED=true
|
|
16
|
+
# THIRD_PARTY__PAYMENT__MODE=mock
|
|
17
|
+
# THIRD_PARTY__PAYMENT__BASE_URL=https://api.payment.com/v1
|
|
18
|
+
# THIRD_PARTY__PAYMENT__SANDBOX_URL=https://sandbox.payment.com/v1
|
|
19
|
+
# THIRD_PARTY__PAYMENT__API_KEY=sk_live_xxx
|
|
20
|
+
# THIRD_PARTY__PAYMENT__API_SECRET=
|
|
21
|
+
# THIRD_PARTY__PAYMENT__TIMEOUT=30
|
|
22
|
+
# THIRD_PARTY__PAYMENT__RETRY_TIMES=3
|
|
23
|
+
# THIRD_PARTY__PAYMENT__METHOD_MODES={"query": "real", "refund": "disabled"}
|
|
24
|
+
# THIRD_PARTY__PAYMENT__MOCK_STRATEGY=success
|
|
25
|
+
# THIRD_PARTY__PAYMENT__MOCK_DELAY=0.1
|
|
26
|
+
# THIRD_PARTY__PAYMENT__MOCK_DEFAULT_RESPONSE={"success": true, "mock": true}
|
|
27
|
+
#
|
|
28
|
+
# ---------- 短信接口示例 (SMS) ----------
|
|
29
|
+
# THIRD_PARTY__SMS__ENABLED=true
|
|
30
|
+
# THIRD_PARTY__SMS__MODE=mock
|
|
31
|
+
# THIRD_PARTY__SMS__BASE_URL=https://sms.aliyuncs.com
|
|
32
|
+
# THIRD_PARTY__SMS__API_KEY=LTAI5xxx
|
|
33
|
+
# THIRD_PARTY__SMS__API_SECRET=xxx
|
|
34
|
+
# THIRD_PARTY__SMS__TIMEOUT=10
|
|
35
|
+
# THIRD_PARTY__SMS__MOCK_STRATEGY=success
|
|
36
|
+
# THIRD_PARTY__SMS__MOCK_DEFAULT_RESPONSE={"code": "OK", "message": "mock sent"}
|
|
37
|
+
#
|
|
38
|
+
# ---------- 微信接口示例 (WECHAT) ----------
|
|
39
|
+
# THIRD_PARTY__WECHAT__ENABLED=true
|
|
40
|
+
# THIRD_PARTY__WECHAT__MODE=mock
|
|
41
|
+
# THIRD_PARTY__WECHAT__BASE_URL=https://api.weixin.qq.com
|
|
42
|
+
# THIRD_PARTY__WECHAT__TIMEOUT=15
|
|
43
|
+
# THIRD_PARTY__WECHAT__EXTRA={"appid": "wx123", "secret": "xxx"}
|