Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Algorithm ¶ added in v0.4.0
type Algorithm interface { digest.Algorithm // Extension returns the AlgorithRegistry extension that provides the // algorithm. Extension() AlgorithmRegistry }
Algorithm is a digest.Algorithm provided by an extension
type AlgorithmRegistry ¶ added in v0.4.0
type AlgorithmRegistry interface { Extension Algorithms() digest.AlgorithmRegistry }
AlgorithmRegistry is an extension that provides a registry of digest algorithms
type Base ¶ added in v0.4.0
type Base struct {
ExtensionName string `json:"extensionName"`
}
Base is a type that can be embedded by types that implement the Extension.
type Extension ¶
type Extension interface { Name() string // Name returns the extension name Doc() string // Extension documentation in markdown format (if available) }
Extension is implemented by types that represent specific OCFL Extensions. See https://github.com/OCFL/extensions
func Ext0002 ¶
func Ext0002() Extension
Ext0002 returns new instance of 0002-flat-direct-storage-layout with default values
func Ext0003 ¶
func Ext0003() Extension
Ext0003 returns a new instance of 0003-hash-and-id-n-tuple-storage-layout with default values
func Ext0004 ¶
func Ext0004() Extension
Ext0004 returns a new instance of 0004-hashed-n-tuple-storage-layout
func Ext0006 ¶
func Ext0006() Extension
Ext0006 returns a new instance of 0006-flat-omit-prefix-storage-layout with default values
type Layout ¶
type Layout interface { Extension // Resolve resolves an object ID into a storage root path Resolve(id string) (path string, err error) // Valid returns an error if the layout configuation is invalid Valid() error }
Layout is an extension that provides a function for resolving object IDs to Storage Root Paths
type LayoutFlatDirect ¶
type LayoutFlatDirect struct {
Base
}
LayoutFlatDirect implements 0002-flat-direct-storage-layout
func (LayoutFlatDirect) Valid ¶ added in v0.2.0
func (l LayoutFlatDirect) Valid() error
type LayoutFlatOmitPrefix ¶
LayoutFlatOmitPrefix implements 0006-flat-omit-prefix-storage-layout
func (LayoutFlatOmitPrefix) Resolve ¶
func (l LayoutFlatOmitPrefix) Resolve(id string) (string, error)
func (LayoutFlatOmitPrefix) Valid ¶ added in v0.2.0
func (l LayoutFlatOmitPrefix) Valid() error
type LayoutHashIDTuple ¶
type LayoutHashIDTuple struct { Base DigestAlgorithm string `json:"digestAlgorithm"` TupleSize int `json:"tupleSize"` TupleNum int `json:"numberOfTuples"` }
LayoutHashIDTuple implements 0003-hash-and-id-n-tuple-storage-layout
func (LayoutHashIDTuple) Valid ¶ added in v0.2.0
func (l LayoutHashIDTuple) Valid() error
type LayoutHashTuple ¶
type LayoutHashTuple struct { Base DigestAlgorithm string `json:"digestAlgorithm"` TupleSize int `json:"tupleSize"` TupleNum int `json:"numberOfTuples"` Short bool `json:"shortObjectRoot"` }
LayoutHashTuple implements 0004-hashed-n-tuple-storage-layout
func (LayoutHashTuple) Valid ¶ added in v0.2.0
func (l LayoutHashTuple) Valid() error
type LayoutTupleOmitPrefix ¶
type LayoutTupleOmitPrefix struct { Base Delimiter string `json:"delimiter"` TupleSize int `json:"tupleSize"` TupleNum int `json:"numberOfTuples"` Padding string `json:"zeroPadding"` Reverse bool `json:"reverseObjectRoot"` }
LayoutTupleOmitPrefix implements 0007-n-tuple-omit-prefix-storage-layout
func (LayoutTupleOmitPrefix) MarshalJSON ¶
func (l LayoutTupleOmitPrefix) MarshalJSON() ([]byte, error)
func (LayoutTupleOmitPrefix) Resolve ¶
func (l LayoutTupleOmitPrefix) Resolve(id string) (string, error)
func (LayoutTupleOmitPrefix) Valid ¶ added in v0.2.0
func (l LayoutTupleOmitPrefix) Valid() error
type Registry ¶ added in v0.4.0
type Registry struct {
// contains filtered or unexported fields
}
Registry is an immutable container of Extension constructors.
func DefaultRegistry ¶ added in v0.4.0
func DefaultRegistry() Registry
DefaultRegistry returns a new Registry with default Extension constructors.
func NewRegistry ¶ added in v0.4.0
NewRegistry returns a Registry for the given extension constructors
func (Registry) Append ¶ added in v0.4.0
Append returns a new Registry that includes extension constructors from r plus additional constructors. If the added extension constructors have the same name as those in r, the new registry will use the added constructor.
func (Registry) New ¶ added in v0.4.0
New returns a new Extension value for the given extension name or returns an error if the extension is not present in the registry. The returned Extension should have default values (or zero-values where defaults are not defined).