MCPcopy
hub / github.com/unkeyed/unkey / Increment

Method Increment

pkg/counter/interface.go:35–35  ·  view source on GitHub ↗

Increment increases the counter by the given value and returns the new count. Parameters: - ctx: Context for cancellation and tracing - key: Unique identifier for the counter - value: Amount to increment the counter by - ttl: Optional time-to-live duration for the counter. If provided and the count

(ctx context.Context, key string, value int64, ttl ...time.Duration)

Source from the content-addressed store, hash-verified

33 // - int64: The new counter value after incrementing
34 // - error: Any errors that occurred during the operation
35 Increment(ctx context.Context, key string, value int64, ttl ...time.Duration) (int64, error)
36
37 // Get retrieves the current value of a counter.
38 //

Implementers 3

redisCounterpkg/counter/redis.go
memoryCounterpkg/counter/memory.go
mockCounterinternal/services/ratelimit/service_be

Calls

no outgoing calls