objectstore

package
v0.1.0-round1 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package objectstore provides the local content-addressed artifact store.

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 a path-confined, content-addressed local artifact store.

func New

func New(root string) (*Store, error)

New returns an artifact store rooted at an existing or newly created directory.

func (*Store) Path

func (s *Store) Path(key string) (string, error)

Path resolves one relative key while preventing traversal outside the root.

func (*Store) Put

func (s *Store) Put(ctx context.Context, content []byte) (string, error)

Put durably stores content once and returns its deterministic relative key.

func (*Store) Read

func (s *Store) Read(ctx context.Context, key string) ([]byte, error)

Read returns one artifact while preserving cancellation and path confinement.

func (*Store) Readable

func (s *Store) Readable(ctx context.Context) error

Readable verifies that the root directory can be inspected without mutating it.

func (*Store) Ready

func (s *Store) Ready(ctx context.Context) error

Ready verifies that the root directory is readable and writable now.

func (*Store) Remove

func (s *Store) Remove(ctx context.Context, key string) error

Remove deletes one exact artifact. Callers must first prove that no durable database record references the content-addressed key.

func (*Store) Verify

func (s *Store) Verify(ctx context.Context, key, expectedSHA256 string) error

Verify proves that one confined object is readable and still matches the immutable SHA-256 digest recorded at registration time.

Jump to

Keyboard shortcuts

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