https://github.com/scorphus/myhttp
go get github.com/scorphus/myhttp
https://github.com/scorphus/myhttp
http-client
Last synced: about 1 year ago
JSON representation
go get github.com/scorphus/myhttp
- Host: GitHub
- URL: https://github.com/scorphus/myhttp
- Owner: scorphus
- License: other
- Created: 2020-06-03T23:40:57.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-10T15:15:32.000Z (about 6 years ago)
- Last Synced: 2024-04-16T03:30:40.560Z (about 2 years ago)
- Topics: http-client
- Language: Go
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MyHTTP
MyHTTP makes http requests and prints the address of the request along with
the MD5 hash of the response.
## Requirements
- Go 1.10 or more recent
- Make (*optional*)
## Installing
```
go get github.com/scorphus/myhttp
```
Once installed, you'll find `myhttp` on your `$PATH`, assuming you [installed
and configured Go accordingly](https://golang.org/doc/install).
## Building
[Makefile](Makefile) offers a handy `build` target:
```
make build
```
This target builds the application with the following command:
```
go build -x -v -race
```
## Running
Once built, you can find the `myhttp` executable in the current directory.
```
$ ./myhttp --help
Usage: myhttp [flags] [url ...]
-parallel int
limit the number of parallel requests (default 10)
```
### Exempli gratia
```
$ ./myhttp globo.com dw.com debian.org
http://debian.org ab590dac91d0850169462c9fad24c4d3
http://dw.com dfeb459761932def97ea0bf633bba56a
http://globo.com a4148052ca14220a8637622d5c5aa7a3
```
Using `parallel`:
```
$ ./myhttp -parallel 2 globo.com dw.com debian.org
http://dw.com dfeb459761932def97ea0bf633bba56a
http://globo.com a4148052ca14220a8637622d5c5aa7a3
http://debian.org ab590dac91d0850169462c9fad24c4d3
```
## Testing
> **Note**: some tests fail with Go < 1.14
[Makefile](Makefile) also has targets to run tests:
```
make test
```
To run tests and display test coverage on the console:
```
make cover
```
To run tests and display test coverage on the console and on a browser:
```
make cover-html
```
> *p.s.: run `make list` to list all available targets*
## License
Code in this repository is distributed under the terms of the 3-Clause BSD
License (BSD-3-Clause).
See [LICENSE](LICENSE) for details.