fake

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package fake provides an in-memory implementation of store.Store for unit tests that must avoid touching the filesystem.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store is an in-memory implementation of store.Store for unit tests that must avoid touching the filesystem.

func New

func New() *Store

New returns a ready-to-use in-memory store.

func (*Store) AbortRetirement added in v0.4.0

func (s *Store) AbortRetirement(ctx context.Context, workerID string, now time.Time, reason string) (bool, error)

AbortRetirement implements store.CapacityPowerStore.

func (*Store) AcquireLeadership added in v0.4.0

func (s *Store) AcquireLeadership(_ context.Context, holder string, ttl time.Duration) (epoch int64, ok bool, err error)

AcquireLeadership implements store.LeadershipStore.

func (*Store) ActiveClaimCount

func (s *Store) ActiveClaimCount(_ context.Context, poolID string) (int, error)

ActiveClaimCount returns the number of claims for the given pool where ReleasedAt IS NULL.

func (*Store) AppendAuditEntry

func (s *Store) AppendAuditEntry(ctx context.Context, entry store.AuditEntry) error

AppendAuditEntry inserts a new audit log entry.

func (*Store) BeginRetirement added in v0.4.0

func (s *Store) BeginRetirement(ctx context.Context, groupID, workerID string, now time.Time) (store.Worker, bool, error)

BeginRetirement implements store.CapacityPowerStore.

func (*Store) CancelBlockedJob added in v0.4.0

func (s *Store) CancelBlockedJob(ctx context.Context, id, reason string, now time.Time) (bool, []store.Task, error)

CancelBlockedJob implements store.JobStore.

func (*Store) CancelJobExecution added in v0.4.0

func (s *Store) CancelJobExecution(ctx context.Context, jobID, reason string, now time.Time) ([]store.Task, error)

CancelJobExecution implements store.TaskStore.

The outcomes match the SQL store's, which is the reference: every non-terminal task of the job is canceled with its worker assignment cleared, then every running attempt of the job's tasks (including one on a task that was already terminal) is closed, then the claims of the job's closed attempts are released, then every open step of the job is finalized, and finally the job row is canceled unless it is already terminal. The tasks go first, as the interface documents.

func (*Store) CancelJobStatus

func (s *Store) CancelJobStatus(ctx context.Context, id string) error

CancelJobStatus implements store.JobStore. Transitions the job to canceled unless it is already completed or failed.

func (*Store) CancelPendingStep added in v0.4.0

func (s *Store) CancelPendingStep(ctx context.Context, id, reason string, now time.Time) (bool, []store.Task, error)

CancelPendingStep implements store.StepStore.

func (*Store) CancelTaskExecution added in v0.4.0

func (s *Store) CancelTaskExecution(ctx context.Context, taskID, reason string, now time.Time) (store.Task, bool, error)

CancelTaskExecution implements store.TaskStore.

The outcomes match the SQL store's: an unknown task is store.ErrNotFound; a terminal task is returned unchanged with false and nothing is written (its attempts and claims are left to whatever closed it); otherwise the task is canceled with its worker assignment kept, then its running attempt is closed and its closed attempts' claims released.

func (*Store) ClaimInvariantViolations added in v0.4.0

func (s *Store) ClaimInvariantViolations(_ context.Context) ([]string, error)

ClaimInvariantViolations returns the IDs of active usage claims that break invariant I3: the attempt is missing or not running, or its task is terminal. Mirrors the SQL store diagnostic of the same name, signature included, so a test can call it on either backend; the error is always nil. Not part of store.Store.

func (*Store) Close

func (*Store) Close() error

Close implements io.Closer; it is a no-op for the in-memory store.

func (*Store) CommittedCores

func (s *Store) CommittedCores(_ context.Context, workerID string, fullMachineCost int) (int, error)

CommittedCores implements store.TaskStore.

func (*Store) CompleteTaskAttempt added in v0.4.0

func (s *Store) CompleteTaskAttempt(ctx context.Context, c store.AttemptCompletion) (store.CompletionResult, error)

CompleteTaskAttempt implements store.TaskStore.

The outcomes match the SQL store's, which is the reference:

  • unknown task: store.ErrNotFound, nothing written;
  • c.AttemptID is not the task's latest attempt (a newer lease superseded it): Rejected, the task and its failure reason are left alone, but the attempt close and the claim release still happen;
  • the task already holds c.TaskStatus: Applied, the task is not rewritten (a redelivery);
  • the task is out of flight (not assigned/running) and not already at c.TaskStatus: Rejected, close and release still happen;
  • the state machine refuses the move: Rejected, but the attempt close and the claim release still happen;
  • otherwise the task moves and Applied is reported.

In every non-error case the failure reason is stamped only when the task ends up holding c.TaskStatus by this attempt's report.

func (*Store) CountActiveTasksInFarm

func (s *Store) CountActiveTasksInFarm(_ context.Context, farmID string) (int, error)

CountActiveTasksInFarm returns the number of tasks in 'assigned' or 'running' state whose job belongs to farmID.

func (*Store) CountActiveTasksInQueue

func (s *Store) CountActiveTasksInQueue(_ context.Context, queueID string) (int, error)

CountActiveTasksInQueue returns the number of tasks in 'assigned' or 'running' state whose job belongs to queueID.

func (*Store) CountIdleWorkers

func (s *Store) CountIdleWorkers(_ context.Context, farmID string) (int, error)

CountIdleWorkers returns the number of online, enabled workers in the given farm that have no task in store.TaskStatusAssigned or store.TaskStatusRunning state. When farmID is empty all farms are counted.

func (*Store) CountReadyTasksByQueue

func (s *Store) CountReadyTasksByQueue(_ context.Context, farmID string, now time.Time) (map[string]int, error)

CountReadyTasksByQueue returns the number of leasable ready tasks for each queue in the given farm ("" = all farms), keyed by queue ID — the same eligibility predicate as ListReadyTasks (see isReadyInFarm).

func (*Store) CountTasksByJob

func (s *Store) CountTasksByJob(_ context.Context, jobID string) (map[store.TaskStatus]int, error)

CountTasksByJob returns the number of tasks for the given job keyed by status. Statuses with zero tasks are omitted from the returned map.

func (*Store) CountUnschedulableTasksByJob added in v0.2.0

func (s *Store) CountUnschedulableTasksByJob(_ context.Context, jobID string) (int, error)

CountUnschedulableTasksByJob returns the number of ready tasks for the given job that carry a non-empty unschedulable reason.

func (*Store) CountUsers added in v0.3.0

func (s *Store) CountUsers(_ context.Context) (int, error)

CountUsers implements store.UserStore.

func (*Store) CreateAPIKey added in v0.3.0

func (s *Store) CreateAPIKey(ctx context.Context, k store.APIKey) (store.APIKey, error)

CreateAPIKey implements store.APIKeyStore.

func (*Store) CreateCapacityGroup added in v0.4.0

func (s *Store) CreateCapacityGroup(ctx context.Context, g store.CapacityGroup) (store.CapacityGroup, error)

CreateCapacityGroup inserts a new group. Returns store.ErrConflict if the name is taken or the farm does not exist.

func (*Store) CreateComputeLocation added in v0.2.0

func (s *Store) CreateComputeLocation(ctx context.Context, loc store.ComputeLocation) (store.ComputeLocation, error)

CreateComputeLocation inserts a new location. Returns store.ErrConflict if a location with the same name already exists.

func (*Store) CreateFarm

func (s *Store) CreateFarm(ctx context.Context, farm store.Farm) (store.Farm, error)

CreateFarm inserts a new farm. Returns store.ErrConflict if a farm with the same name already exists.

func (*Store) CreateJobSubmission added in v0.3.0

func (s *Store) CreateJobSubmission(ctx context.Context, sub store.JobSubmission) (store.JobSubmission, error)

CreateJobSubmission implements store.JobStore. It validates the whole submission before mutating anything, so a rejected submission leaves the store untouched, the in-memory equivalent of the SQL implementation's transaction.

func (*Store) CreateProduct added in v0.2.0

func (s *Store) CreateProduct(ctx context.Context, p store.Product) (store.Product, error)

CreateProduct inserts a product. Returns store.ErrConflict on duplicate name.

func (*Store) CreateQueue

func (s *Store) CreateQueue(ctx context.Context, queue store.Queue) (store.Queue, error)

CreateQueue inserts a new queue. Returns store.ErrConflict if a queue with the same name already exists within the same farm.

func (*Store) CreateSession added in v0.3.0

func (s *Store) CreateSession(ctx context.Context, sess store.Session) (store.Session, error)

CreateSession implements store.SessionStore.

func (*Store) CreateStorageLocation

func (s *Store) CreateStorageLocation(ctx context.Context, loc store.StorageLocation) (store.StorageLocation, error)

CreateStorageLocation inserts a new location. Returns store.ErrConflict if a location with the same name already exists.

func (*Store) CreateTaskLog

func (s *Store) CreateTaskLog(ctx context.Context, log store.TaskLog) (store.TaskLog, error)

CreateTaskLog implements store.TaskLogStore. It does not enforce the attempt_id foreign key that the SQL backends do — a log row is appended even when AttemptID names no existing task_attempts row. Tests that exercise a log-ingest error path tied to a missing/deleted attempt need a real SQL store, or a wrapper around this one, to observe it.

func (*Store) CreateUsagePool

func (s *Store) CreateUsagePool(ctx context.Context, pool store.UsagePool) (store.UsagePool, error)

CreateUsagePool inserts a new pool. Returns store.ErrConflict if a pool with the same name (compared case-insensitively) already exists.

func (*Store) CreateUser added in v0.3.0

func (s *Store) CreateUser(ctx context.Context, u store.User) (store.User, error)

CreateUser implements store.UserStore.

func (*Store) CreateWorkerCredential added in v0.4.0

func (s *Store) CreateWorkerCredential(ctx context.Context, c store.WorkerCredential) (store.WorkerCredential, error)

CreateWorkerCredential implements store.WorkerCredentialStore.

func (*Store) CreateWorkerJoinToken added in v0.4.0

func (s *Store) CreateWorkerJoinToken(ctx context.Context, t store.WorkerJoinToken) (store.WorkerJoinToken, error)

CreateWorkerJoinToken implements store.WorkerCredentialStore.

func (*Store) DeleteCapacityGroup added in v0.4.0

func (s *Store) DeleteCapacityGroup(ctx context.Context, id string) error

DeleteCapacityGroup removes a group by ID. Returns store.ErrNotFound if it does not exist, or store.ErrConflict while any worker belongs to it.

func (*Store) DeleteComputeLocation added in v0.2.0

func (s *Store) DeleteComputeLocation(ctx context.Context, id string) error

DeleteComputeLocation removes a location by ID. Returns store.ErrNotFound if it does not exist.

func (*Store) DeleteEphemeralWorker added in v0.4.0

func (s *Store) DeleteEphemeralWorker(ctx context.Context, id string, now time.Time) (store.Worker, bool, error)

DeleteEphemeralWorker implements store.WorkerStore: the worker goes only while it is ephemeral, offline and holds no assigned or running task, and its active credential is revoked at now with it.

func (*Store) DeleteExpiredSessions added in v0.3.0

func (s *Store) DeleteExpiredSessions(ctx context.Context, now time.Time) (int, error)

DeleteExpiredSessions implements store.SessionStore.

func (*Store) DeleteFarm

func (s *Store) DeleteFarm(ctx context.Context, id string) error

DeleteFarm removes a farm by ID. Returns store.ErrNotFound if it does not exist, and store.ErrConflict while a queue, job, capacity group or worker still names it.

func (*Store) DeleteJob

func (s *Store) DeleteJob(ctx context.Context, id string) error

DeleteJob implements store.JobStore. It removes the job and every in-memory row that belongs to it: usage claims (by attempt), task logs (by task), task attempts, tasks, and steps, mirroring the SQLite cascade. Returns store.ErrNotFound when the job is absent.

func (*Store) DeleteOfflineWorkersBefore

func (s *Store) DeleteOfflineWorkersBefore(ctx context.Context, cutoff time.Time) ([]store.Worker, error)

DeleteOfflineWorkersBefore hard-deletes every enabled offline worker last seen before cutoff and returns the removed records. Online workers, disabled ones, workers that have never sent a heartbeat and every member of a capacity group are left untouched.

func (*Store) DeleteProduct added in v0.2.0

func (s *Store) DeleteProduct(ctx context.Context, name string) error

DeleteProduct removes the product with the given name.

func (*Store) DeleteQueue

func (s *Store) DeleteQueue(ctx context.Context, id string) error

DeleteQueue removes a queue by ID. Returns store.ErrNotFound if it does not exist.

func (*Store) DeleteServerMembersUnseenFor added in v0.4.0

func (s *Store) DeleteServerMembersUnseenFor(_ context.Context, d time.Duration) (int, error)

DeleteServerMembersUnseenFor implements store.LeadershipStore.

func (*Store) DeleteSession added in v0.3.0

func (s *Store) DeleteSession(ctx context.Context, id string) error

DeleteSession implements store.SessionStore.

func (*Store) DeleteStorageLocation

func (s *Store) DeleteStorageLocation(ctx context.Context, id string) error

DeleteStorageLocation removes a location by ID. Returns store.ErrNotFound if it does not exist.

func (*Store) DeleteTerminalJobsBefore

func (s *Store) DeleteTerminalJobsBefore(
	ctx context.Context, cutoff time.Time, includeFailed bool,
) ([]store.DeletedJob, error)

DeleteTerminalJobsBefore implements store.JobStore. completed and canceled jobs are always eligible; failed jobs only when includeFailed. Effective completion time is CompletedAt, falling back to UpdatedAt when nil.

A candidate still referenced as an upstream (depends_on_job_id) by a non-terminal dependent is skipped: purging it would leave the dependent's reconciler reading a GetJob ErrNotFound for an upstream that succeeded, which it treats as "missing" and cancels the dependent. Manual DeleteJob keeps the cancel-dependents behavior; this guard applies only to the automatic retention sweep.

Each candidate is re-checked against the full eligibility predicate immediately before it is deleted, and skipped (not deleted, not reported) if it no longer matches. The whole sweep holds s.mu, so here the re-check can never skip; it is kept so the fake runs the same steps as the SQL store.

func (*Store) DeleteUsagePool

func (s *Store) DeleteUsagePool(ctx context.Context, id string) error

DeleteUsagePool removes a pool by ID. Returns store.ErrNotFound if it does not exist, and store.ErrConflict while any claim names it.

func (*Store) DeleteUser added in v0.3.0

func (s *Store) DeleteUser(ctx context.Context, id string) error

DeleteUser implements store.UserStore.

func (*Store) DeleteVanishedEphemeralWorker added in v0.4.0

func (s *Store) DeleteVanishedEphemeralWorker(ctx context.Context, id string, cutoff, now time.Time) (store.Worker, bool, error)

DeleteVanishedEphemeralWorker implements store.WorkerStore: as DeleteEphemeralWorker, for a worker that is also not disabled and was last seen before cutoff.

func (*Store) DeleteWorkerIfRemovable added in v0.4.0

func (s *Store) DeleteWorkerIfRemovable(ctx context.Context, id string) error

DeleteWorkerIfRemovable implements store.WorkerStore. The rule is store.Worker.Removable, which the SQL stores restate in their DELETE, plus the in-flight condition a Worker value cannot see.

func (*Store) DemoteStalledJobs

func (s *Store) DemoteStalledJobs(ctx context.Context, now time.Time) ([]string, error)

DemoteStalledJobs implements store.JobStore. It returns every running job with no assigned/running task — but at least one ready/pending task — to pending, and returns the demoted job IDs.

func (*Store) ExpireRetirements added in v0.4.0

func (s *Store) ExpireRetirements(ctx context.Context, groupID string, cutoff, now time.Time, reason string) ([]string, error)

ExpireRetirements implements store.CapacityPowerStore.

func (*Store) FailWakes added in v0.4.0

func (s *Store) FailWakes(ctx context.Context, groupID string, cutoff, now time.Time, reason string) ([]string, error)

FailWakes implements store.CapacityPowerStore.

func (*Store) FailureReasonSummary added in v0.2.0

func (s *Store) FailureReasonSummary(_ context.Context, jobID string) (store.FailureSummary, error)

FailureReasonSummary implements store.TaskStore. It mirrors the SQL group-by-then-order-by(n DESC, reason ASC) semantics: the dominant reason is the most frequent one, ties broken by reason string ascending.

func (*Store) FinalizeJob added in v0.4.0

func (s *Store) FinalizeJob(ctx context.Context, id string, now time.Time) (store.JobStatus, bool, error)

FinalizeJob implements store.JobStore.

func (*Store) FinalizeStep added in v0.4.0

func (s *Store) FinalizeStep(ctx context.Context, id string, now time.Time) (store.StepStatus, bool, error)

FinalizeStep implements store.StepStore.

func (*Store) FinishRetirement added in v0.4.0

func (s *Store) FinishRetirement(
	ctx context.Context, workerID string, now time.Time,
) (w store.Worker, deleted, ok bool, err error)

FinishRetirement implements store.CapacityPowerStore: a named member is put to sleep and offline, and an ephemeral one is then deleted with its credential revoked, as DeleteEphemeralWorker deletes it.

func (*Store) GetAPIKeyUserByTokenHash added in v0.3.0

func (s *Store) GetAPIKeyUserByTokenHash(_ context.Context, tokenHash string, now time.Time) (store.APIKey, store.User, error)

GetAPIKeyUserByTokenHash implements store.APIKeyStore. It mirrors the SQLite JOIN: a key whose user row is missing resolves to ErrNotFound.

func (*Store) GetActiveWorkerCredentialByPublicKey added in v0.4.0

func (s *Store) GetActiveWorkerCredentialByPublicKey(_ context.Context, publicKey string) (store.WorkerCredential, error)

GetActiveWorkerCredentialByPublicKey implements store.WorkerCredentialStore.

func (*Store) GetBrokerIdentity added in v0.4.0

func (s *Store) GetBrokerIdentity(_ context.Context) (string, error)

GetBrokerIdentity implements store.BrokerStateStore.

func (*Store) GetCapacityGroup added in v0.4.0

func (s *Store) GetCapacityGroup(_ context.Context, id string) (store.CapacityGroup, error)

GetCapacityGroup returns the group with the given ID, or store.ErrNotFound.

func (*Store) GetCapacityGroupByName added in v0.4.0

func (s *Store) GetCapacityGroupByName(_ context.Context, name string) (store.CapacityGroup, error)

GetCapacityGroupByName returns the group with the given name, or store.ErrNotFound.

func (*Store) GetComputeLocation added in v0.2.0

func (s *Store) GetComputeLocation(_ context.Context, id string) (store.ComputeLocation, error)

GetComputeLocation returns the location with the given ID, or store.ErrNotFound.

func (*Store) GetComputeLocationByName added in v0.2.0

func (s *Store) GetComputeLocationByName(_ context.Context, name string) (store.ComputeLocation, error)

GetComputeLocationByName returns the location with the given name, or store.ErrNotFound. The match is exact (case-sensitive).

func (*Store) GetFarm

func (s *Store) GetFarm(_ context.Context, id string) (store.Farm, error)

GetFarm returns the farm with the given ID, or store.ErrNotFound.

func (*Store) GetJob

func (s *Store) GetJob(_ context.Context, id string) (store.Job, error)

GetJob returns the job with the given ID, or store.ErrNotFound.

func (*Store) GetLeadership added in v0.4.0

func (s *Store) GetLeadership(_ context.Context) (store.Lease, error)

GetLeadership implements store.LeadershipStore.

func (*Store) GetProductByName added in v0.2.0

func (s *Store) GetProductByName(_ context.Context, name string) (store.Product, error)

GetProductByName returns the product with the given name, or store.ErrNotFound.

func (*Store) GetQueue

func (s *Store) GetQueue(_ context.Context, id string) (store.Queue, error)

GetQueue returns the queue with the given ID, or store.ErrNotFound.

func (*Store) GetSessionByTokenHash added in v0.3.0

func (s *Store) GetSessionByTokenHash(_ context.Context, tokenHash string, now time.Time) (store.Session, error)

GetSessionByTokenHash implements store.SessionStore.

func (*Store) GetSessionUserByTokenHash added in v0.3.0

func (s *Store) GetSessionUserByTokenHash(_ context.Context, tokenHash string, now time.Time) (store.User, error)

GetSessionUserByTokenHash implements store.SessionStore. It mirrors the SQLite JOIN: a session whose user row is missing resolves to ErrNotFound, exactly as an inner join would drop the row.

func (*Store) GetStep

func (s *Store) GetStep(_ context.Context, id string) (store.Step, error)

GetStep returns the step with the given ID, or store.ErrNotFound.

func (*Store) GetStorageLocation

func (s *Store) GetStorageLocation(_ context.Context, id string) (store.StorageLocation, error)

GetStorageLocation returns the location with the given ID, or store.ErrNotFound.

func (*Store) GetStorageLocationByName

func (s *Store) GetStorageLocationByName(_ context.Context, name string) (store.StorageLocation, error)

GetStorageLocationByName returns the location with the given name, or store.ErrNotFound.

func (*Store) GetTask

func (s *Store) GetTask(_ context.Context, id string) (store.Task, error)

GetTask returns the task with the given ID, or store.ErrNotFound.

func (*Store) GetTaskAttempt

func (s *Store) GetTaskAttempt(_ context.Context, id string) (store.TaskAttempt, error)

GetTaskAttempt returns the attempt with the given ID, or store.ErrNotFound.

func (*Store) GetUsagePool

func (s *Store) GetUsagePool(_ context.Context, id string) (store.UsagePool, error)

GetUsagePool returns the pool with the given ID, or store.ErrNotFound.

func (*Store) GetUser added in v0.3.0

func (s *Store) GetUser(_ context.Context, id string) (store.User, error)

GetUser implements store.UserStore.

func (*Store) GetUserByExternalID added in v0.3.0

func (s *Store) GetUserByExternalID(_ context.Context, authSource, externalID string) (store.User, error)

GetUserByExternalID implements store.UserStore.

func (*Store) GetUserByUsername added in v0.3.0

func (s *Store) GetUserByUsername(_ context.Context, username string) (store.User, error)

GetUserByUsername implements store.UserStore.

func (*Store) GetWorker

func (s *Store) GetWorker(_ context.Context, id string) (store.Worker, error)

GetWorker returns the worker with the given ID, or store.ErrNotFound.

func (*Store) GetWorkerJoinTokenByHash added in v0.4.0

func (s *Store) GetWorkerJoinTokenByHash(_ context.Context, hash string) (store.WorkerJoinToken, error)

GetWorkerJoinTokenByHash implements store.WorkerCredentialStore.

func (*Store) InjectClaim added in v0.4.0

func (s *Store) InjectClaim(_ context.Context, claim store.UsageClaim) (store.UsageClaim, error)

InjectClaim stores claim active, as SQLite inserts it: a zero ClaimedAt is stamped now and ReleasedAt is ignored. Same contract as Store.InjectTaskAttempt. The ID must be new and the (TaskAttemptID, PoolID) pair unique among active claims, as SQLite's primary key and index require; it returns store.ErrConflict if either is not.

func (*Store) InjectTaskAttempt added in v0.4.0

func (s *Store) InjectTaskAttempt(_ context.Context, attempt store.TaskAttempt) (store.TaskAttempt, error)

InjectTaskAttempt stores attempt as given, with no state checks; a zero CreatedAt is stamped now.

Corruption injection for invariant, recovery and repair tests: it exists to build states production cannot reach, and must never be used to seed a reachable one — seed through CreateJobSubmission and production writes instead (internal/store/storetest). It is not part of store.Store. Unlike SQLite, the fake has no foreign keys, so an orphan attempt is accepted; a reused ID is store.ErrConflict, as SQLite's primary key makes it.

func (*Store) InjectWorkerPowerState added in v0.4.0

func (s *Store) InjectWorkerPowerState(
	_ context.Context, workerID string, state store.PowerState, at time.Time, reason string,
) error

InjectWorkerPowerState sets the worker's power state, its time and its reason as given. Same contract as Store.InjectTaskAttempt. It returns store.ErrNotFound for an unknown worker.

func (*Store) JobTimings added in v0.4.0

func (s *Store) JobTimings(_ context.Context, jobIDs []string) (map[string]store.JobTiming, error)

JobTimings implements store.TimingStore.

func (*Store) LatestAttemptProgress added in v0.4.0

func (s *Store) LatestAttemptProgress(_ context.Context, taskIDs []string) (map[string]store.TaskProgress, error)

LatestAttemptProgress implements store.TaskAttemptStore.

func (*Store) LatestTaskAttempt

func (s *Store) LatestTaskAttempt(_ context.Context, taskID string) (store.TaskAttempt, error)

LatestTaskAttempt returns the attempt with the highest AttemptNumber for the given task, or store.ErrNotFound if no attempts exist.

func (*Store) LeaseTask added in v0.4.0

func (s *Store) LeaseTask(ctx context.Context, req store.LeaseRequest) (store.LeaseResult, error)

LeaseTask implements store.TaskStore. Every outcome is decided under the store lock before anything is written, so a non-leased outcome or an error changes nothing, as a rolled-back transaction does in the SQL stores.

The outcomes match the SQL stores':

  • an unknown task, or one whose job, queue or farm row is missing, is Lost (the SQL lease joins all three);
  • a task failing ListReadyTasks' eligibility predicate (isReadyInFarm) is Lost;
  • a disabled, retiring or asleep worker is Lost; an offline worker, or one with no row, is Lost only when the request sets RequireOnline;
  • the queue cap is checked before the farm cap;
  • pools are checked in pool-ID order, whatever order the request lists them in, so the same full pool is reported;
  • a request naming one pool twice sees its own first claim, so it is PoolFull when that fills the pool, and ErrConflict otherwise (the SQL stores' unique (task_attempt_id, pool_id) index).

func (*Store) ListAPIKeysForUser added in v0.3.0

func (s *Store) ListAPIKeysForUser(_ context.Context, userID string) ([]store.APIKey, error)

ListAPIKeysForUser implements store.APIKeyStore.

func (*Store) ListActiveWorkerCredentials added in v0.4.0

func (s *Store) ListActiveWorkerCredentials(_ context.Context) ([]store.WorkerCredential, error)

ListActiveWorkerCredentials implements store.WorkerCredentialStore.

func (*Store) ListAuditEntries

func (s *Store) ListAuditEntries(_ context.Context, entityType, entityID string) ([]store.AuditEntry, error)

ListAuditEntries returns all audit entries for the given entity, ordered by CreatedAt ascending. Pass empty strings to list all entries. A test oracle: nothing in production reads the audit log, so it is not part of store.Store. Mirrors the SQL store method of the same name.

func (*Store) ListBlockedJobs added in v0.2.0

func (s *Store) ListBlockedJobs(_ context.Context) ([]store.Job, error)

ListBlockedJobs returns every job currently in store.JobStatusBlocked.

func (*Store) ListCapacityGroupMembers added in v0.4.0

func (s *Store) ListCapacityGroupMembers(_ context.Context, groupID string) ([]store.Worker, error)

ListCapacityGroupMembers implements store.WorkerStore: the group's workers by hostname, then ID.

func (*Store) ListCapacityGroupStates added in v0.4.0

func (s *Store) ListCapacityGroupStates(_ context.Context) (map[string]store.CapacityGroupState, error)

ListCapacityGroupStates implements store.CapacityPowerStore.

func (*Store) ListCapacityGroupTokens added in v0.4.0

func (s *Store) ListCapacityGroupTokens(_ context.Context, groupID string) ([]store.WorkerJoinToken, error)

ListCapacityGroupTokens implements store.WorkerCredentialStore.

func (*Store) ListCapacityGroups added in v0.4.0

func (s *Store) ListCapacityGroups(_ context.Context) ([]store.CapacityGroup, error)

ListCapacityGroups returns all groups ordered by priority descending, then name.

func (*Store) ListComputeLocations added in v0.2.0

func (s *Store) ListComputeLocations(_ context.Context) ([]store.ComputeLocation, error)

ListComputeLocations returns all locations ordered by name.

func (*Store) ListDependents added in v0.2.0

func (s *Store) ListDependents(_ context.Context, upstreamJobID string) ([]string, error)

ListDependents returns the IDs of jobs that declared a dependency on upstreamJobID, ordered by dependent job ID.

func (*Store) ListFarms

func (s *Store) ListFarms(_ context.Context) ([]store.Farm, error)

ListFarms returns all farms ordered by name.

func (*Store) ListJobDependencyIDs added in v0.2.0

func (s *Store) ListJobDependencyIDs(_ context.Context, jobID string) ([]string, error)

ListJobDependencyIDs returns the upstream job IDs jobID waits on, ordered by upstream job ID (matching the SQL implementation's ORDER BY).

func (*Store) ListJobIDsWithPendingSteps added in v0.4.0

func (s *Store) ListJobIDsWithPendingSteps(_ context.Context) ([]string, error)

ListJobIDsWithPendingSteps implements store.StepStore. Like the SQLite query it lists only jobs that exist, are not terminal and are not blocked.

func (*Store) ListJobs

func (s *Store) ListJobs(_ context.Context, opts store.ListJobsOptions) (store.Page[store.Job], error)

ListJobs returns a paginated, filtered, and sorted page of jobs matching opts.

func (*Store) ListOpenAttempts added in v0.4.0

func (s *Store) ListOpenAttempts(_ context.Context) ([]store.OpenAttempt, error)

ListOpenAttempts implements store.TaskAttemptStore.

func (*Store) ListProducts added in v0.2.0

func (s *Store) ListProducts(_ context.Context) ([]store.Product, error)

ListProducts returns all products ordered by name.

func (*Store) ListQueues

func (s *Store) ListQueues(_ context.Context, opts store.ListQueuesOptions) (store.Page[store.Queue], error)

ListQueues returns a paginated, filtered, and sorted page of queues matching opts.

func (*Store) ListReadyStepDemand added in v0.4.0

func (s *Store) ListReadyStepDemand(_ context.Context, farmID string, now time.Time) ([]store.StepDemand, error)

ListReadyStepDemand implements store.TaskStore, with the eligibility predicate of CountReadyTasksByQueue (see isReadyInFarm).

func (*Store) ListReadyTasks

func (s *Store) ListReadyTasks(_ context.Context, farmID string, now time.Time, limit int) ([]store.Task, error)

ListReadyTasks returns up to limit tasks in store.TaskStatusReady that belong to non-paused queues within the given farm, excluding tasks still backing off (RetryAfter after now) and tasks whose job is paused or terminal, ordered by job priority descending then CreatedAt ascending.

func (*Store) ListServerMembers added in v0.4.0

func (s *Store) ListServerMembers(_ context.Context) ([]store.ServerMember, int64, error)

ListServerMembers implements store.LeadershipStore.

func (*Store) ListStaleWorkers

func (s *Store) ListStaleWorkers(_ context.Context, before time.Time) ([]store.Worker, error)

ListStaleWorkers returns workers whose last heartbeat is older than before (see [heartbeatBefore]) and whose status is store.WorkerStatusOnline, disabled or not.

func (*Store) ListSteps

func (s *Store) ListSteps(_ context.Context, jobID string) ([]store.Step, error)

ListSteps returns all steps for the given job, ordered by StepOrder ascending.

func (*Store) ListStorageLocations

func (s *Store) ListStorageLocations(_ context.Context) ([]store.StorageLocation, error)

ListStorageLocations returns all locations ordered by name.

func (*Store) ListStuckSteps added in v0.4.0

func (s *Store) ListStuckSteps(_ context.Context) ([]store.Step, error)

ListStuckSteps implements store.StepStore. Like the SQLite query it lists only steps of a job that exists and is not terminal: a terminal job has no downstream that needs its steps finalized.

func (*Store) ListTaskAttempts

func (s *Store) ListTaskAttempts(_ context.Context, taskID string) ([]store.TaskAttempt, error)

ListTaskAttempts returns all attempts for the given task, ordered by AttemptNumber ascending.

func (*Store) ListTaskLogs

func (s *Store) ListTaskLogs(_ context.Context, attemptID string, afterNATSSeq int64, limit int) ([]store.TaskLog, error)

ListTaskLogs implements store.TaskLogStore. Returns chunks for attemptID with NATSSeq > afterNATSSeq, sorted by NATSSeq ascending.

func (*Store) ListTasks

func (s *Store) ListTasks(_ context.Context, opts store.ListTasksOptions) (store.Page[store.Task], error)

ListTasks returns a paginated, filtered, and sorted page of tasks matching opts.

func (*Store) ListUsagePoolUtilization

func (s *Store) ListUsagePoolUtilization(_ context.Context) ([]store.UsagePoolUtilization, error)

ListUsagePoolUtilization returns all pools ordered by name, each paired with its current number of active claims.

func (*Store) ListUsagePools

func (s *Store) ListUsagePools(_ context.Context) ([]store.UsagePool, error)

ListUsagePools returns all pools ordered by name.

func (*Store) ListUsers added in v0.3.0

func (s *Store) ListUsers(_ context.Context) ([]store.User, error)

ListUsers implements store.UserStore.

func (*Store) ListWorkerCommitments added in v0.4.0

func (s *Store) ListWorkerCommitments(_ context.Context, farmID string) (map[string]store.WorkerCommitment, error)

ListWorkerCommitments implements store.TaskStore.

func (*Store) ListWorkers

func (s *Store) ListWorkers(_ context.Context, opts store.ListWorkersOptions) (store.Page[store.Worker], error)

ListWorkers returns a paginated, filtered, and sorted page of workers matching opts.

func (*Store) MarkWaking added in v0.4.0

func (s *Store) MarkWaking(ctx context.Context, groupID string, workerIDs []string, now time.Time) ([]string, error)

MarkWaking implements store.CapacityPowerStore.

func (*Store) MarkWorkerJoinTokenUsed added in v0.4.0

func (s *Store) MarkWorkerJoinTokenUsed(ctx context.Context, id string, at time.Time) error

MarkWorkerJoinTokenUsed implements store.WorkerCredentialStore.

func (*Store) OfflineStaleWorker added in v0.4.0

func (s *Store) OfflineStaleWorker(ctx context.Context, id string, cutoff, now time.Time) ([]store.Task, bool, error)

OfflineStaleWorker implements store.WorkerStore.

The outcomes match the SQL store's, which is the reference: the worker goes offline only while it is online, disabled or not, and its heartbeat is strictly older than cutoff (a worker with no recorded heartbeat is never stale, as SQL's NULL comparison has it, and an unknown worker is not stale); otherwise nothing is written. See [Store.offlineWorkerLocked] for what a match does.

func (*Store) OfflineWorker added in v0.4.0

func (s *Store) OfflineWorker(ctx context.Context, id, instanceID string, now time.Time) ([]store.Task, bool, error)

OfflineWorker implements store.WorkerStore. An unknown worker is store.ErrNotFound, as in SQLite. A known worker whose stored instance ID and instanceID are both non-empty and differ is left untouched (false); any other known worker, whatever its status, goes offline, and a disabled one stays disabled.

func (*Store) ParkJob added in v0.2.0

func (s *Store) ParkJob(ctx context.Context, jobID, reason string, now time.Time) error

ParkJob implements store.JobStore. It transitions the job to store.JobStatusPaused and records reason, but only while the job is non-terminal; a terminal job (completed/failed/canceled) is a legitimate no-op.

func (*Store) PauseJob added in v0.4.0

func (s *Store) PauseJob(ctx context.Context, id string, now time.Time) error

PauseJob implements store.JobStore.

func (*Store) PromoteJobRunning added in v0.4.0

func (s *Store) PromoteJobRunning(ctx context.Context, id string, now time.Time) (bool, error)

PromoteJobRunning implements store.JobStore. Like the SQLite statement it writes only a pending job and reports false, without error, for an unknown job.

func (*Store) PutCapacityGroupState added in v0.4.0

func (s *Store) PutCapacityGroupState(ctx context.Context, st store.CapacityGroupState) error

PutCapacityGroupState implements store.CapacityPowerStore.

func (*Store) QueueJobTimings added in v0.4.0

func (s *Store) QueueJobTimings(_ context.Context, queueIDs []string) ([]store.JobTiming, error)

QueueJobTimings implements store.TimingStore. Jobs are ordered by ID, as on the SQL stores.

func (*Store) ReclaimStaleAssignedTasks

func (s *Store) ReclaimStaleAssignedTasks(ctx context.Context, cutoff time.Time, skip map[string]bool) ([]store.Task, error)

ReclaimStaleAssignedTasks resets tasks stuck in store.TaskStatusAssigned with an AssignedAt older than cutoff back to store.TaskStatusReady, closes each reclaimed task's running attempts as failed and releases the claims of its closed attempts, and returns the reclaimed tasks as they are after the reset (assigned_worker_id empty), matching the SQL store's RETURNING. Tasks named in skip are left as they are.

func (*Store) ReclaimTaskAttempt added in v0.4.0

func (s *Store) ReclaimTaskAttempt(ctx context.Context, attemptID, taskID string, now time.Time) (bool, error)

ReclaimTaskAttempt implements store.TaskStore; outcomes match the SQL store's.

func (*Store) RecordAttemptProgress added in v0.4.0

func (s *Store) RecordAttemptProgress(ctx context.Context, p store.AttemptProgress) (store.ProgressOutcome, string, error)

RecordAttemptProgress implements store.TaskStore; outcomes match the SQL store's.

func (*Store) RecordTaskFailure added in v0.2.0

func (s *Store) RecordTaskFailure(
	ctx context.Context,
	attemptID, taskID string,
	exitCode *int,
	sessionID, message string,
	now time.Time,
) (taskFailed, jobFailed int, firstClose bool, err error)

RecordTaskFailure implements store.TaskStore. Under the store lock it closes the attempt as failed and increments the task's and job's FailedAttempts counters only when the attempt is still running (the first delivery of the failure). A redelivery — whose attempt is already terminal, or whose attempt is unknown — does not re-count; it returns the current counters so the caller's retry/park decision is stable across redeliveries. Either way the attempt's active usage claims are released (invariant I3).

func (*Store) RedeemWorkerJoinToken added in v0.4.0

func (s *Store) RedeemWorkerJoinToken(ctx context.Context, hash string, now time.Time, cred store.WorkerCredential) (store.WorkerCredential, error)

RedeemWorkerJoinToken implements store.WorkerCredentialStore.

Mirrors SQLite's transaction: the token claim and the credential creation happen under one hold of the mutex, so a caller never observes the token consumed without the credential existing, or the reverse. An unknown, expired, revoked or already-claimed token is store.ErrNotFound with cred left uncreated; a cred that collides with an existing worker_id or public_key is store.ErrConflict with the token left unclaimed, as in SQLite's rollback: nothing is written until both checks pass.

func (*Store) RegisterWorker

func (s *Store) RegisterWorker(ctx context.Context, worker store.Worker) (store.Worker, store.Registration, error)

RegisterWorker implements store.WorkerStore: it inserts or replaces the worker record for the given ID, except that an empty InstanceID keeps the stored one and Disabled, CapacityGroupID and Ephemeral are never taken from the registration: a new worker is enabled and in no group, and an existing one keeps them, as the SQL upsert leaves those columns alone. Interfaces and CloudInstanceID are taken from it unless empty, when the stored ones are kept. The power state is decided as the SQL upsert decides it: a waking, asleep or wake-failed worker becomes awake (its time is now and its reason is cleared), a retiring one stays retiring, and a new worker is awake. A nil RegistrationBrokerAt keeps the stored one. A registration stamped earlier than the stored one (store.StaleRegistration) is refused with store.ErrStaleRegistration, returning the stored worker. A non-empty stored InstanceID that differs from a non-empty incoming one is a restarted worker process, whose assigned and running tasks are reclaimed as the offline transitions reclaim them, with store.FailureReasonWorkerRestarted; the store lock stands in for the SQL stores' worker-row and job-row anchors. StartedAt is stamped as the SQL upsert stamps it ([registeredStartedAt]).

func (*Store) ReleaseBlockedJob added in v0.4.0

func (s *Store) ReleaseBlockedJob(ctx context.Context, id string, now time.Time) (bool, error)

ReleaseBlockedJob implements store.JobStore.

func (*Store) ReleaseLeadership added in v0.4.0

func (s *Store) ReleaseLeadership(_ context.Context, holder string, epoch int64) error

ReleaseLeadership implements store.LeadershipStore.

func (*Store) ReleaseStep added in v0.4.0

func (s *Store) ReleaseStep(ctx context.Context, id string, now time.Time) (bool, []store.Task, error)

ReleaseStep implements store.StepStore.

func (*Store) RenewLeadership added in v0.4.0

func (s *Store) RenewLeadership(_ context.Context, holder string, epoch int64, ttl time.Duration) (bool, error)

RenewLeadership implements store.LeadershipStore.

func (*Store) RequeueTaskForRetry added in v0.2.0

func (s *Store) RequeueTaskForRetry(ctx context.Context, taskID, attemptID string, retryAfter, now time.Time) (bool, error)

RequeueTaskForRetry implements store.TaskStore. It returns the task to store.TaskStatusReady, clears its worker assignment, and stamps RetryAfter. Guarded to assigned/running and to attemptID being the task's latest attempt (open or already closed, as SQLite's); anything else (including a missing task) is a legitimate no-op reported as false.

func (*Store) ResumeJob added in v0.2.0

func (s *Store) ResumeJob(ctx context.Context, jobID string, now time.Time) error

ResumeJob implements store.JobStore. It transitions a paused job back to store.JobStatusPending, or to store.JobStatusBlocked while it still holds its dependencies; an auto-parked job (non-empty ParkReason) also has its ParkReason cleared and FailedAttempts reset. A job that is no longer paused is a legitimate no-op.

func (*Store) RetryTasks

func (s *Store) RetryTasks(ctx context.Context, jobID string, taskIDs []string, now time.Time) ([]store.Task, error)

RetryTasks revives failed/canceled tasks (ready under a ready step, else pending) and resets their terminal steps and the terminal job. See store.TaskStore.RetryTasks.

func (*Store) RevokeAPIKey added in v0.3.0

func (s *Store) RevokeAPIKey(ctx context.Context, id, userID string, now time.Time) error

RevokeAPIKey implements store.APIKeyStore.

func (*Store) RevokeCapacityGroupToken added in v0.4.0

func (s *Store) RevokeCapacityGroupToken(ctx context.Context, groupID, id string, at time.Time) error

RevokeCapacityGroupToken implements store.WorkerCredentialStore.

func (*Store) RevokeWorkerCredential added in v0.4.0

func (s *Store) RevokeWorkerCredential(ctx context.Context, workerID string, at time.Time) error

RevokeWorkerCredential implements store.WorkerCredentialStore.

func (*Store) RunningProgressByJob added in v0.4.0

func (s *Store) RunningProgressByJob(_ context.Context, jobID string) (float64, error)

RunningProgressByJob implements store.TaskAttemptStore.

func (*Store) RunningProgressByJobs added in v0.4.0

func (s *Store) RunningProgressByJobs(_ context.Context, jobIDs []string) (map[string]float64, error)

RunningProgressByJobs implements store.TaskAttemptStore.

func (*Store) SetBrokerIdentity added in v0.4.0

func (s *Store) SetBrokerIdentity(ctx context.Context, identity string, _ time.Time) error

SetBrokerIdentity implements store.BrokerStateStore.

func (*Store) SetClock added in v0.4.0

func (s *Store) SetClock(now func() int64)

SetClock replaces the clock the lease and membership timestamps are read from, so a test moves time without sleeping. now returns microseconds since the Unix epoch; nil restores the real clock.

func (*Store) SetTaskUnschedulableReason added in v0.2.0

func (s *Store) SetTaskUnschedulableReason(ctx context.Context, id, reason string) (bool, error)

SetTaskUnschedulableReason implements store.TaskStore. A task that is no longer ready is a guarded no-op returning (false, nil); only an unknown task is an error.

func (*Store) SetUserDisplayName added in v0.3.0

func (s *Store) SetUserDisplayName(ctx context.Context, id, displayName string) (store.User, error)

SetUserDisplayName implements store.UserStore.

func (*Store) SetUserPassword added in v0.3.0

func (s *Store) SetUserPassword(ctx context.Context, id, passwordHash string) error

SetUserPassword implements store.UserStore.

func (*Store) SetUserPasswordAndEvictSessions added in v0.3.0

func (s *Store) SetUserPasswordAndEvictSessions(ctx context.Context, id, passwordHash string) error

SetUserPasswordAndEvictSessions implements store.UserStore. The whole operation runs under one lock, mirroring SQLite's transaction.

func (*Store) SetWorkerCapacityGroup added in v0.4.0

func (s *Store) SetWorkerCapacityGroup(ctx context.Context, workerID, groupID string, ephemeral bool) (store.Worker, error)

SetWorkerCapacityGroup implements store.WorkerStore.

func (*Store) SetWorkerDisabled added in v0.4.0

func (s *Store) SetWorkerDisabled(ctx context.Context, id string, disabled bool) (store.Worker, error)

SetWorkerDisabled implements store.WorkerStore.

func (*Store) StartTaskAttempt added in v0.4.0

func (s *Store) StartTaskAttempt(ctx context.Context, attemptID, taskID, sessionID string, now time.Time) (bool, error)

StartTaskAttempt implements store.TaskStore; outcomes match the SQL store's.

func (*Store) TouchAPIKeyLastUsed added in v0.3.0

func (s *Store) TouchAPIKeyLastUsed(ctx context.Context, id string, now time.Time) error

TouchAPIKeyLastUsed implements store.APIKeyStore.

func (*Store) TouchWorkerCredential added in v0.4.0

func (s *Store) TouchWorkerCredential(ctx context.Context, workerID string, at time.Time) (store.WorkerCredential, error)

TouchWorkerCredential implements store.WorkerCredentialStore.

func (*Store) UpdateCapacityGroup added in v0.4.0

func (s *Store) UpdateCapacityGroup(ctx context.Context, g store.CapacityGroup) (store.CapacityGroup, error)

UpdateCapacityGroup replaces the mutable fields of an existing group and updates UpdatedAt; the ID, farm and CreatedAt are kept. Returns store.ErrNotFound or store.ErrConflict.

func (*Store) UpdateComputeLocation added in v0.2.0

func (s *Store) UpdateComputeLocation(ctx context.Context, loc store.ComputeLocation) (store.ComputeLocation, error)

UpdateComputeLocation replaces the mutable fields of an existing location and updates UpdatedAt. Returns store.ErrNotFound or store.ErrConflict.

func (*Store) UpdateFarm

func (s *Store) UpdateFarm(ctx context.Context, farm store.Farm) (store.Farm, error)

UpdateFarm replaces the mutable fields (Name, Description, MaxConcurrentTasks) of an existing farm and updates UpdatedAt. Returns store.ErrNotFound if the farm does not exist, or store.ErrConflict if the new name is already taken.

func (*Store) UpdateJob

func (s *Store) UpdateJob(ctx context.Context, job store.Job) (store.Job, error)

UpdateJob replaces only the mutable user-settable fields of an existing job. Lifecycle and submission fields (status, started_at, completed_at, created_at, parameters, declared extensions, failed_attempts, park_reason) keep their stored values, as on SQLite, whose UPDATE does not set them.

func (*Store) UpdateProduct added in v0.2.0

func (s *Store) UpdateProduct(ctx context.Context, p store.Product) (store.Product, error)

UpdateProduct replaces mutable fields of the product with p.Name.

func (*Store) UpdateQueue

func (s *Store) UpdateQueue(ctx context.Context, queue store.Queue) (store.Queue, error)

UpdateQueue replaces the mutable fields of an existing queue and updates UpdatedAt. Returns store.ErrNotFound or store.ErrConflict as appropriate.

func (*Store) UpdateStorageLocation

func (s *Store) UpdateStorageLocation(ctx context.Context, loc store.StorageLocation) (store.StorageLocation, error)

UpdateStorageLocation replaces the mutable fields of an existing location and updates UpdatedAt. Returns store.ErrNotFound or store.ErrConflict.

func (*Store) UpdateUsagePool

func (s *Store) UpdateUsagePool(ctx context.Context, pool store.UsagePool) (store.UsagePool, error)

UpdateUsagePool replaces the mutable fields of an existing pool and updates UpdatedAt. Returns store.ErrNotFound or store.ErrConflict.

func (*Store) UpdateUser added in v0.3.0

func (s *Store) UpdateUser(ctx context.Context, u store.User) (store.User, error)

UpdateUser implements store.UserStore. It is unguarded; see Store.UpdateUserKeepingAdmin.

func (*Store) UpdateUserKeepingAdmin added in v0.4.0

func (s *Store) UpdateUserKeepingAdmin(ctx context.Context, u store.User) (store.User, error)

UpdateUserKeepingAdmin implements store.UserStore. The guard and the write run under one lock hold, so no other writer can slip between them.

func (*Store) UpdateWorkerHeartbeat

func (s *Store) UpdateWorkerHeartbeat(
	ctx context.Context, id string, at time.Time, brokerAt, startedAt *time.Time,
) (store.HeartbeatOutcome, error)

UpdateWorkerHeartbeat records the most recent heartbeat time for the given worker and reports its status and power state. A heartbeat the broker stamped before the recorded one is ignored; an unstamped one is recorded unconditionally and keeps the recorded stamp. startedAt moves StartedAt as the SQL stores move it ([heartbeatStartedAt]).

func (*Store) UpsertServerMember added in v0.4.0

func (s *Store) UpsertServerMember(_ context.Context, m store.ServerMember) error

UpsertServerMember implements store.LeadershipStore.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL