apollo-backend/internal/domain/device.go

23 lines
571 B
Go
Raw Normal View History

2021-07-24 20:17:54 +00:00
package domain
import "context"
type Device struct {
ID int64
APNSToken string
Sandbox bool
LastPingedAt int64
}
type DeviceRepository interface {
GetByAPNSToken(ctx context.Context, token string) (Device, error)
2021-08-14 17:42:28 +00:00
GetByAccountID(ctx context.Context, id int64) ([]Device, error)
2021-07-26 16:34:26 +00:00
CreateOrUpdate(ctx context.Context, dev *Device) error
2021-07-24 20:17:54 +00:00
Update(ctx context.Context, dev *Device) error
Create(ctx context.Context, dev *Device) error
Delete(ctx context.Context, token string) error
2021-08-14 16:08:17 +00:00
PruneStale(ctx context.Context, before int64) (int64, error)
2021-07-24 20:17:54 +00:00
}