Skip to content

A cron job that retrieves and logs all malware trends on a daily basis

Notifications You must be signed in to change notification settings

sosan/cronjob-malware-frontend

Repository files navigation

title description tags
Fiber
A Fiber web server
fiber
golang

Project

This project starts a cronjob that retrieves and logs all malware trends on a daily basis.

✨ Features

  • Fiber
  • Go
  • Redis
  • Cronjob
  • OpenTelemetry send to uptrace

📝 Notes

The server code is located in main.go.

RESTful Routes

GET /healthzing - Health check 200 return

curl -X GET http://localhost:3000/healthzing

Returns: OK

GET /api/v1/trends/all - Get all trends

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
        },
        [...]
      ]
    },
    [...]
  ]
}

GET /api/v1/trends/version - Get current version trends

Call the API with curl:

curl -X GET http://localhost:3000/api/v1/trends/version

Returns a slice of JSON objects:

{"version":31}

GET /api/v1/trends/{begin}/{end} - Get trends from begin (0 to ??? ) to end (0 to ???) inclusive

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
        },
        [...]
      ]
    },
    [...]
  ]
}

About

A cron job that retrieves and logs all malware trends on a daily basis

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages