ratelimit

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Incr

func Incr(context context.Context, c *redis.Client, field string, limit int, optslist ...*RatelimitOptions) (ok bool, e error)

func Values added in v0.1.8

func Values(context context.Context, c *redis.Client, optslist ...*RatelimitOptions) (map[string]int64, error)

Types

type RatelimitOptions

type RatelimitOptions struct {
	Time time.Time
	Span time.Duration
}

func NewRatelimitOptions added in v0.1.8

func NewRatelimitOptions() *RatelimitOptions

func (*RatelimitOptions) RedisKey added in v0.1.8

func (opts *RatelimitOptions) RedisKey() string

Jump to

Keyboard shortcuts

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