ducky/devices
2016-01-02
Parent:f5a9d5f8f28d
ducky/devices/memstore_test.go
Update trout to fix routing bug. Update to tip on trout to fix the routing bug that was causing us such issues. See the commit message of trout at 3df515f0cec5 for more details.
| paddy@4 | 1 package devices |
| paddy@4 | 2 |
| paddy@9 | 3 import ( |
| paddy@9 | 4 "fmt" |
| paddy@9 | 5 |
| paddy@9 | 6 "golang.org/x/net/context" |
| paddy@9 | 7 ) |
| paddy@9 | 8 |
| paddy@4 | 9 func init() { |
| paddy@9 | 10 storerFactories = append(storerFactories, MemstoreFactory{}) |
| paddy@4 | 11 } |
| paddy@9 | 12 |
| paddy@9 | 13 type MemstoreFactory struct { |
| paddy@9 | 14 } |
| paddy@9 | 15 |
| paddy@9 | 16 func (m MemstoreFactory) NewStorer(ctx context.Context) (Storer, error) { |
| paddy@9 | 17 return NewMemstore(), nil |
| paddy@9 | 18 } |
| paddy@9 | 19 |
| paddy@9 | 20 func (m MemstoreFactory) TeardownStorer(storer Storer, ctx context.Context) error { |
| paddy@9 | 21 memstorer, ok := storer.(*Memstore) |
| paddy@9 | 22 if !ok { |
| paddy@9 | 23 return fmt.Errorf("Storer was not a *Memstore, was a %T", storer) |
| paddy@9 | 24 } |
| paddy@9 | 25 memstorer.devices = nil |
| paddy@9 | 26 return nil |
| paddy@9 | 27 } |