LinuxSuRen / LinuxSuRen/api-testing

Add a flag to enable/disable reload mock config automatically

Đang mở
#409 1 bình luận 0 reaction 1 người được giao Xem trên GitHub

@yuluo-yx đang làm issue này rồi.

Từ ngày 1/5/2024.

enhancement good first issue
Ngôn ngữ chính
Go
Star
369
Fork
67
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.