| 1 |
package testsuite |
| 2 |
|
| 3 |
import ( |
| 4 |
"context" |
| 5 |
) |
| 6 |
|
| 7 |
// FakeStorage is a no-op implementation of the token storage interface used in |
| 8 |
// tests. |
| 9 |
type FakeStorage struct{} |
| 10 |
|
| 11 |
// NewFakeStorage returns a new FakeStorage instance. |
| 12 |
func NewFakeStorage() *FakeStorage { |
| 13 |
return &FakeStorage{} |
| 14 |
} |
| 15 |
|
| 16 |
// Get returns an empty token. |
| 17 |
func (FakeStorage) Get(_ context.Context, _ string) (string, error) { |
| 18 |
return "", nil |
| 19 |
} |
| 20 |
|
| 21 |
// Consume returns an empty token. |
| 22 |
func (FakeStorage) Consume(_ context.Context, _ string) (string, error) { |
| 23 |
return "", nil |
| 24 |
} |
| 25 |
|
| 26 |
// Close is a no-op for FakeStorage. |
| 27 |
func (FakeStorage) Close() error { |
| 28 |
return nil |
| 29 |
} |
| 30 |
|
| 31 |
// Delete is a no-op for FakeStorage. |
| 32 |
func (FakeStorage) Delete(_ context.Context, _ string) error { |
| 33 |
return nil |
| 34 |
} |
| 35 |
|
| 36 |
// Set is a no-op for FakeStorage. |
| 37 |
func (FakeStorage) Set(_ context.Context, _, _ string) error { |
| 38 |
return nil |
| 39 |
} |