GithubHelp home page GithubHelp logo

twin / g8 Goto Github PK

View Code? Open in Web Editor NEW
58.0 58.0 4.0 1012 KB

⛩️ Go library for protecting your HTTP handlers

License: MIT License

Go 100.00%
authorization bearer go golang hacktoberfest handler library rate-limit rate-limiting security token

g8's Introduction

Hey, I'm TwiN! 👋

Follow TwiN

Just another person trying to embrace their passion prevent the vicissitudes of life from taking away their passion.

Currently building my first SaaS during my free time: gatus.io

📝 Latest Blog Articles

📊 Statistics

TwiN's Most Used Languages TwiN's GitHub Stats

g8's People

Contributors

dependabot[bot] avatar twin avatar ynden avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

g8's Issues

Implement caching in the ClientProvider

Implementing a cache with a configurable TTL as well as a configurable maximum size in ClientProvider could be very useful to help preventing unnecessary load on whatever service or infrastructure component ClientProvider's getClientByTokenFunc function is calling.

The implementation:

  • Must be able to have a maximum cache size (e.g. 10000)
  • Must be able to have a configurable TTL (e.g. 1 hour)
  • Must be able to cache invalid tokens with a shorter entry TTL (e.g. 30 minutes)

Being the self-promoting person that I am, I think TwinProduction/gocache would fit this role perfectly.

Add support for rate limiting

It would be nice to have a configuration for rate limiting on Gate.

Something like this:

gate := g8.NewGate(nil).WithRateLimit(100)

where 100 is the maximum number of requests per second.

feat: ClientProvider.cache as an interface to support external cache (e.g. redis)

Describe the feature request

At present it looks like the client provider cache field is tightly coupled to the gocache.
If a user wants to also use an external/shared/distributed cache then this isn't possible.
It would be nice to allow more flexibility to the user in which caching solution they wish to use.

Why do you personally want this feature to be implemented?

to allow flexibility in choice of cache solution.

How long have you been using this project?

No response

Additional information

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.