icopy

package
v0.0.0-...-a68f457 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseBadgerDB

func CloseBadgerDB(db *badger.DB)

func GetBadgerDBValue

func GetBadgerDBValue(db *badger.DB, hashKey string) (string, error)

func IterateWithPrefix

func IterateWithPrefix(db *badger.DB, prefix string) ([]string, error)

func Md5Sum

func Md5Sum(filePath string) (string, error)

Md5Sum returns the MD5 checksum of the file at the given path.

func OpenBadgerDB

func OpenBadgerDB(path string) (*badger.DB, error)

func PutBadgerDB

func PutBadgerDB(db *badger.DB, hashKey string, fileNameValue string) error

func ReadJpegDate

func ReadJpegDate(ctx context.Context, db *badger.DB, src_dirname string, recursive bool) ([]FileObject, []ErroredFileObject)

func ReadVideoCreationTimeMetadata

func ReadVideoCreationTimeMetadata(ctx context.Context, db *badger.DB, src_dirname string, recursive bool) ([]FileObject, []ErroredFileObject)

func ScanAndGenerateMd5sumFiles

func ScanAndGenerateMd5sumFiles(ctx context.Context, db *badger.DB, dirname string, prefix string)

func ScanFiles

func ScanFiles(ctx context.Context, src_dirname string, dst_dirname string)

func SortFilesByDate

func SortFilesByDate(files []FileObject)

Types

type ErroredFileObject

type ErroredFileObject FileObject

type FileObject

type FileObject struct {
	DateTime     time.Time
	Name         string
	Path         string
	Md5Sum       string
	ErrorMessage string
}

func RemoveSourceFile

func RemoveSourceFile(src_dirname string) []FileObject

type FileProcessor

type FileProcessor struct {
	Overwrite string
	ForceCopy bool
	Recursive bool
	DateFmt   string
}

func (*FileProcessor) CopyImageFiles

func (fp *FileProcessor) CopyImageFiles(ctx context.Context, srcdir string, destdir string) ([]FileObject, []ErroredFileObject, []FileObject)

func (*FileProcessor) CopyVideoFiles

func (fp *FileProcessor) CopyVideoFiles(ctx context.Context, srcdir string, destdir string) ([]FileObject, []ErroredFileObject, []FileObject)

type MatchObject

type MatchObject struct {
	SrcFileName string `json:"src_file_name"`
	DstFileName string `json:"dst_file_name"`
}

func ValidateMd5sumFiles

func ValidateMd5sumFiles(ctx context.Context, src_prefix string, dst_prefix string) []MatchObject

Jump to

Keyboard shortcuts

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