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

Improve default configs, allow config http responses #5

Merged
merged 5 commits into from
Apr 27, 2024

Conversation

farzadghanei
Copy link
Owner

@farzadghanei farzadghanei commented Apr 27, 2024

  • move defaults away from runner but to the config itself, use better defaults
  • allow customizing the http mode response via new configurations
  • change shutting down the http server in tests, to use a signal string header instead of counting requests

- Created a new Makefile for build, test, and version control
- Changed cmd/chkok.go to add Version

Makefile included in the file provides an efficient way to handle common
tasks from building, testing to version control.
- Added new fields (`listen_address`, `request_read_timeout`,
  `response_write_timeout`) to `ConfRunner` struct in `conf.go`
- Altered `run_modes.go` to utilise the new fields added in `ConfRunner`
  for HTTP mode. It now uses these configurations if provided or
  defaults if not
- These changes allow user to specify HTTP listen address, read timeout
  and write timeout in the configuration files, providing more control
  over the tool's behavior in HTTP mode.
- Added new function `GetConfRunner` in `internal/conf.go` to return
  configurations for the runner
- Modified `internal/run_modes.go` to accept configurations from
  `GetConfRunner`

These changes were made to allow more flexibility in the configuration
of the runners. Instead of each running mode merging its own
configuations, a merged config is passed to the running mode from the
entrypoint.
Revised `run_modes.go` to stop the HTTP server if the
"X-Server-Shutdown" header value matches the
`shutdownSignalHeaderValue`.
Now it's possible to shutdown the server based on header set in the request
rather than closing after a set number of responses. This provides more
efficiency and control over the server's operations.
- Added `GetDefaultConfRunner` function to establish a base config running.
- Updated tests to verify new changes.
- Allow configuring responses, move defaults to config instead of the
runner
@farzadghanei farzadghanei merged commit d9b2a32 into main Apr 27, 2024
2 checks passed
@farzadghanei farzadghanei deleted the web-runner-configs branch April 27, 2024 14:32
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.

1 participant