Documentation ¶
Index ¶
- type ObjectCache
- type ObjectManifest
- type ObjectVersion
- type StorageRoot
- func (store *StorageRoot) Commit(ctx context.Context, objectID string, stage *ocfl.Stage, ...) error
- func (store *StorageRoot) DeleteObject(ctx context.Context, objectID string) error
- func (store *StorageRoot) Description() string
- func (store *StorageRoot) FS() ocfl.WriteFS
- func (store *StorageRoot) GetObjectManifest(ctx context.Context, objectID string) (*ObjectManifest, error)
- func (store *StorageRoot) GetObjectVersion(ctx context.Context, objectID string, verIndex int) (*ObjectVersion, error)
- func (store *StorageRoot) ID() string
- func (store *StorageRoot) Path() string
- func (store *StorageRoot) Ready(ctx context.Context) error
- func (store *StorageRoot) ResolveID(id string) (string, error)
- func (store *StorageRoot) Spec() ocfl.Spec
- func (store *StorageRoot) Validate(ctx context.Context, opts ...ocflv1.ValidationOption) (*validation.Result, error)
- type StorageRootInitializer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ObjectCache ¶
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)
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) 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