bundler

package
v0.30.2 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bundler

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

Bundler helps create Archivematica transfers in the filesystem.

It is a simpler alternative to amclient.TransferSession that does not concern with the submission of the transfer.

func NewBundler

func NewBundler(fs afero.Fs) (*Bundler, error)

NewBundler returns a new Bundler.

func NewBundlerWithTempDir

func NewBundlerWithTempDir(path string) (*Bundler, error)

NewBundlerWithTempDir returns a bundler based on a temporary directory created under the path given.

func (*Bundler) Bundle

func (b *Bundler) Bundle() error

func (*Bundler) ChecksumMD5

func (b *Bundler) ChecksumMD5(name, sum string)

ChecksumMD5 registers a MD5 checksum for a file.

func (*Bundler) ChecksumSHA1

func (b *Bundler) ChecksumSHA1(name, sum string)

ChecksumSHA1 registers a SHA1 checksum for a file.

func (*Bundler) ChecksumSHA256

func (b *Bundler) ChecksumSHA256(name, sum string)

ChecksumSHA256 registers a SHA256 checksum for a file.

func (*Bundler) Create

func (b *Bundler) Create(name string) (afero.File, error)

Create a file and return it.

func (*Bundler) Describe

func (b *Bundler) Describe(field, value string)

Describe registers metadata of the whole dataset/transfer. It causes the transfer to include a `metadata.json` file with the metadata included.

func (*Bundler) DescribeFile

func (b *Bundler) DescribeFile(name, field, value string)

DescribeFile registers metadata of a file. It causes the transfer to include a `metadata.json` file with the metadata of each file described.

func (*Bundler) Destroy

func (b *Bundler) Destroy() error

func (*Bundler) FullBaseFsPath

func (b *Bundler) FullBaseFsPath() string

func (*Bundler) Write

func (b *Bundler) Write(name string, r io.Reader) error

Write a file with the contents in a given io.Reader.

type ChecksumSet

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

ChecksumSet holds the checksums of the files for a sum algorithm.

func NewChecksumSet

func NewChecksumSet(sumType string, fs afero.Fs) *ChecksumSet

func (*ChecksumSet) Add

func (c *ChecksumSet) Add(name, sum string)

func (*ChecksumSet) Write

func (c *ChecksumSet) Write() error

type MetadataSet

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

MetadataSet holds the metadata entries of the transfer.

func NewMetadataSet

func NewMetadataSet(fs afero.Fs) *MetadataSet

NewMetadataSet returns a new MetadataSet.

func (*MetadataSet) Add

func (m *MetadataSet) Add(name, field, value string)

func (*MetadataSet) Entries

func (m *MetadataSet) Entries() map[string][][2]string

Entries returns all entries that were created.

func (*MetadataSet) Write

func (m *MetadataSet) Write() error

Jump to

Keyboard shortcuts

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