Skip to content

scapotondo/golang-rate-limit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rate-Limited Notification Service

Features section describes in detail about service capabilities

Features

Send emails of different type with a rate limit associated per user and per type:

  • Status type: not more than 2 per minute for each recipient
  • News type: not more than 1 per day for each recipient
  • Marketing type: not more than 1 per day for each recipient

Local testing

Run tests with coverage

There's a coverage.sh file that runs every test in the project located at bin/coverage.sh and needs permissions to run. It can be easily done executing the following command:

chmod +x coverage.sh

Now you can execute the file in the terminal

Open API Specification

To update the Open API specification, follow these steps:

  1. Write annotations in the code using the Swag API operation format

  2. install go swag locally. Follow swaggo's getting started

  3. Run the following command to generate/update the Open API specification:

    swag init
    
  4. Run the golang-rate-limit service and navigate to the following URL to view the Open API Specification:

    http://localhost:8080/v1/docs/index.html
    

You will see the OAS with Swagger UI

Creator

Sebastian Capotondo

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published