defaults

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultHashAlgorithm = "md5"

DefaultHashAlgorithm is the default hash algorithm used for file hashing.

Variables

View Source
var IgnoredFiles = []string{
	".DS_Store",
	"Thumbs.db",
	"desktop.ini",
	"Icon\r",
	".Spotlight-V100",
	".Trashes",
	"ehthumbs.db",
	"Desktop.ini",
}

IgnoredFiles is the list of OS-generated junk files to ignore.

View Source
var MakeNormalization = map[string]string{}

MakeNormalization maps raw camera make strings to normalized values.

View Source
var ModelNormalization = map[string]string{}

ModelNormalization maps raw camera model strings to normalized values.

View Source
var SidecarExtensions = []string{".xmp", ".yaml", ".json"}

SidecarExtensions is the list of recognized sidecar file extensions.

Functions

func IsIgnoredFile

func IsIgnoredFile(name string) bool

IsIgnoredFile returns true if the given filename is a known OS-generated junk file.

func IsSidecarExtension

func IsSidecarExtension(ext string) bool

IsSidecarExtension returns true if the given extension is a recognized sidecar extension. The check is case-insensitive.

func NormalizeMake

func NormalizeMake(make string) string

NormalizeMake returns the normalized camera make, or the original value if not in the map.

func NormalizeModel

func NormalizeModel(model string) string

NormalizeModel returns the normalized camera model, or the original value if not in the map.

Types

type Hasher

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

Hasher wraps a hash algorithm with convenience methods.

func NewHasher

func NewHasher(algo string) (*Hasher, error)

NewHasher creates a new Hasher for the given algorithm. Supported algorithms: "md5", "sha256".

func (*Hasher) Algo

func (h *Hasher) Algo() string

Algo returns the algorithm name.

func (*Hasher) New

func (h *Hasher) New() hash.Hash

New returns a new hash.Hash instance for this algorithm.

func (*Hasher) ShortLen

func (h *Hasher) ShortLen() int

ShortLen returns the length of a short hash prefix (always 8).

type MediaType

type MediaType string

MediaType represents the type of media file.

const (
	MediaTypePhoto MediaType = "image"
	MediaTypeVideo MediaType = "video"
	MediaTypeAudio MediaType = "audio"
	MediaTypeOther MediaType = "other"
)

func MediaTypeFromMIME

func MediaTypeFromMIME(mime string) MediaType

MediaTypeFromMIME classifies a MIME type string into a MediaType.

Jump to

Keyboard shortcuts

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