title | description | tags | ||
---|---|---|---|---|
Fiber |
A Fiber web server |
|
This project starts a cronjob that retrieves and logs all malware trends on a daily basis.
- Fiber
- Go
- Redis
- Cronjob
- OpenTelemetry send to uptrace
The server code is located in main.go
.
curl -X GET http://localhost:3000/healthzing
Returns: OK
Call the API with curl:
curl -X GET http://localhost:3000/api/v1/trends/all
Returns a slice of JSON objects:
{
"data": [
{
"family": "NAME family",
"total": 18665,
"entries": [
{
"month": 4,
"count": 0
},
{
"month": 5,
"count": 0
},
[...]
]
},
{
"family": "NAME family",
"total": 19841,
"entries": [
{
"month": 4,
"count": 99
},
{
"month": 5,
"count": 165
},
[...]
]
},
[...]
]
}
Call the API with curl:
curl -X GET http://localhost:3000/api/v1/trends/version
Returns a slice of JSON objects:
{"version":31}
If the {end} is larger than the number of trends, it will be adjusted to the number of trends
Call the API with curl:
curl -X GET http://localhost:3000/api/v1/trends/0/2
Returns a slice of JSON objects:
{
"data": [
{
"family": "NAME family",
"total": 18665,
"entries": [
{
"month": 4,
"count": 0
},
{
"month": 5,
"count": 0
},
[...]
]
},
{
"family": "NAME family",
"total": 19841,
"entries": [
{
"month": 4,
"count": 99
},
{
"month": 5,
"count": 165
},
[...]
]
},
[...]
]
}