lockfile

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Namespace string
	Operation string
	Inputs    []any
	Value     any
	Policy    string
}

Entry is a single lockfile tuple entry.

type Lockfile

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

Lockfile stores lock entries keyed by (namespace, operation, inputs).

func New

func New() *Lockfile

New returns an empty lockfile.

func Parse

func Parse(data []byte) (*Lockfile, error)

Parse decodes lockfile JSON lines.

Non-empty files must start with a version header line: [["version","1"]].

func (*Lockfile) Delete

func (l *Lockfile) Delete(namespace, operation string, inputs []any) bool

Delete removes the result for (namespace, operation, inputs).

func (*Lockfile) Entries

func (l *Lockfile) Entries() []Entry

Entries returns a deterministic snapshot of all lock entries.

func (*Lockfile) Get

func (l *Lockfile) Get(namespace, operation string, inputs []any) (any, string, bool)

Get retrieves the value and policy for (namespace, operation, inputs).

func (*Lockfile) Marshal

func (l *Lockfile) Marshal() ([]byte, error)

Marshal encodes lockfile entries to deterministic JSON lines.

Empty lockfiles marshal to empty bytes.

func (*Lockfile) Set

func (l *Lockfile) Set(namespace, operation string, inputs []any, value any, policy string) error

Set records the value and policy for (namespace, operation, inputs).

Jump to

Keyboard shortcuts

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