Documentation ¶
Index ¶
- Constants
- func FileAppend(path, str string)
- func FileCalcChecksum(path string) string
- func FileCopy(src, dest string, keepAttributes bool) error
- func FileFixDates(path string, creationDate time.Time, modificationDate time.Time) error
- func FileMove(src, dest string) error
- func FormatDateWithTimezone(date time.Time, timezone string) string
- func GetJsonMapValue(dataMap RawJsonMap, key string) string
- func HandleError(e error)
- func IsDir(dir string) bool
- func IsError(e error) bool
- func JsonEncodePretty(v interface{}) ([]byte, error)
- func MakeDirIfNotExists(dir string)
- func ParseDateWithTimezone(layout string, value string, timezone string) (time.Time, error)
- func PathExists(dir string) bool
- func PrintLn(template string, args ...interface{})
- func PrintReplaceLn(template string, args ...interface{})
- func ToString(val interface{}) string
- func TotalBytesToString(b int64, useDecimalSystem bool) string
- type CmdFileStats
- type CmdOptions
- type ExifData
- type ExifToolData
- type FileMeta
- type FilePathInfo
- type GPSCoord
- type GPSData
- type RawJsonMap
- type TidyUpWalkFunc
Constants ¶
View Source
const ( AppName = "go-media-organizer" IsUnix = runtime.GOOS == "linux" || runtime.GOOS == "darwin" || runtime.GOOS == "freebsd" || runtime.GOOS == "openbsd" MinFileSize = 1000 // 1000 B / 1 KB DirPerms = 0755 FilePerms = 0644 DirMetadata = ".metadata" DirVideos = "originals" DirImages = "originals" DirVideosConverted = "converted" MediaTypeVideo = "video" MediaTypeImage = "image" DateFormat = time.RFC3339 DateTimestampFormat = "2006:01:02 15:04:05" DefaultTimezone = "Europe/Berlin" DefaultCameraModelFallback = "Unknown" RegexImage = "(?i)\\.(jpg|jpeg|gif|png|webp|tiff|tif|bmp|raw|svg|psd|ai)$" RegexVideo = "(?i)\\.(mpg|wmv|avi|mov|m4v|3gp|mp4|flv|webm|ogv|ts|divx|mkv|mpeg)$" RegexVideoOld = "(?i)\\.(mpg|wmv|avi|mov|m4v|3gp|flv|divx|mpeg)$" RegexExcludeDirs = "(?i)(\\.([a-z_0-9-]+)|/bower_components|/node_modules|/vendor|/Developer)/.*$" RegexScreenShot = "(?i)(Screen Shot|Screen Record|Screenshot|Captur)" )
Variables ¶
This section is empty.
Functions ¶
func FileAppend ¶
func FileAppend(path, str string)
func FileCalcChecksum ¶
func FileFixDates ¶
func GetJsonMapValue ¶
func GetJsonMapValue(dataMap RawJsonMap, key string) string
func HandleError ¶
func HandleError(e error)
func JsonEncodePretty ¶
func MakeDirIfNotExists ¶
func MakeDirIfNotExists(dir string)
func ParseDateWithTimezone ¶
func PathExists ¶
func PrintReplaceLn ¶
func PrintReplaceLn(template string, args ...interface{})
func TotalBytesToString ¶
Types ¶
type CmdFileStats ¶
type CmdFileStats struct { ProcessedFiles int SkippedFiles int DuplicatedFiles int TotalSize int64 }
func TidyUp ¶
func TidyUp(params CmdOptions) (CmdFileStats, error)
type CmdOptions ¶
type ExifData ¶
type ExifData struct { Data ExifToolData DataDump RawJsonMap DataDumpRaw string }
type ExifToolData ¶
type ExifToolData struct { // File info: SourceFile string Directory string FileName string FileSize string FileModifyDate string FileAccessDate string FileType string FileTypeExtension string FilePermissions string MIMEType string // Exif / XMP info: Make string Model string Software string CreatorTool string CreateDate string ModifyDate string DateTimeOriginal string DateTimeDigitized string ImageWidth string ImageHeight string ImageSize string GPSAltitude string GPSLatitude string GPSLongitude string GPSLatitudeRef string GPSLongitudeRef string GPSPosition string GPSDateTime string }
type FileMeta ¶
type FileMeta struct { Source FilePathInfo Destination FilePathInfo MetadataPath FilePathInfo Size int64 Checksum string CreationTime string ModificationTime string MediaType string CameraModel string CreationTool string IsScreenShot bool IsDuplication bool IsAlreadyImported bool IsLegacyVideo bool Exif ExifData GPS GPSData }
func GetFileMetadata ¶
type FilePathInfo ¶
type GPSData ¶
func GPSDataParse ¶
type RawJsonMap ¶
type RawJsonMap map[string]interface{}
type TidyUpWalkFunc ¶
Click to show internal directories.
Click to hide internal directories.