ext_initial

package
v3.0.9 Latest Latest
Warning

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

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

README

Initial Extension

This package implements the OCFL initial extension.

Overview

The initial extension allows indication that the semantics of a particular extension takes precedence over all other extensions. It ensures that the special extension name initial is a registered extension name.

For more details on the specification, see initial.md.

Usage

This extension is typically used to define which extension manager or functional extension should be applied first.

import "github.com/ocfl-archive/gocfl/v3/pkg/extensions/ext_initial"

Documentation

Overview

Package ext_initial implements the OCFL "initial" extension. This extension allows indication that the semantics of a particular extension takes precedence over all other extensions.

Index

Constants

View Source
const InitialDescription = "initial extension defines the name of the extension manager"

InitialDescription is a short description of the extension's purpose.

View Source
const InitialName = "initial"

InitialName is the unique name of the extension.

Variables

View Source
var InitialDoc string

InitialDoc contains the documentation for the extension.

Functions

func GetInitialParams

func GetInitialParams() ([]*extension.ExternalParam, error)

GetInitialParams returns the external parameters supported by this extension.

func NewInitial

func NewInitial() (extension.Extension, error)

NewInitial creates a new instance of the Initial extension with default configuration.

Types

type Initial

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

Initial represents the initial extension instance.

func (*Initial) GetConfig

func (sl *Initial) GetConfig() any

GetConfig returns the extension's configuration.

func (*Initial) GetExtension

func (sl *Initial) GetExtension() string

GetExtension returns the functional extension name.

func (*Initial) GetName

func (sl *Initial) GetName() string

GetName returns the name of the extension.

func (*Initial) IsRegistered

func (sl *Initial) IsRegistered() bool

IsRegistered returns true if the extension is registered.

func (*Initial) Load

func (sl *Initial) Load(data json.RawMessage, _ fs.FS) error

Load unmarshals the configuration data and initializes the extension.

func (*Initial) SetExtension

func (sl *Initial) SetExtension(ext string)

SetExtension sets the functional extension name.

func (*Initial) SetParams

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

SetParams sets external parameters for the extension.

func (*Initial) Terminate

func (sl *Initial) Terminate() error

Terminate cleans up any resources used by the extension.

func (*Initial) WithLogger

func (sl *Initial) WithLogger(logger ocfllogger.OCFLLogger) extension.Extension

WithLogger sets the logger for the extension and returns the extension itself.

func (*Initial) WriteConfig

func (sl *Initial) WriteConfig(fsys appendfs.FS) error

WriteConfig writes the extension's configuration to the storage root.

type InitialConfig

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

InitialConfig holds the configuration for the initial extension.

Jump to

Keyboard shortcuts

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