memorycontrol

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Idempotency

type Idempotency struct {
	// contains filtered or unexported fields
}

func NewIdempotency

func NewIdempotency() *Idempotency

func (*Idempotency) Done

func (i *Idempotency) Done(ctx context.Context, key string) (bool, error)

func (*Idempotency) MarkDone

func (i *Idempotency) MarkDone(ctx context.Context, key string, ttl time.Duration) error

type Locker

type Locker struct {
	// contains filtered or unexported fields
}

func NewLocker

func NewLocker() *Locker

func (*Locker) Lock

func (l *Locker) Lock(ctx context.Context, key string, ttl time.Duration) (func(context.Context) error, bool, error)

type RateLimiter

type RateLimiter struct {
	// contains filtered or unexported fields
}

func NewRateLimiter

func NewRateLimiter() *RateLimiter

func (*RateLimiter) Allow

func (l *RateLimiter) Allow(ctx context.Context, key string, limit int, window time.Duration) (bool, time.Duration, error)

Jump to

Keyboard shortcuts

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