https://github.com/fredwangwang/testing-service
A Micro service useful for testing
https://github.com/fredwangwang/testing-service
Last synced: 12 months ago
JSON representation
A Micro service useful for testing
- Host: GitHub
- URL: https://github.com/fredwangwang/testing-service
- Owner: fredwangwang
- License: mit
- Created: 2021-04-07T21:34:17.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-09-28T14:05:35.000Z (over 4 years ago)
- Last Synced: 2025-03-30T02:44:05.944Z (about 1 year ago)
- Language: Go
- Size: 41 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# testing-service
A Micro service useful for testing, docker: https://hub.docker.com/r/fredwanghuan/testing-service
## Endpoints
### /
root path, indicates it is running
```
curl localhost:8000
if you see this page, at least something is working
```
### /v0/hc
#### GET
returns hc status code, default `200`
```
curl localhost:8000/v0/hc
this is the hc response with status code: 200
```
#### POST
set hc status code
```
curl -X POST 'localhost:8000/v0/hc?status=500'
hc status code set to: 500
```
### /v0/fib
calculate fib sequence the slow way
```
time curl localhost:8000/v0/fib/45
1134903170
curl localhost:8000/v0/fib/45 0.00s user 0.00s system 0% cpu 6.506 total
```
### /v0/control
control what to do
```
time curl 'localhost:8000/v0/control?response_code=233&response_body=helloworld&response_delay=2s'
helloworld
curl 0.00s user 0.00s system 0% cpu 2.009 total
```
### /v0/reflect
prints what its given
```
curl localhost:8000/v0/reflect/hello
Method:
GET
Headers:
User-Agent: []string{"curl/7.68.0"}
Accept: []string{"*/*"}
Path:
/v0/reflect/hello
Query Params:
Body:
```