dmgextract

package
v15.11.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Extractor

type Extractor interface {
	List() (*ExtractorResult, error)
	ExtractTo(dest string) (*ExtractorResult, error)
}

An Extractor can list the contents of a DMG and extract it to a folder

func New

func New(dmgpath string, o ...ExtractorOpt) Extractor

New creates a new extractor with the specified options. It doesn't do anything until one of its methods are called.

type ExtractorOpt

type ExtractorOpt func(opts *extractorOpts)

An ExtractorOpt changes the behavior of a dmg extractor.

var ExtractSLA ExtractorOpt = func(opts *extractorOpts) {
	opts.extractSLA = true
}

ExtractSLA instructs the dmg extractor to parse any service level agreement stored in the DMG file.

func WithConsumer

func WithConsumer(consumer *state.Consumer) ExtractorOpt

WithConsumer hooks up logging and progress to a custom consumer. Otherwise, a silent consumer will be used.

func WithMountFolder

func WithMountFolder(mountFolder string) ExtractorOpt

WithMountFolder specifies a mount folder for the disk image. If none is specified, a temporary path will be generated.

func WithProgressTotalBytes

func WithProgressTotalBytes(startProgressWithTotalBytes func(totalBytes int64), endProgress func()) ExtractorOpt

type ExtractorResult

type ExtractorResult struct {
	Container *tlc.Container
	SLA       *damage.SLA
}

ExtractorResult contains information aobut

Jump to

Keyboard shortcuts

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