store

package
v0.0.0-...-8c72eba Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ObjectCache

type ObjectCache interface {
	SetObjectManifest(ctx context.Context, m *chaparral.ObjectManifest) error
	GetObjectManifest(ctx context.Context, storeID string, objID string) (*chaparral.ObjectManifest, error)
	DeleteObject(ctx context.Context, storeID string, objID string) error
}

type ObjectManifest

type ObjectManifest struct {
	*chaparral.ObjectManifest
	// contains filtered or unexported fields
}

func (*ObjectManifest) Close

func (obj *ObjectManifest) Close() error

func (*ObjectManifest) GetContent

func (obj *ObjectManifest) GetContent(digest string) (ocfl.FS, string)

func (*ObjectManifest) GetFixity

func (obj *ObjectManifest) GetFixity(digest string) ocfl.DigestSet

type ObjectVersion

type ObjectVersion struct {
	chaparral.ObjectVersion
	// contains filtered or unexported fields
}

ObjectVersion represent an OCFL Object with a specific version state.

func (*ObjectVersion) Close

func (objState *ObjectVersion) Close() error

type StorageRoot

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

StorageRoot represent an existing OCFL Storage Root

func NewStorageRoot

func NewStorageRoot(id string, fsys ocfl.WriteFS, path string, init *StorageRootInitializer, cache ObjectCache) *StorageRoot

func (*StorageRoot) Commit

func (store *StorageRoot) Commit(ctx context.Context, objectID string, stage *ocfl.Stage, opts ...ocflv1.CommitOption) error

func (*StorageRoot) DeleteObject

func (store *StorageRoot) DeleteObject(ctx context.Context, objectID string) error

func (*StorageRoot) Description

func (store *StorageRoot) Description() string

Description returns the description stored with the OCFL storage root. It may be empty

func (*StorageRoot) FS

func (store *StorageRoot) FS() ocfl.WriteFS

FS returns the ocfl.WriteFS where the storage root is saved

func (*StorageRoot) GetObjectManifest

func (store *StorageRoot) GetObjectManifest(ctx context.Context, objectID string) (*ObjectManifest, error)

func (*StorageRoot) GetObjectVersion

func (store *StorageRoot) GetObjectVersion(ctx context.Context, objectID string, verIndex int) (*ObjectVersion, error)

GetObjectVersion returns an ObjectState that supports concurrent access. Commits to objectID will fail until the Close() is called on the returned Object.

func (*StorageRoot) ID

func (store *StorageRoot) ID() string

ID returns the storage root's unique ID

func (*StorageRoot) Path

func (store *StorageRoot) Path() string

Path returns store's path relative to its FS

func (*StorageRoot) Ready

func (store *StorageRoot) Ready(ctx context.Context) error

func (*StorageRoot) ResolveID

func (store *StorageRoot) ResolveID(id string) (string, error)

func (*StorageRoot) Spec

func (store *StorageRoot) Spec() ocfl.Spec

store returns the version of the OCFL specification useb by the storage root

func (*StorageRoot) Validate

func (store *StorageRoot) Validate(ctx context.Context, opts ...ocflv1.ValidationOption) (*validation.Result, error)

type StorageRootInitializer

type StorageRootInitializer struct {
	Description string `json:"description,omitempty"`
	Layout      string `json:"layout,omitempty"`
}

StorageRootInitializer is used to configure new storage roots that don't exist

Jump to

Keyboard shortcuts

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