Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Locker ¶
type Locker interface { // TryRun attempts to run a non-exclusive Restic job. // The given runnable is executed if: // - concurrency limit for the same type of job is not yet reached // - and no other exclusive job is running (batch Job with Active pods > 0) // // The given runnable runs synchronously within a locked mutex, so it should be as short as possible as it blocks other runnables. // It returns false with nil error if the preconditions aren't met, false with an error if preconditions cannot be determined, or true with the error returned by the runnable. TryRun(ctx context.Context, config job.Config, concurrencyLimit int, runnable func(ctx context.Context) error) (bool, error) // TryRunExclusively attempts to run an exclusive Restic job. // The given runnable is executed if there are no other jobs running (batch Job with Active pods == 0). // // The given runnable runs synchronously within a locked mutex, so it should be as short as possible as it blocks other runnables. // It returns false with nil error if the precondition isn't met, false with an error if precondition cannot be determined, or true with the error returned by the runnable. TryRunExclusively(ctx context.Context, runnable func(ctx context.Context) error) (bool, error) }
Locker is used to synchronize different controllers that operate on the same Restic repository.
Click to show internal directories.
Click to hide internal directories.