state

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Key

func Key(registry, owner, name, ref string) string

Key builds the canonical key for an image ref.

Types

type Entry

type Entry struct {
	Digest      string    `json:"digest"`
	ETag        string    `json:"etag,omitempty"`
	Policy      string    `json:"policy,omitempty"`
	LastChecked time.Time `json:"lastChecked"`
	LastChanged time.Time `json:"lastChanged"`
}

Entry captures the last-known info for a single image reference.

type File

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

File is a JSON-backed state store.

func New

func New(path string) *File

New creates a new File state store; Load must be called to populate from disk.

func (*File) Get

func (f *File) Get(key string) (Entry, bool)

Get returns the entry for a key (registry/owner/name:ref).

func (*File) Load

func (f *File) Load() error

Load reads state from disk if present; creates parent dir if missing.

func (*File) Save

func (f *File) Save() error

Save writes state to disk atomically.

func (*File) UpdateChecked

func (f *File) UpdateChecked(key string, policy string)

UpdateChecked updates the LastChecked timestamp without changing digest.

func (*File) UpsertDigest

func (f *File) UpsertDigest(key, digest, etag, policy string) bool

UpsertDigest sets digest/etag; returns true if digest changed.

Jump to

Keyboard shortcuts

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