mirror of
https://github.com/micromdm/micromdm/
synced 2026-08-14 17:41:43 +08:00
The new remove devices command takes a UDID or list of UDIDs as input and calls the devices delete endpoint. Since serial number isn't strictly required by the spec it seemed to make more sense to keep the remove working with only UDIDs. The get devices command with a serial number filter can always be used to look up a UDID from a serial number.
24 lines
425 B
Go
24 lines
425 B
Go
package device
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
type Service interface {
|
|
ListDevices(ctx context.Context, opt ListDevicesOption) ([]DeviceDTO, error)
|
|
RemoveDevices(ctx context.Context, udids []string) error
|
|
}
|
|
|
|
type Store interface {
|
|
List(opt ListDevicesOption) ([]Device, error)
|
|
Delete(udid string) error
|
|
}
|
|
|
|
type DeviceService struct {
|
|
store Store
|
|
}
|
|
|
|
func New(store Store) *DeviceService {
|
|
return &DeviceService{store: store}
|
|
}
|