Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConflictItem ¶
type ConflictItem struct {
UnsavedItem *model.Item `json:"unsaved_item,omitempty"`
ServerItem *model.Item `json:"server_item,omitempty"`
Type string `json:"type"`
}
A ConflictItem is an object containing an item that can't be saved caused by conflicts.
type LoginParams ¶
type LoginParams struct {
Params
Email string `json:"email"`
Password string `json:"password"`
CodeChallenge string `json:"code_challenge"`
CodeVerifier string `json:"code_verifier"`
}
LoginParams are used to login a user.
type PKCEService ¶ added in v0.7.0
type PKCEService interface {
ComputeChallenge(codeVerifier string) string
StoreChallenge(codeChallenge string) error
CheckChallenge(codeChallenge string) error
}
A PKCEService is a service used for managing challenges.
type Params ¶
type Params struct {
APIVersion string `json:"api"` // Since 20190520
UserAgent string
Session *model.Session
}
Params are the basic fields used in requests.
type RegisterParams ¶
type RegisterParams struct {
Params
Email string `json:"email"`
RegistrationPassword string `json:"password"`
PasswordNonce string `json:"pw_nonce"`
PasswordCost int `json:"pw_cost"` // Before 202000115
Version string `json:"version"`
Created string `json:"created"` // Since 20200115
Identifier string `json:"identifier"` // Since 20200115
Origination string `json:"origination"` // Since 20200115
}
RegisterParams are used to register a user.
type SyncParams ¶
type SyncParams struct {
Params
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 interface {
// Execute performs the synchronisation.
Execute() error
}
A SyncService is a service used for syncing items.
func NewSync ¶
func NewSync(db database.Client, user *model.User, params SyncParams) (s SyncService)
NewSync instantiates a new Sync service.
type UnsavedItem ¶
An UnsavedItem is an object containing an item that can't be saved.
type UpdatePasswordParams ¶
type UpdatePasswordParams struct {
UpdateUserParams
Identifier string `json:"identifier"`
CurrentPassword string `json:"current_password"`
NewPassword string `json:"new_password"`
NewEmail string `json:"new_email"`
}
UpdatePasswordParams are used to update user's password.
type UpdateUserParams ¶
type UpdateUserParams struct {
Params
PasswordCost int `json:"pw_cost"`
PasswordNonce string `json:"pw_nonce"`
PasswordSalt string `json:"pw_salt"`
Version string `json:"version"`
}
UpdateUserParams are used to update a user.
type UserService ¶
type UserService interface {
Register(params RegisterParams) (Render, error)
Login(params LoginParams) (Render, error)
Update(user *model.User, params UpdateUserParams) (Render, error)
Password(user *model.User, params UpdatePasswordParams) (Render, error)
}
A UserService is a service used for handle API versioning of the user.