ducky/devices

Paddy 2015-11-20 Parent:1e2743834209 Child:03c49b4d3d9f

9:f5a9d5f8f28d Go to Latest

ducky/devices/devices.go

Separate out StorerFactory into its own interface. We had previously included a Factory and Destroy method in the Storer interface, but it makes more sense to separate those out into a StorerFactory interface. This lets us avoid the impression that we're using the same instance of a Storer for every test, separates the test methods away from the methods that are actually used in prod, and hides them from Godoc. What's not to like?

History
     1.1 --- a/devices.go	Sun Nov 15 04:40:30 2015 -0800
     1.2 +++ b/devices.go	Fri Nov 20 01:14:58 2015 -0800
     1.3 @@ -76,10 +76,6 @@
     1.4  	DeleteDevices(ids []uuid.ID, c context.Context) error
     1.5  	CreateDevices(devices []Device, c context.Context) error
     1.6  	ListDevicesByOwner(user uuid.ID, c context.Context) ([]Device, error)
     1.7 -
     1.8 -	// These are used for testing only.
     1.9 -	Factory(c context.Context) (Storer, error)
    1.10 -	Destroy(c context.Context) error
    1.11  }
    1.12  
    1.13  type ErrDeviceAlreadyExists uuid.ID