LinuxSuRen / LinuxSuRen/api-testing

Add a flag to enable/disable reload mock config automatically

Aperta
#409 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

@yuluo-yx ci sta già lavorando.

Dal 1/5/2024.

enhancement good first issue
Lingua principale
Go
Stelle
369
Fork
67
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.