Help us shape the future of Go! Take the 2026 Go Developer Survey

archive

package
v0.62.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package archive provides a persistence.Store backed by a durable state archive.

It is a thin, graph-specific adapter over the shared pluggable storage backend in pkg/statearchive: it maps persistence.Key values to JSON files in the archive and delegates storage I/O to an explicitly supplied statearchive.Archive.

Key -> path layout in the archive:

<namespace>/<name>.json

Index

Constants

View Source
const (
	// DefaultGraphArchive is the default archive name for graph artifacts.
	DefaultGraphArchive = "radius-graph"

	// DefaultGraphBranch is deprecated. Use DefaultGraphArchive.
	DefaultGraphBranch = DefaultGraphArchive
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	// ArchiveName is the archive used to persist graphs. If empty,
	// DefaultGraphArchive is used.
	ArchiveName string

	// Branch is deprecated. Use ArchiveName.
	Branch string

	// Archive is the durable state archive and must not be nil.
	Archive statearchive.Archive
}

Options configures a Store.

type Store

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

Store is a persistence.Store that persists each graph as a JSON file in a durable state archive.

Concurrency: the persistence.Store contract requires implementations to be safe for concurrent use. Serialization is delegated to the archive.

func NewStore

func NewStore(opts Options) (*Store, error)

NewStore returns a Store backed by the supplied archive.

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, key persistence.Key) error

Delete removes the file for key and commits the deletion.

func (*Store) List

func (s *Store) List(ctx context.Context, namespace string) ([]persistence.Key, error)

List returns keys present in the archive under namespace. An empty namespace lists every key in the archive.

func (*Store) Load

Load returns the graph previously stored under key, or persistence.ErrNotFound.

func (*Store) Save

Save commits graph to the configured archive under constructPathForKey(key).

Jump to

Keyboard shortcuts

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