visitors

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewIsDuplicateMedia

func NewIsDuplicateMedia(ctx context.Context, srcMedia mediatype.Format) (mediatype.VisitorFunc[bool], error)

NewIsDuplicateMedia is a mediatype visitor that will determine whether 2 media formats are the same

func NewMediaExtAliases

func NewMediaExtAliases(ctx context.Context) mediatype.VisitorFunc[map[string]struct{}]

NewMediaExtAliases is a mediatype visitor that will get all known media extension aliases

func NewMediaMetadataFilename

func NewMediaMetadataFilename(
	_ context.Context,
	outDir *string,
	useLastModifiedDate,
	timestampAsFilename,
	useOutputMagicSignature bool,
) mediatype.VisitorFunc[MediaMetadata]

NewMediaMetadataFilename is a mediatype visitor that will generate metadata info on a provided media file - useLastModifiedDate: Fallback to using the last modified date if no EXIF data exists on the media - timestampAsFilename: Use the Unix EPOCH time as the output file name. - useOutputMagicSignature: Use the identified mediatype Ext as the extension of the output filename TODO(dtrejo): Rename useLastModifiedDate to fallbackToLastModifiedDate to better describe what this variable actually does.

func NewMediaPath

func NewMediaPath(ctx context.Context) mediatype.VisitorFunc[string]

NewMediaPath is a mediatype visitor that will get the path from a media format

Types

type MediaMetadata

type MediaMetadata struct {
	// OutPath is an appropriate new output filename for the provided mediatype format.
	OutPath   string
	Timestamp time.Time
}

MediaMetadata is the return type from the MediaMetadataFilename visitor

Jump to

Keyboard shortcuts

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