noopstore

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 3 Imported by: 6

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

func New() (limiter.Store, error)
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.

Jump to

Keyboard shortcuts

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