Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SyncParams ¶
type SyncParams struct {
ComputeIntegrity bool `json:"compute_integrity"`
Limit int `json:"limit"`
SyncToken string `json:"sync_token"`
CursorToken string `json:"cursor_token"`
ContentType string `json:"content_type"` // optional, only return items of these type if present
Items []*model.Item `json:"items"`
}
A SyncParams is used when a client want to sync items.
type SyncService ¶
type SyncService struct {
User *model.User `json:"-"`
Params SyncParams `json:"-"`
// Populated during `Execute()`
Retrieved []*model.Item `json:"retrieved_items"`
Saved []*model.Item `json:"saved_items"`
Unsaved []*UnsavedItem `json:"unsaved"`
SyncToken string `json:"sync_token"`
CursorToken string `json:"cursor_token"`
IntegrityHash string `json:"integrity_hash,omitempty"`
// contains filtered or unexported fields
}
A SyncService is a service used for syncing items.
func NewSync ¶
func NewSync(db database.Client, user *model.User, params SyncParams) *SyncService
NewSync instantiates a new Sync service.
func (*SyncService) Execute ¶
func (s *SyncService) Execute() error
Execute performs the synchronisation.
type UnsavedItem ¶
An UnsavedItem is an object containing an item that can't be saved.
Click to show internal directories.
Click to hide internal directories.