Documentation ¶
Overview ¶
Package checkpoints contains methods for maintaining and using process checkpoints to ensure processes run once only.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetForTesting ¶
SetForTesting replaces the set of stored checkpoints to match the given set.
Types ¶
type Checkpoint ¶
type Checkpoint struct { Key // The time the checkpoint was created. CreationTime time.Time // The time the checkpoint will be eligible for deletion. ExpiryTime time.Time }
Checkpoint records that a point in a process was reached.
func ReadAllForTesting ¶
func ReadAllForTesting(ctx context.Context) ([]Checkpoint, error)
ReadAllForTesting reads all checkpoints for testing, e.g. to assert all expected checkpoints were made. Do not use in production, will not scale. Must be called in a spanner transactional context.
type Key ¶
type Key struct { // Project is the name of the LUCI Project. Project string // Identifier of the resource to which the checkpoint relates. // For example, the ResultDB invocation being ingested. // Free-form field, but must be non-empty. ResourceID string // ProcessID is the identifier of the process requiring checkpointing. // Valid pattern: ^[a-z0-9\-/]{1,64}$. ProcessID string // Unique identifier of the checkpoint within the process and resource. // Free-form field. // If the process has only one checkpoint, this may be empty (""). Uniquifier string }
Key is the primary key of a checkpoint.
Click to show internal directories.
Click to hide internal directories.