Documentation
¶
Overview ¶
Package deletion is the deletion of a profile and of an account in the order of R21 (architecture 3.10): the database first, then the tuples of the rights, then the user at the sign-in service, and the account's row last. What does not finish after the database is done is the daily job's to finish (T28), and the caller answers "deleted" all the same.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Deleter ¶
type Deleter struct {
// contains filtered or unexported fields
}
Deleter deletes on the database api, the rights and the sign-in service.
func (*Deleter) Account ¶
Account deletes the account of the sign-in service's uid (R21; architecture 3.10). Step 1 is one transaction: the account's row FOR UPDATE, the mark "deleting", and all its data. When it fails, nothing is done, and the error is the caller's to answer. The rest — Finish — that does not finish is Unfinished: the mark stays, which tells the other devices the account is gone and which the job finishes.
func (*Deleter) Finish ¶
Finish does steps 2 to 4 of the deletion of a marked account (R21; architecture 3.10): the tuples of all its profiles, read by the account and deleted in batches; the user at the sign-in service — its refresh tokens revoked, then the user deleted, a user not there being done — which goes on when the tuples failed, since the sign-in service holds the person's identity and the tuples only IDs; and only when both are done, the account's row. A repeat redoes what is left; the job of T28 calls it for the marks the requests left.
func (*Deleter) Profile ¶
Profile deletes the account's profile (R21; architecture 3.10): one transaction under the account, the account's row FOR KEY SHARE and the profile's FOR UPDATE, then its tuple. A profile that is not the account's is store.ErrNoProfile, a marked account store.ErrAccountDeleting; a tuple that does not go is Unfinished, dangling: no row is there for it to give a right to, and the job removes it.
type Rights ¶
type Rights interface {
DeleteOwner(ctx context.Context, accountID, profileID string) error
DeleteOwned(ctx context.Context, accountID string, profileIDs []string) error
OwnedProfiles(ctx context.Context, accountID string) ([]string, error)
}
Rights is what the deletion asks of the rights: authz.Rights.
type Unfinished ¶
type Unfinished struct {
// contains filtered or unexported fields
}
Unfinished is a deletion whose database part is done and whose rest is not: a tuple left dangling, a user left at the sign-in service, the account's row. The caller answers "deleted": nothing of a learner is left in the database (R21).
func (*Unfinished) Error ¶
func (u *Unfinished) Error() string
func (*Unfinished) Unwrap ¶
func (u *Unfinished) Unwrap() error