add SaveMode for device which can be 0 (All) or a bitmask for what to save. It did not improve performance
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
This commit is contained in:
+11
-3
@@ -20,8 +20,8 @@ type Device struct {
|
||||
}
|
||||
|
||||
type DeviceUpdate struct {
|
||||
Icon *string `json:"icon"`
|
||||
Name *string `json:"name"`
|
||||
Icon *string `json:"icon"`
|
||||
Name *string `json:"name"`
|
||||
UserProperties map[string]*string `json:"userProperties"`
|
||||
}
|
||||
|
||||
@@ -46,10 +46,18 @@ type NewDeviceState struct {
|
||||
|
||||
type DeviceCapability string
|
||||
|
||||
type SaveMode int
|
||||
|
||||
const (
|
||||
SMState SaveMode = 1
|
||||
SMProperties SaveMode = 2
|
||||
SMTags SaveMode = 4
|
||||
)
|
||||
|
||||
type DeviceRepository interface {
|
||||
Find(ctx context.Context, id int) (*Device, error)
|
||||
FetchByReference(ctx context.Context, kind ReferenceKind, value string) ([]Device, error)
|
||||
Save(ctx context.Context, device *Device) error
|
||||
Save(ctx context.Context, device *Device, mode SaveMode) error
|
||||
Delete(ctx context.Context, device *Device) error
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user