extension

package
v2.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Index

Constants

View Source
const ContentSubPathDescription = "prepend a path inside the version content"
View Source
const ContentSubPathName = "NNNN-content-subpath"
View Source
const DigestAlgorithmsDescription = "" /* 129-byte string literal not displayed */
View Source
const DigestAlgorithmsName = "0001-digest-algorithms"
View Source
const DirectCleanDescription = "" /* 187-byte string literal not displayed */
View Source
const DirectCleanName = "NNNN-direct-clean-path-layout"
View Source
const FilesystemDescription = "preserves filesytem metadata"
View Source
const FilesystemName = "NNNN-filesystem"
View Source
const FlatOmitPrefixStorageLayoutDescription = "removes prefix after last occurrence of delimiter"
View Source
const FlatOmitPrefixStorageLayoutName = "0006-flat-omit-prefix-storage-layout"
View Source
const GOCFLExtensionManagerDescription = "initial extension for sorted exclusion and sorted execution"
View Source
const GOCFLExtensionManagerName = "NNNN-gocfl-extension-manager"
View Source
const IndexerDescription = "technical metadata for all files"
View Source
const IndexerName = "NNNN-indexer"
View Source
const InitialDescription = "initial extension defines the name of the extension manager"
View Source
const InitialName = "initial"
View Source
const LoggingIndexerName = "NNNN-indexer-logging-object"
View Source
const METSDescription = "METS/EAD3/PREMIS metadata"
View Source
const METSName = "NNNN-mets"
View Source
const MetaFileDescription = "adds a file in extension folder"
View Source
const MetaFileName = "NNNN-metafile"
View Source
const MigrationDescription = "preservation management - file migration"
View Source
const MigrationName = "NNNN-migration"
View Source
const NTupleOmitPrefixStorageLayoutDescription = "pairtree-like root directory structure derived from prefix-omitted object identifiers"
View Source
const NTupleOmitPrefixStorageLayoutName = "0007-n-tuple-omit-prefix-storage-layout"
View Source
const PathDirectName = "NNNN-direct-path-layout"
View Source
const StorageLayoutFlatDirectDescription = "one to one mapping without changes"
View Source
const StorageLayoutFlatDirectName = "0002-flat-direct-storage-layout"
View Source
const StorageLayoutHashAndIdNTupleDescription = "Hashed Truncated N-tuple Trees with Object ID Encapsulating Directory for OCFL Storage Hierarchies"
View Source
const StorageLayoutHashAndIdNTupleName = "0003-hash-and-id-n-tuple-storage-layout"
View Source
const StorageLayoutHashedNTupleDescription = "Hashed N-tuple Storage Layout"
View Source
const StorageLayoutHashedNTupleName = "0004-hashed-n-tuple-storage-layout"
View Source
const StorageLayoutPairTreeName = "NNNN-pairtree-storage-layout"
View Source
const ThumbnailDescription = "preservation management - file thumbnail"
View Source
const ThumbnailName = "NNNN-thumbnail"

Variables

View Source
var ErrNotSupported = errors.New("extension not supported")

Functions

func GetContentSubPathParams

func GetContentSubPathParams() []*ocfl.ExtensionExternalParam

func GetIndexerParams

func GetIndexerParams() []*ocfl.ExtensionExternalParam

func GetInitialParams added in v2.0.3

func GetInitialParams() []*ocfl.ExtensionExternalParam

func GetMetaFileParams

func GetMetaFileParams() []*ocfl.ExtensionExternalParam

func GetMetsParams

func GetMetsParams() []*ocfl.ExtensionExternalParam

func NewDirectClean

func NewDirectClean(config *DirectCleanConfig) (ocfl.Extension, error)

func NewDirectCleanFS

func NewDirectCleanFS(fsys fs.FS) (ocfl.Extension, error)

func NewPathDirectFS

func NewPathDirectFS(fsys fs.FS) (ocfl.Extension, error)

Types

type Config

type Config struct {
	ExtensionName string `json:"extensionName"`
}

type ContentSubPath

type ContentSubPath struct {
	*ContentSubPathConfig
	// contains filtered or unexported fields
}

func NewContentSubPath

func NewContentSubPath(config *ContentSubPathConfig) (*ContentSubPath, error)

func NewContentSubPathFS

func NewContentSubPathFS(fsys fs.FS) (*ContentSubPath, error)

func (*ContentSubPath) BuildObjectExtractPath

func (sl *ContentSubPath) BuildObjectExtractPath(object ocfl.Object, originalPath string, area string) (string, error)

func (*ContentSubPath) BuildObjectManifestPath

func (sl *ContentSubPath) BuildObjectManifestPath(object ocfl.Object, originalPath string, area string) (string, error)

func (*ContentSubPath) BuildObjectStatePath

func (sl *ContentSubPath) BuildObjectStatePath(object ocfl.Object, originalPath string, area string) (string, error)

func (*ContentSubPath) GetAreaPath

func (sl *ContentSubPath) GetAreaPath(object ocfl.Object, area string) (string, error)

func (*ContentSubPath) GetConfig

func (sl *ContentSubPath) GetConfig() any

func (*ContentSubPath) GetFS

func (sl *ContentSubPath) GetFS() fs.FS

func (*ContentSubPath) GetMetadata

func (sl *ContentSubPath) GetMetadata(object ocfl.Object) (map[string]any, error)

func (*ContentSubPath) GetName

func (sl *ContentSubPath) GetName() string

func (*ContentSubPath) IsRegistered

func (sl *ContentSubPath) IsRegistered() bool

func (*ContentSubPath) SetFS

func (sl *ContentSubPath) SetFS(fsys fs.FS)

func (*ContentSubPath) SetParams

func (sl *ContentSubPath) SetParams(params map[string]string) error

func (*ContentSubPath) UpdateObjectAfter

func (sl *ContentSubPath) UpdateObjectAfter(object ocfl.Object) error

func (*ContentSubPath) UpdateObjectBefore

func (sl *ContentSubPath) UpdateObjectBefore(object ocfl.Object) error

func (*ContentSubPath) WriteConfig

func (sl *ContentSubPath) WriteConfig() error

type ContentSubPathConfig

type ContentSubPathConfig struct {
	*ocfl.ExtensionConfig
	Paths map[string]ContentSubPathEntry `json:"subPath"`
}

type ContentSubPathEntry

type ContentSubPathEntry struct {
	Path        string `json:"path"`
	Description string `json:"description"`
}

type DigestAlgorithms

type DigestAlgorithms struct {
	*DigestAlgorithmsConfig
	// contains filtered or unexported fields
}

func NewDigestAlgorithms

func NewDigestAlgorithms(config *DigestAlgorithmsConfig) (*DigestAlgorithms, error)

func NewDigestAlgorithmsFS

func NewDigestAlgorithmsFS(fsys fs.FS) (*DigestAlgorithms, error)

func (*DigestAlgorithms) GetConfig

func (sl *DigestAlgorithms) GetConfig() any

func (*DigestAlgorithms) GetFS

func (sl *DigestAlgorithms) GetFS() fs.FS

func (*DigestAlgorithms) GetFixityDigests

func (sl *DigestAlgorithms) GetFixityDigests() []checksum.DigestAlgorithm

func (*DigestAlgorithms) GetName

func (sl *DigestAlgorithms) GetName() string

func (*DigestAlgorithms) IsRegistered

func (sl *DigestAlgorithms) IsRegistered() bool

func (*DigestAlgorithms) SetFS

func (sl *DigestAlgorithms) SetFS(fsys fs.FS)

func (*DigestAlgorithms) SetParams

func (sl *DigestAlgorithms) SetParams(params map[string]string) error

func (*DigestAlgorithms) WriteConfig

func (sl *DigestAlgorithms) WriteConfig() error

type DigestAlgorithmsConfig

type DigestAlgorithmsConfig struct {
	*ocfl.ExtensionConfig
}

type DirectClean

type DirectClean struct {
	*DirectCleanConfig
	// contains filtered or unexported fields
}

func (*DirectClean) BuildObjectManifestPath

func (sl *DirectClean) BuildObjectManifestPath(object ocfl.Object, originalPath string, area string) (string, error)

func (*DirectClean) BuildStorageRootPath

func (sl *DirectClean) BuildStorageRootPath(storageRoot ocfl.StorageRoot, id string) (string, error)

interface

func (*DirectClean) GetConfig

func (sl *DirectClean) GetConfig() any

func (*DirectClean) GetFS

func (sl *DirectClean) GetFS() fs.FS

func (*DirectClean) GetName

func (sl *DirectClean) GetName() string

func (*DirectClean) IsRegistered

func (sl *DirectClean) IsRegistered() bool

func (*DirectClean) SetFS

func (sl *DirectClean) SetFS(fsys fs.FS)

func (*DirectClean) SetParams

func (sl *DirectClean) SetParams(params map[string]string) error

func (*DirectClean) WriteConfig

func (sl *DirectClean) WriteConfig() error

func (*DirectClean) WriteLayout

func (sl *DirectClean) WriteLayout(fsys fs.FS) error

type DirectCleanConfig

type DirectCleanConfig struct {
	*ocfl.ExtensionConfig
	MaxPathnameLen              int                      `json:"maxPathnameLen"`
	MaxPathSegmentLen           int                      `json:"maxPathSegmentLen"`
	ReplacementString           string                   `json:"replacementString"`
	WhitespaceReplacementString string                   `json:"whitespaceReplacementString"`
	UTFEncode                   bool                     `json:"utfEncode"`
	FallbackDigestAlgorithm     checksum.DigestAlgorithm `json:"fallbackDigestAlgorithm"`
	FallbackFolder              string                   `json:"fallbackFolder"`
	NumberOfFallbackTuples      int                      `json:"numberOfFallbackTuples"`
	FallbackTupleSize           int                      `json:"fallbackTupleSize"`

	// compatibility with old config
	MaxFilenameLen     int `json:"maxFilenameLen,omitempty"`
	FallbackSubFolders int `json:"fallbackSubdirs,omitempty"`
}

type FileSystemLine

type FileSystemLine struct {
	Path string          `json:"path"`
	Meta *FilesystemMeta `json:"meta"`
}

type Filesystem

type Filesystem struct {
	*FilesystemConfig
	// contains filtered or unexported fields
}

func NewFilesystem

func NewFilesystem(config *FilesystemConfig) (*Filesystem, error)

func NewFilesystemFS

func NewFilesystemFS(fsys fs.FS, logger zLogger.ZWrapper) (*Filesystem, error)

func (*Filesystem) AddFileAfter

func (extFS *Filesystem) AddFileAfter(object ocfl.Object, sourceFS fs.FS, source []string, internalPath, digest, area string, isDir bool) error

func (*Filesystem) AddFileBefore

func (extFS *Filesystem) AddFileBefore(object ocfl.Object, sourceFS fs.FS, source string, dest string, area string, isDir bool) error

func (*Filesystem) DeleteFileAfter

func (extFS *Filesystem) DeleteFileAfter(object ocfl.Object, dest string, area string) error

func (*Filesystem) DeleteFileBefore

func (extFS *Filesystem) DeleteFileBefore(object ocfl.Object, dest string, area string) error

func (*Filesystem) DoNewVersion

func (extFS *Filesystem) DoNewVersion(object ocfl.Object) error

func (*Filesystem) GetConfig

func (extFS *Filesystem) GetConfig() any

func (*Filesystem) GetFS

func (extFS *Filesystem) GetFS() fs.FS

func (*Filesystem) GetMetadata

func (extFS *Filesystem) GetMetadata(object ocfl.Object) (map[string]any, error)

func (*Filesystem) GetName

func (extFS *Filesystem) GetName() string

func (*Filesystem) IsRegistered

func (extFS *Filesystem) IsRegistered() bool

func (*Filesystem) NeedNewVersion

func (extFS *Filesystem) NeedNewVersion(object ocfl.Object) (bool, error)

func (*Filesystem) SetFS

func (extFS *Filesystem) SetFS(fsys fs.FS)

func (*Filesystem) SetParams

func (extFS *Filesystem) SetParams(params map[string]string) error

func (*Filesystem) UpdateFileAfter

func (extFS *Filesystem) UpdateFileAfter(object ocfl.Object, sourceFS fs.FS, source, dest, area string, isDir bool) error

func (*Filesystem) UpdateFileBefore

func (extFS *Filesystem) UpdateFileBefore(object ocfl.Object, sourceFS fs.FS, source, dest, area string, isDir bool) error

func (*Filesystem) UpdateObjectAfter

func (extFS *Filesystem) UpdateObjectAfter(object ocfl.Object) error

func (*Filesystem) UpdateObjectBefore

func (extFS *Filesystem) UpdateObjectBefore(object ocfl.Object) error

func (*Filesystem) WriteConfig

func (extFS *Filesystem) WriteConfig() error

type FilesystemConfig

type FilesystemConfig struct {
	*ocfl.ExtensionConfig
	Folders     string `json:"folders"`
	StorageType string `json:"storageType"`
	StorageName string `json:"storageName"`
	Compress    string `json:"compress"`
}

type FilesystemMeta

type FilesystemMeta struct {
	ATime        time.Time `json:"aTime"`
	MTime        time.Time `json:"mTime"`
	CTime        time.Time `json:"cTime"`
	Attr         string    `json:"attr,omitempty"`
	Symlink      string    `json:"symlink,omitempty"`
	OS           string    `json:"os"`
	SystemStat   any       `json:"sysStat,omitempty"`
	StateVersion string    `json:"stateVersion"`
	Size         uint64    `json:"size"`
}

type FlatOmitPrefixStorageLayout

type FlatOmitPrefixStorageLayout struct {
	*FlatOmitPrefixStorageLayoutConfig
	// contains filtered or unexported fields
}

func NewFlatOmitPrefixStorageLayoutFS

func NewFlatOmitPrefixStorageLayoutFS(fsys fs.FS) (*FlatOmitPrefixStorageLayout, error)

func (*FlatOmitPrefixStorageLayout) BuildStorageRootPath

func (sl *FlatOmitPrefixStorageLayout) BuildStorageRootPath(storageRoot ocfl.StorageRoot, id string) (string, error)

func (*FlatOmitPrefixStorageLayout) GetConfig

func (sl *FlatOmitPrefixStorageLayout) GetConfig() any

func (*FlatOmitPrefixStorageLayout) GetFS

func (sl *FlatOmitPrefixStorageLayout) GetFS() fs.FS

func (*FlatOmitPrefixStorageLayout) GetName

func (sl *FlatOmitPrefixStorageLayout) GetName() string

func (*FlatOmitPrefixStorageLayout) IsRegistered

func (sl *FlatOmitPrefixStorageLayout) IsRegistered() bool

func (*FlatOmitPrefixStorageLayout) SetFS

func (sl *FlatOmitPrefixStorageLayout) SetFS(fsys fs.FS)

func (*FlatOmitPrefixStorageLayout) SetParams

func (sl *FlatOmitPrefixStorageLayout) SetParams(params map[string]string) error

func (*FlatOmitPrefixStorageLayout) Stat

func (sl *FlatOmitPrefixStorageLayout) Stat(w io.Writer, statInfo []ocfl.StatInfo) error

func (*FlatOmitPrefixStorageLayout) WriteConfig

func (sl *FlatOmitPrefixStorageLayout) WriteConfig() error

func (*FlatOmitPrefixStorageLayout) WriteLayout

func (sl *FlatOmitPrefixStorageLayout) WriteLayout(fsys fs.FS) error

type FlatOmitPrefixStorageLayoutConfig

type FlatOmitPrefixStorageLayoutConfig struct {
	*ocfl.ExtensionConfig
	Delimiter string `json:"delimiter"`
}

type GOCFLExtensionManager added in v2.0.3

type GOCFLExtensionManager struct {
	*ocfl.ExtensionManagerConfig
	// contains filtered or unexported fields
}

func NewGOCFLExtensionManager added in v2.0.3

func NewGOCFLExtensionManager(config *ocfl.ExtensionManagerConfig) (*GOCFLExtensionManager, error)

func NewGOCFLExtensionManagerFS added in v2.0.3

func NewGOCFLExtensionManagerFS(fsys fs.FS) (*GOCFLExtensionManager, error)

func (*GOCFLExtensionManager) Add added in v2.0.3

func (manager *GOCFLExtensionManager) Add(ext ocfl.Extension) error

func (*GOCFLExtensionManager) AddFileAfter added in v2.0.3

func (manager *GOCFLExtensionManager) AddFileAfter(object ocfl.Object, sourceFS fs.FS, source []string, internalPath, digest, area string, isDir bool) error

func (*GOCFLExtensionManager) AddFileBefore added in v2.0.3

func (manager *GOCFLExtensionManager) AddFileBefore(object ocfl.Object, sourceFS fs.FS, source string, dest string, area string, isDir bool) error

ContentChange

func (*GOCFLExtensionManager) BuildObjectExtractPath added in v2.0.3

func (manager *GOCFLExtensionManager) BuildObjectExtractPath(object ocfl.Object, originalPath string, area string) (string, error)

func (*GOCFLExtensionManager) BuildObjectManifestPath added in v2.0.3

func (manager *GOCFLExtensionManager) BuildObjectManifestPath(object ocfl.Object, originalPath string, area string) (string, error)

ObjectContentPath

func (*GOCFLExtensionManager) BuildObjectStatePath added in v2.0.3

func (manager *GOCFLExtensionManager) BuildObjectStatePath(object ocfl.Object, originalPath string, area string) (string, error)

ObjectExternalPath

func (*GOCFLExtensionManager) BuildStorageRootPath added in v2.0.3

func (manager *GOCFLExtensionManager) BuildStorageRootPath(storageRoot ocfl.StorageRoot, id string) (string, error)

func (*GOCFLExtensionManager) DeleteFileAfter added in v2.0.3

func (manager *GOCFLExtensionManager) DeleteFileAfter(object ocfl.Object, dest string, area string) error

func (*GOCFLExtensionManager) DeleteFileBefore added in v2.0.3

func (manager *GOCFLExtensionManager) DeleteFileBefore(object ocfl.Object, dest string, area string) error

func (*GOCFLExtensionManager) DoNewVersion added in v2.0.3

func (manager *GOCFLExtensionManager) DoNewVersion(object ocfl.Object) error

func (*GOCFLExtensionManager) Finalize added in v2.0.3

func (manager *GOCFLExtensionManager) Finalize()

func (*GOCFLExtensionManager) GetAreaPath added in v2.0.3

func (manager *GOCFLExtensionManager) GetAreaPath(object ocfl.Object, area string) (string, error)

func (*GOCFLExtensionManager) GetConfig added in v2.0.3

func (manager *GOCFLExtensionManager) GetConfig() any

func (*GOCFLExtensionManager) GetConfigName added in v2.0.3

func (manager *GOCFLExtensionManager) GetConfigName(extName string) (any, error)

func (*GOCFLExtensionManager) GetExtensions added in v2.0.3

func (manager *GOCFLExtensionManager) GetExtensions() []ocfl.Extension

func (*GOCFLExtensionManager) GetFS added in v2.0.3

func (manager *GOCFLExtensionManager) GetFS() fs.FS

func (*GOCFLExtensionManager) GetFSName added in v2.0.3

func (manager *GOCFLExtensionManager) GetFSName(extName string) (fs.FS, error)

func (*GOCFLExtensionManager) GetFixityDigests added in v2.0.3

func (manager *GOCFLExtensionManager) GetFixityDigests() []checksum.DigestAlgorithm

FixityDigests

func (*GOCFLExtensionManager) GetMetadata added in v2.0.3

func (manager *GOCFLExtensionManager) GetMetadata(object ocfl.Object) (map[string]any, error)

func (*GOCFLExtensionManager) GetName added in v2.0.3

func (manager *GOCFLExtensionManager) GetName() string

func (*GOCFLExtensionManager) IsRegistered added in v2.0.3

func (manager *GOCFLExtensionManager) IsRegistered() bool

Extension

func (*GOCFLExtensionManager) NeedNewVersion added in v2.0.3

func (manager *GOCFLExtensionManager) NeedNewVersion(object ocfl.Object) (bool, error)

NewVersion

func (*GOCFLExtensionManager) SetFS added in v2.0.3

func (manager *GOCFLExtensionManager) SetFS(fsys fs.FS)

func (*GOCFLExtensionManager) SetInitial added in v2.0.3

func (manager *GOCFLExtensionManager) SetInitial(initial ocfl.ExtensionInitial)

func (*GOCFLExtensionManager) SetParams added in v2.0.3

func (manager *GOCFLExtensionManager) SetParams(params map[string]string) error

func (*GOCFLExtensionManager) StoreRootLayout added in v2.0.3

func (manager *GOCFLExtensionManager) StoreRootLayout(fsys fs.FS) error

StorageRootPath

func (*GOCFLExtensionManager) StreamObject added in v2.0.3

func (manager *GOCFLExtensionManager) StreamObject(object ocfl.Object, reader io.Reader, stateFiles []string, dest string) error

Stream

func (*GOCFLExtensionManager) UpdateFileAfter added in v2.0.3

func (manager *GOCFLExtensionManager) UpdateFileAfter(object ocfl.Object, sourceFS fs.FS, source, dest, area string, isDir bool) error

func (*GOCFLExtensionManager) UpdateFileBefore added in v2.0.3

func (manager *GOCFLExtensionManager) UpdateFileBefore(object ocfl.Object, sourceFS fs.FS, source, dest, area string, isDir bool) error

func (*GOCFLExtensionManager) UpdateObjectAfter added in v2.0.3

func (manager *GOCFLExtensionManager) UpdateObjectAfter(object ocfl.Object) error

func (*GOCFLExtensionManager) UpdateObjectBefore added in v2.0.3

func (manager *GOCFLExtensionManager) UpdateObjectBefore(object ocfl.Object) error

ObjectChange

func (*GOCFLExtensionManager) WriteConfig added in v2.0.3

func (manager *GOCFLExtensionManager) WriteConfig() error

func (*GOCFLExtensionManager) WriteLayout added in v2.0.3

func (manager *GOCFLExtensionManager) WriteLayout(fsys fs.FS) error

type Indexer

type Indexer struct {
	*IndexerConfig
	// contains filtered or unexported fields
}

func NewIndexer

func NewIndexer(config *IndexerConfig, urlString string, indexerActions *ironmaiden.ActionDispatcher, localCache bool, logger zLogger.ZWrapper) (*Indexer, error)

func NewIndexerFS

func NewIndexerFS(fsys fs.FS, urlString string, indexerActions *ironmaiden.ActionDispatcher, localCache bool, logger zLogger.ZWrapper) (*Indexer, error)

func (*Indexer) GetConfig

func (sl *Indexer) GetConfig() any

func (*Indexer) GetFS

func (sl *Indexer) GetFS() fs.FS

func (*Indexer) GetMetadata

func (sl *Indexer) GetMetadata(object ocfl.Object) (map[string]any, error)

func (*Indexer) GetName

func (sl *Indexer) GetName() string

func (*Indexer) IsRegistered

func (sl *Indexer) IsRegistered() bool

func (*Indexer) SetFS

func (sl *Indexer) SetFS(fsys fs.FS)

func (*Indexer) SetParams

func (sl *Indexer) SetParams(params map[string]string) error

func (*Indexer) StreamObject

func (sl *Indexer) StreamObject(object ocfl.Object, reader io.Reader, stateFiles []string, dest string) error

func (*Indexer) UpdateObjectAfter

func (sl *Indexer) UpdateObjectAfter(object ocfl.Object) error

func (*Indexer) UpdateObjectBefore

func (sl *Indexer) UpdateObjectBefore(object ocfl.Object) error

func (*Indexer) WriteConfig

func (sl *Indexer) WriteConfig() error

type IndexerConfig

type IndexerConfig struct {
	*ocfl.ExtensionConfig
	StorageType string
	StorageName string
	Actions     []string
	Compress    string
}

type Initial added in v2.0.3

type Initial struct {
	*InitialConfig
	// contains filtered or unexported fields
}

func NewInitial added in v2.0.3

func NewInitial(config *InitialConfig) (*Initial, error)

func NewInitialFS added in v2.0.3

func NewInitialFS(fsys fs.FS) (*Initial, error)

func (*Initial) GetConfig added in v2.0.3

func (sl *Initial) GetConfig() any

func (*Initial) GetExtension added in v2.0.3

func (sl *Initial) GetExtension() string

func (*Initial) GetFS added in v2.0.3

func (sl *Initial) GetFS() fs.FS

func (*Initial) GetName added in v2.0.3

func (sl *Initial) GetName() string

func (*Initial) IsRegistered added in v2.0.3

func (sl *Initial) IsRegistered() bool

func (*Initial) SetExtension added in v2.0.3

func (sl *Initial) SetExtension(ext string)

func (*Initial) SetFS added in v2.0.3

func (sl *Initial) SetFS(fsys fs.FS)

func (*Initial) SetParams added in v2.0.3

func (sl *Initial) SetParams(params map[string]string) error

func (*Initial) WriteConfig added in v2.0.3

func (sl *Initial) WriteConfig() error

type InitialConfig added in v2.0.3

type InitialConfig struct {
	*ocfl.ExtensionConfig
	Extension string `json:"extension"`
}

type InitialEntry added in v2.0.3

type InitialEntry struct {
	Path        string `json:"path"`
	Description string `json:"description"`
}

type LoggingIndexer

type LoggingIndexer struct {
	*LoggingIndexerConfig
	// contains filtered or unexported fields
}

func NewLoggingIndexer

func NewLoggingIndexer(config *LoggingIndexerConfig) (*LoggingIndexer, error)

func (*LoggingIndexer) AddFile

func (li *LoggingIndexer) AddFile(fullpath url.URL) error

func (*LoggingIndexer) DeleteFile

func (li *LoggingIndexer) DeleteFile(fullpath url.URL) error

func (*LoggingIndexer) GetConfig

func (sl *LoggingIndexer) GetConfig() any

func (*LoggingIndexer) GetFS

func (sl *LoggingIndexer) GetFS() fs.FS

func (*LoggingIndexer) GetName

func (li *LoggingIndexer) GetName() string

func (*LoggingIndexer) IsRegistered

func (sl *LoggingIndexer) IsRegistered() bool

func (*LoggingIndexer) MoveFile

func (li *LoggingIndexer) MoveFile(fullpath url.URL) error

func (*LoggingIndexer) SetFS

func (li *LoggingIndexer) SetFS(fsys fs.FS)

func (*LoggingIndexer) SetParams

func (li *LoggingIndexer) SetParams(params map[string]string) error

func (*LoggingIndexer) Start

func (li *LoggingIndexer) Start() error

func (*LoggingIndexer) WriteConfig

func (li *LoggingIndexer) WriteConfig() error

func (*LoggingIndexer) WriteLog

func (li *LoggingIndexer) WriteLog(logfile io.Writer) error

type LoggingIndexerConfig

type LoggingIndexerConfig struct {
	*Config
}

type MetaFile

type MetaFile struct {
	*MetaFileConfig
	// contains filtered or unexported fields
}

func NewMetaFile

func NewMetaFile(config *MetaFileConfig, schema []byte) (*MetaFile, error)

func NewMetaFileFS

func NewMetaFileFS(fsys fs.FS) (*MetaFile, error)

func (*MetaFile) GetConfig

func (sl *MetaFile) GetConfig() any

func (*MetaFile) GetFS

func (sl *MetaFile) GetFS() fs.FS

func (*MetaFile) GetMetadata

func (sl *MetaFile) GetMetadata(object ocfl.Object) (map[string]any, error)

func (*MetaFile) GetName

func (sl *MetaFile) GetName() string

func (*MetaFile) IsRegistered

func (sl *MetaFile) IsRegistered() bool

func (*MetaFile) SetFS

func (sl *MetaFile) SetFS(fsys fs.FS)

func (*MetaFile) SetParams

func (sl *MetaFile) SetParams(params map[string]string) error

func (*MetaFile) UpdateObjectAfter

func (sl *MetaFile) UpdateObjectAfter(object ocfl.Object) error

func (*MetaFile) UpdateObjectBefore

func (sl *MetaFile) UpdateObjectBefore(object ocfl.Object) error

func (*MetaFile) WriteConfig

func (sl *MetaFile) WriteConfig() error

type MetaFileConfig

type MetaFileConfig struct {
	*ocfl.ExtensionConfig
	StorageType   string `json:"storageType"`
	StorageName   string `json:"storageName"`
	MetaName      string `json:"name,omitempty"`
	MetaSchema    string `json:"schema,omitempty"`
	MetaSchemaUrl string `json:"schemaUrl,omitempty"`
}

type Mets

type Mets struct {
	*MetsConfig
	// contains filtered or unexported fields
}

func NewMets

func NewMets(config *MetsConfig, logger zLogger.ZWrapper) (*Mets, error)

func NewMetsFS

func NewMetsFS(fsys fs.FS, logger zLogger.ZWrapper) (*Mets, error)

func (*Mets) GetConfig

func (me *Mets) GetConfig() any

func (*Mets) GetFS

func (me *Mets) GetFS() fs.FS

func (*Mets) GetName

func (me *Mets) GetName() string

func (*Mets) IsRegistered

func (me *Mets) IsRegistered() bool

func (*Mets) SetFS

func (me *Mets) SetFS(fsys fs.FS)

func (*Mets) SetParams

func (me *Mets) SetParams(params map[string]string) error

func (*Mets) UpdateObjectAfter

func (me *Mets) UpdateObjectAfter(object ocfl.Object) error

func (*Mets) UpdateObjectBefore

func (me *Mets) UpdateObjectBefore(object ocfl.Object) error

func (*Mets) WriteConfig

func (me *Mets) WriteConfig() error

type MetsConfig

type MetsConfig struct {
	*ocfl.ExtensionConfig
	StorageType                string `json:"storageType"`
	StorageName                string `json:"storageName"`
	PrimaryDescriptiveMetadata string `json:"primaryDescriptiveMetadata,omitempty"`
	MetsFile                   string `json:"metsFile,omitempty"`
	PremisFile                 string `json:"premisFile,omitempty"`
}

type Migration

type Migration struct {
	*MigrationConfig
	// contains filtered or unexported fields
}

func NewMigration

func NewMigration(config *MigrationConfig, mig *migration.Migration) (*Migration, error)

func NewMigrationFS

func NewMigrationFS(fsys fs.FS, migration *migration.Migration, logger zLogger.ZWrapper) (*Migration, error)

func (*Migration) DoNewVersion

func (mi *Migration) DoNewVersion(object ocfl.Object) error

DoNewVersion todo: check for second migration step and do different naming

func (*Migration) GetConfig

func (mi *Migration) GetConfig() any

func (*Migration) GetFS

func (mi *Migration) GetFS() fs.FS

func (*Migration) GetMetadata

func (mi *Migration) GetMetadata(object ocfl.Object) (map[string]any, error)

func (*Migration) GetName

func (mi *Migration) GetName() string

func (*Migration) IsRegistered

func (mi *Migration) IsRegistered() bool

func (*Migration) NeedNewVersion

func (mi *Migration) NeedNewVersion(ocfl.Object) (bool, error)

func (*Migration) SetFS

func (mi *Migration) SetFS(fsys fs.FS)

func (*Migration) SetParams

func (mi *Migration) SetParams(map[string]string) error

func (*Migration) UpdateObjectAfter

func (mi *Migration) UpdateObjectAfter(object ocfl.Object) error

func (*Migration) UpdateObjectBefore

func (mi *Migration) UpdateObjectBefore(ocfl.Object) error

func (*Migration) WriteConfig

func (mi *Migration) WriteConfig() error

type MigrationConfig

type MigrationConfig struct {
	*ocfl.ExtensionConfig
	StorageType string
	StorageName string
	Compress    string
}

type MigrationFiles

type MigrationFiles map[string]*MigrationTarget

map checksum to migration

type MigrationMap

type MigrationMap map[string]*MigrationTarget

map pronom to migration

type MigrationResult

type MigrationResult struct {
	Source string `json:"source"`
	Error  string `json:"error,omitempty"`
	ID     string `json:"id"`
}

type MigrationTarget

type MigrationTarget struct {
	Name            string
	Strategy        string        // add or replace
	FilenameRegexp  regexp.Regexp // target expression
	FilenameReplace string        // replacement string
	Command         string        // command to execute (stdin --> stdout)
}

type NTupleOmitPrefixStorageLayout

type NTupleOmitPrefixStorageLayout struct {
	*NTupleOmitPrefixStorageLayoutConfig
	// contains filtered or unexported fields
}

func NewNTupleOmitPrefixStorageLayoutFS

func NewNTupleOmitPrefixStorageLayoutFS(fsys fs.FS) (*NTupleOmitPrefixStorageLayout, error)

func (*NTupleOmitPrefixStorageLayout) BuildStorageRootPath

func (sl *NTupleOmitPrefixStorageLayout) BuildStorageRootPath(storageRoot ocfl.StorageRoot, id string) (string, error)

func (*NTupleOmitPrefixStorageLayout) GetConfig

func (sl *NTupleOmitPrefixStorageLayout) GetConfig() any

func (*NTupleOmitPrefixStorageLayout) GetFS

func (sl *NTupleOmitPrefixStorageLayout) GetFS() fs.FS

func (*NTupleOmitPrefixStorageLayout) GetName

func (sl *NTupleOmitPrefixStorageLayout) GetName() string

func (*NTupleOmitPrefixStorageLayout) IsRegistered

func (sl *NTupleOmitPrefixStorageLayout) IsRegistered() bool

func (*NTupleOmitPrefixStorageLayout) SetFS

func (sl *NTupleOmitPrefixStorageLayout) SetFS(fsys fs.FS)

func (*NTupleOmitPrefixStorageLayout) SetParams

func (sl *NTupleOmitPrefixStorageLayout) SetParams(params map[string]string) error

func (*NTupleOmitPrefixStorageLayout) Stat

func (sl *NTupleOmitPrefixStorageLayout) Stat(w io.Writer, statInfo []ocfl.StatInfo) error

func (*NTupleOmitPrefixStorageLayout) WriteConfig

func (sl *NTupleOmitPrefixStorageLayout) WriteConfig() error

func (*NTupleOmitPrefixStorageLayout) WriteLayout

func (sl *NTupleOmitPrefixStorageLayout) WriteLayout(fsys fs.FS) error

type NTupleOmitPrefixStorageLayoutConfig

type NTupleOmitPrefixStorageLayoutConfig struct {
	*ocfl.ExtensionConfig
	Delimiter         string `json:"delimiter"`
	TupleSize         int    `json:"tupleSize"`
	NumberOfTuples    int    `json:"numberOfTuples"`
	ZeroPadding       string `json:"zeroPadding"`
	ReverseObjectRoot bool   `json:"reverseObjectRoot"`
}

type PathDirect

type PathDirect struct {
	*PathDirectConfig
}

func NewPathDirect

func NewPathDirect(config *PathDirectConfig) (*PathDirect, error)

func (*PathDirect) BuildObjectManifestPath

func (sl *PathDirect) BuildObjectManifestPath(object ocfl.Object, originalPath string, area string) (string, error)

func (*PathDirect) BuildStorageRootPath

func (sl *PathDirect) BuildStorageRootPath(storageRoot ocfl.StorageRoot, id string) (string, error)

func (*PathDirect) GetConfig

func (sl *PathDirect) GetConfig() any

func (*PathDirect) GetFS

func (sl *PathDirect) GetFS() fs.FS

func (*PathDirect) GetName

func (sl *PathDirect) GetName() string

func (*PathDirect) IsRegistered

func (sl *PathDirect) IsRegistered() bool

func (*PathDirect) SetParams

func (sl *PathDirect) SetParams(params map[string]string) error

func (*PathDirect) WriteConfig

func (sl *PathDirect) WriteConfig() error

func (*PathDirect) WriteLayout

func (sl *PathDirect) WriteLayout(fsys fs.FS) error

type PathDirectConfig

type PathDirectConfig struct {
	*Config
	// contains filtered or unexported fields
}

func (*PathDirectConfig) SetFS

func (sl *PathDirectConfig) SetFS(fsys fs.FS)

type StorageLayoutFlatDirect

type StorageLayoutFlatDirect struct {
	*StorageLayoutFlatDirectConfig
	// contains filtered or unexported fields
}

func NewStorageLayoutFlatDirectFS

func NewStorageLayoutFlatDirectFS(fsys fs.FS) (*StorageLayoutFlatDirect, error)

func (*StorageLayoutFlatDirect) BuildStorageRootPath

func (sl *StorageLayoutFlatDirect) BuildStorageRootPath(storageRoot ocfl.StorageRoot, id string) (string, error)

func (*StorageLayoutFlatDirect) GetConfig

func (sl *StorageLayoutFlatDirect) GetConfig() any

func (*StorageLayoutFlatDirect) GetFS

func (sl *StorageLayoutFlatDirect) GetFS() fs.FS

func (*StorageLayoutFlatDirect) GetName

func (sl *StorageLayoutFlatDirect) GetName() string

func (*StorageLayoutFlatDirect) IsRegistered

func (sl *StorageLayoutFlatDirect) IsRegistered() bool

func (*StorageLayoutFlatDirect) SetFS

func (sl *StorageLayoutFlatDirect) SetFS(fs fs.FS)

func (*StorageLayoutFlatDirect) SetParams

func (sl *StorageLayoutFlatDirect) SetParams(params map[string]string) error

func (*StorageLayoutFlatDirect) Stat

func (sl *StorageLayoutFlatDirect) Stat(w io.Writer, statInfo []ocfl.StatInfo) error

func (*StorageLayoutFlatDirect) WriteConfig

func (sl *StorageLayoutFlatDirect) WriteConfig() error

func (*StorageLayoutFlatDirect) WriteLayout

func (sl *StorageLayoutFlatDirect) WriteLayout(fsys fs.FS) error

type StorageLayoutFlatDirectConfig

type StorageLayoutFlatDirectConfig struct {
	*ocfl.ExtensionConfig
}

type StorageLayoutHashAndIdNTuple

type StorageLayoutHashAndIdNTuple struct {
	*StorageLayoutHashAndIdNTupleConfig
	// contains filtered or unexported fields
}

func NewStorageLayoutHashAndIdNTupleFS

func NewStorageLayoutHashAndIdNTupleFS(fsys fs.FS) (*StorageLayoutHashAndIdNTuple, error)

func (*StorageLayoutHashAndIdNTuple) BuildStorageRootPath

func (sl *StorageLayoutHashAndIdNTuple) BuildStorageRootPath(storageRoot ocfl.StorageRoot, id string) (string, error)

func (*StorageLayoutHashAndIdNTuple) GetConfig

func (sl *StorageLayoutHashAndIdNTuple) GetConfig() any

func (*StorageLayoutHashAndIdNTuple) GetFS

func (sl *StorageLayoutHashAndIdNTuple) GetFS() fs.FS

func (*StorageLayoutHashAndIdNTuple) GetName

func (sl *StorageLayoutHashAndIdNTuple) GetName() string

func (*StorageLayoutHashAndIdNTuple) IsRegistered

func (sl *StorageLayoutHashAndIdNTuple) IsRegistered() bool

func (*StorageLayoutHashAndIdNTuple) SetFS

func (sl *StorageLayoutHashAndIdNTuple) SetFS(fsys fs.FS)

func (*StorageLayoutHashAndIdNTuple) SetParams

func (sl *StorageLayoutHashAndIdNTuple) SetParams(params map[string]string) error

func (*StorageLayoutHashAndIdNTuple) WriteConfig

func (sl *StorageLayoutHashAndIdNTuple) WriteConfig() error

func (*StorageLayoutHashAndIdNTuple) WriteLayout

func (sl *StorageLayoutHashAndIdNTuple) WriteLayout(fsys fs.FS) error

type StorageLayoutHashAndIdNTupleConfig

type StorageLayoutHashAndIdNTupleConfig struct {
	*ocfl.ExtensionConfig
	DigestAlgorithm string `json:"digestAlgorithm"`
	TupleSize       int    `json:"tupleSize"`
	NumberOfTuples  int    `json:"numberOfTuples"`
}

type StorageLayoutHashedNTuple

type StorageLayoutHashedNTuple struct {
	*StorageLayoutHashedNTupleConfig
	// contains filtered or unexported fields
}

func NewStorageLayoutHashedNTupleFS

func NewStorageLayoutHashedNTupleFS(fsys fs.FS) (*StorageLayoutHashedNTuple, error)

func (*StorageLayoutHashedNTuple) BuildStorageRootPath

func (sl *StorageLayoutHashedNTuple) BuildStorageRootPath(storageRoot ocfl.StorageRoot, id string) (string, error)

func (*StorageLayoutHashedNTuple) GetConfig

func (sl *StorageLayoutHashedNTuple) GetConfig() any

func (*StorageLayoutHashedNTuple) GetFS

func (sl *StorageLayoutHashedNTuple) GetFS() fs.FS

func (*StorageLayoutHashedNTuple) GetName

func (sl *StorageLayoutHashedNTuple) GetName() string

func (*StorageLayoutHashedNTuple) IsRegistered

func (sl *StorageLayoutHashedNTuple) IsRegistered() bool

func (*StorageLayoutHashedNTuple) SetFS

func (sl *StorageLayoutHashedNTuple) SetFS(fsys fs.FS)

func (*StorageLayoutHashedNTuple) SetParams

func (sl *StorageLayoutHashedNTuple) SetParams(params map[string]string) error

func (*StorageLayoutHashedNTuple) WriteConfig

func (sl *StorageLayoutHashedNTuple) WriteConfig() error

func (*StorageLayoutHashedNTuple) WriteLayout

func (sl *StorageLayoutHashedNTuple) WriteLayout(fsys fs.FS) error

type StorageLayoutHashedNTupleConfig

type StorageLayoutHashedNTupleConfig struct {
	*ocfl.ExtensionConfig
	DigestAlgorithm string `json:"digestAlgorithm"`
	TupleSize       int    `json:"tupleSize"`
	NumberOfTuples  int    `json:"numberOfTuples"`
	ShortObjectRoot bool   `json:"shortObjectRoot"`
}

type StorageLayoutPairTree

type StorageLayoutPairTree struct {
	*StorageLayoutPairTreeConfig
	// contains filtered or unexported fields
}

func NewStorageLayoutPairTree

func NewStorageLayoutPairTree(config *StorageLayoutPairTreeConfig) (*StorageLayoutPairTree, error)

func NewStorageLayoutPairTreeFS

func NewStorageLayoutPairTreeFS(fsys fs.FS) (*StorageLayoutPairTree, error)

func (*StorageLayoutPairTree) BuildStorageRootPath

func (sl *StorageLayoutPairTree) BuildStorageRootPath(storageRoot ocfl.StorageRoot, id string) (string, error)

func (*StorageLayoutPairTree) GetConfig

func (sl *StorageLayoutPairTree) GetConfig() any

func (*StorageLayoutPairTree) GetFS

func (sl *StorageLayoutPairTree) GetFS() fs.FS

func (*StorageLayoutPairTree) GetName

func (sl *StorageLayoutPairTree) GetName() string

func (*StorageLayoutPairTree) IsObjectExtension

func (sl *StorageLayoutPairTree) IsObjectExtension() bool

func (*StorageLayoutPairTree) IsRegistered

func (sl *StorageLayoutPairTree) IsRegistered() bool

func (*StorageLayoutPairTree) IsStorageRootExtension

func (sl *StorageLayoutPairTree) IsStorageRootExtension() bool

func (*StorageLayoutPairTree) SetFS

func (sl *StorageLayoutPairTree) SetFS(fsys fs.FS)

func (*StorageLayoutPairTree) SetParams

func (sl *StorageLayoutPairTree) SetParams(params map[string]string) error

func (*StorageLayoutPairTree) WriteConfig

func (sl *StorageLayoutPairTree) WriteConfig() error

func (*StorageLayoutPairTree) WriteLayout

func (sl *StorageLayoutPairTree) WriteLayout(fsys fs.FS) error

type StorageLayoutPairTreeConfig

type StorageLayoutPairTreeConfig struct {
	*ocfl.ExtensionConfig
	UriBase         string `json:"uriBase"`
	StoreDir        string `json:"storeDir"`
	ShortyLength    int    `json:"shortyLength"`
	DigestAlgorithm string `json:"digestAlgorithm"`
}

type Thumbnail

type Thumbnail struct {
	*ThumbnailConfig
	// contains filtered or unexported fields
}

func NewThumbnail

func NewThumbnail(config *ThumbnailConfig, mig *thumbnail.Thumbnail, logger zLogger.ZWrapper) (*Thumbnail, error)

func NewThumbnailFS

func NewThumbnailFS(fsys fs.FS, thumbnail *thumbnail.Thumbnail, logger zLogger.ZWrapper) (*Thumbnail, error)

func (*Thumbnail) DoThumbnail

func (thumb *Thumbnail) DoThumbnail(object ocfl.Object, head string, cs string, mig *thumbnail.Function, ext string, file io.ReadCloser) (string, string, error)

func (*Thumbnail) GetConfig

func (thumb *Thumbnail) GetConfig() any

func (*Thumbnail) GetFS

func (thumb *Thumbnail) GetFS() fs.FS

func (*Thumbnail) GetMetadata

func (thumb *Thumbnail) GetMetadata(object ocfl.Object) (map[string]any, error)

func (*Thumbnail) GetName

func (thumb *Thumbnail) GetName() string

func (*Thumbnail) IsRegistered

func (thumb *Thumbnail) IsRegistered() bool

func (*Thumbnail) SetFS

func (thumb *Thumbnail) SetFS(fsys fs.FS)

func (*Thumbnail) SetParams

func (thumb *Thumbnail) SetParams(map[string]string) error

func (*Thumbnail) UpdateObjectAfter

func (thumb *Thumbnail) UpdateObjectAfter(object ocfl.Object) error

func (*Thumbnail) UpdateObjectBefore

func (thumb *Thumbnail) UpdateObjectBefore(ocfl.Object) error

func (*Thumbnail) WriteConfig

func (thumb *Thumbnail) WriteConfig() error

type ThumbnailConfig

type ThumbnailConfig struct {
	*ocfl.ExtensionConfig
	Compress        string `json:"compress"`
	ShortFilename   bool   `json:"shortFilename"`
	Ext             string `json:"ext"`
	Width           uint64 `json:"width"`
	Height          uint64 `json:"height"`
	SingleDirectory bool   `json:"singleDirectory"`
	StorageType     string `json:"storageType"`
	StorageName     string `json:"storageName"`
}

type ThumbnailFiles

type ThumbnailFiles map[string]*ThumbnailTarget

map checksum to thumbnail

type ThumbnailMap

type ThumbnailMap map[string]*ThumbnailTarget

map pronom to thumbnail

type ThumbnailResult

type ThumbnailResult struct {
	Ext          string `json:"ext,omitempty"`
	Error        string `json:"error,omitempty"`
	ID           string `json:"id,omitempty"`
	Filename     string `json:"filename,omitempty"`
	StorageType  string `json:"storageType,omitempty"`
	ThumbDigest  string `json:"thumbDigest,omitempty"`
	SourceDigest string `json:"sourceDigest,omitempty"`
	SourceName   string `json:"sourceName,omitempty"`
}

type ThumbnailTarget

type ThumbnailTarget struct {
	Name           string
	Strategy       string        // add or replace
	FilenameRegexp regexp.Regexp // target expression
	Command        string        // command to execute (stdin --> stdout)
}

Jump to

Keyboard shortcuts

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