frequency_limit_golang

package module
v0.0.0-...-89311fe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 6 Imported by: 0

README

frequency-limit-golang

Introduction

This is a frequency-limiting strategy based on Redis, which can be applied to frequency limiting and circuit breaking for SMS, email, API calls, and other scenarios. This solution is more suitable for low-frequency application scenarios.

Thanks to the following open source projects:

  • go-redis
  • [uuid](github.com/google/uuid v1.6.0)
  • [cast](github.com/spf13/cast v1.6.0)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(ctx context.Context, userId int64, now int) (bool, error)

func IncrAndCheck

func IncrAndCheck(ctx context.Context, userId int64) (bool, error)

Types

This section is empty.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL