Documentation
¶
Overview ¶
Package sweep is the daily job of the terms of keeping (R05, R21, R38, R43): it finishes the deletions the requests left unfinished and deletes what is kept past its term — accounts and profiles idle for 12 months, users of the sign-in service with no account for 30 days, dangling tuples, the minimal records of consents for children 5 years after the deletion, and the records of keys and OpenFGA's changelog after a day — and closes what a learner abandoned: an attempt with no action for 7 days, and a lesson run with none for 30 (R10, R13). A pass keeps no state for the next: each step chooses its work again by a query, so a pass cut short is taken up by the next one. Its log is counts alone.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Rights ¶
type Rights interface {
deletion.Rights
Tuples(ctx context.Context) iter.Seq2[authz.Owned, error]
DropChangelog(ctx context.Context, before time.Time) (int64, error)
}
Rights is what the job asks of the rights: authz.Rights.
type Step ¶
Step is what a step of a pass did: how many it did and failed, and whether it went to its end — not cut short by the pass's time, and its own queries done.
type Sweeper ¶
type Sweeper struct {
// contains filtered or unexported fields
}
Sweeper runs the passes of the job.
func New ¶
New is the job on db, rights and signin. settle is the longest a request may run: a mark or a tuple younger than that may be a request's still going, and the job leaves it.
func (*Sweeper) Run ¶
Run runs one pass at now, until ctx ends: the steps in their order, so that the tuples and the changelog the deletions leave go in the same pass. A step that fails goes on to the next item, and the next step runs all the same; once ctx is done, every step left stops before its first item.