Documentation
¶
Overview ¶
Package noopstore defines a storage system for limiting that always allows requests. It's an empty store useful for testing or development.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
Example ¶
package main
import (
"context"
"log"
"github.com/sethvargo/go-limiter/noopstore"
)
func main() {
ctx := context.Background()
store, err := noopstore.New()
if err != nil {
log.Fatal(err)
}
defer store.Close(ctx)
limit, remaining, reset, ok, err := store.Take(ctx, "my-key")
if err != nil {
log.Fatal(err)
}
_, _, _, _ = limit, remaining, reset, ok
}
Output:
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.