LinuxSuRen / LinuxSuRen/api-testing

Add a flag to enable/disable reload mock config automatically

未关闭
#409 1 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@yuluo-yx 已经在做这个了。

开始于 2024年5月1日。

enhancement good first issue
主要语言
Go
星标
369
派生
67
PR 合并指标
30 天内没有已合并 PR

描述

The [Mock Server](https://github.com/LinuxSuRen/api-testing/blob/ffac34fd9dc373bb5a2c7b56f54fae2efd52ebf4/cmd/mock.go) can only read the config at the startup stage. Users need to restart it if they modified the config file content.

## Solution
Support to watch the changes of the mock config file. And provide a flag to enable or disable this feature. The usage might be:

```shell
atest mock --files demo-server.yaml --auto-reload [true|false]
```

And I prefer setting the flag value `--auto-reload` to be `false`.
## References
* https://medium.com/@skdomino/watch-this-file-watching-in-go-5b5a247cf71f

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。