coordination

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package coordination is the shared contract maintenance backends and checkpoint/restore callers enforce before mutating a published artifact. No storage I/O here, just identity validation and locking.

Index

Constants

This section is empty.

Variables

View Source
var ErrStoreMismatch = fmt.Errorf("storage binding does not match the configured store")

ErrStoreMismatch means the bound store differs from the store a request names.

Functions

func RequireStoreMatch

func RequireStoreMatch(boundStoreID, namedStoreID string) error

RequireStoreMatch refuses a request naming a different store than the one a content is bound to.

func ValidateBinding

func ValidateBinding(storeID, artifactUID, containerName string) error

ValidateBinding checks identity well-formedness. No storage or Kubernetes lookup.

Types

type Key

type Key struct {
	StoreID     string
	ArtifactUID string
}

Key identifies one (store, artifact) pair that delete and sweep work must serialize on.

type Locker

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

Locker gives per-Key exclusion so unrelated artifacts never block each other, while same-artifact operations never run concurrently.

func NewLocker

func NewLocker() *Locker

NewLocker returns a ready-to-use Locker.

func (*Locker) Lock

func (l *Locker) Lock(key Key) (unlock func())

Lock blocks until key is free, then returns an Unlock func to call exactly once. Entries are released once no caller still holds or waits on them.

Jump to

Keyboard shortcuts

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