Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support composite feature that server supported just by configure file #62

Merged
merged 1 commit into from
Jun 6, 2022

Conversation

alimy
Copy link
Collaborator

@alimy alimy commented Jun 6, 2022

  • support composite feature that server supported just by configure file
  1. pr优化什么?
    补丁优化app配置的使用机制,支持通过配置文件配置app运行时提供哪些功能。
# file: config.yaml
...
Features:
  Default: ["Sms", "Alipay", "Zinc", "MySQL", "Redis", "AliOSS", "LoggerZinc"]
  Develop: ["Zinc", "MySQL", "AliOSS", "LoggerFile"]
  Slim: ["Zinc", "MySQL", "Redis", "AliOSS", "LoggerFile"]
  Sms: "SmsJuhe"
...
SmsJuhe:
  Key:
  TplID:
  TplVal: "#code#=%d&#m#=%d"

如上:在Features section 是配置app的一些功能项配置组合,Default Develop Slim是不同的运行时功能组合,Sms/Alipay/Zinc/MySQL/Redis/AliOSS/LoggerZinc/LoggerFile是目前app程序能提供的功能,通过配置不同的功能组合,在app运行时传参告知运行那种组合,比如:

paoapo-ce

运行默认Default的Features组合;

paopao-ce --no-default-features --features Develop

运行 Develop 的Features组合(cli 选项这个功能后续加上)。

  1. 为什么提供这个功能?
    方便添加不同的功能,比如SQL存储可以支持Postgres/sqlite3, 对象存储可以添加腾讯云/Minio/本地文件等,部署时根据具体环境通过配置文件组合需要的功能并提供对应的配置选项,就可以完成服务部署了, 当然前提是所需要的功能app是已经实现并提供的。

@alimy alimy requested a review from rocboss June 6, 2022 07:07
Copy link
Owner

@rocboss rocboss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job!

@rocboss rocboss merged commit 06c11e2 into rocboss:main Jun 6, 2022
alimy added a commit to alimy/paopao-ce that referenced this pull request Jun 7, 2022
alimy added a commit that referenced this pull request Jun 7, 2022
optimize #62 add command-line support for custom features
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants