Skip to content

Commit

Permalink
refactor(store): store requires a context.Context
Browse files Browse the repository at this point in the history
  • Loading branch information
novln committed Aug 16, 2017
1 parent 4c093d4 commit af247d0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 301 deletions.
11 changes: 8 additions & 3 deletions store.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
package limiter

import "time"
import (
"context"
"time"
)

// Store is the common interface for limiter stores.
type Store interface {
Get(key string, rate Rate) (Context, error)
Peek(key string, rate Rate) (Context, error)
// Get returns the limit for given identifier.
Get(ctx context.Context, key string, rate Rate) (Context, error)
// Peek returns the limit for given identifier, without modification on current values.
Peek(ctx context.Context, key string, rate Rate) (Context, error)
}

// StoreOptions are options for store.
Expand Down
99 changes: 0 additions & 99 deletions store_memory.go

This file was deleted.

199 changes: 0 additions & 199 deletions store_redis.go

This file was deleted.

0 comments on commit af247d0

Please sign in to comment.