Documentation ¶
Overview ¶
Package rename deals with renaming files and list images in directories
Index ¶
Constants ¶
const ( DefaultCopyNumber = 2 StatusFail = "fail" StatusOk = "ok" FileExistsError = "File exists already" )
Constant values
Variables ¶
This section is empty.
Functions ¶
func CheckFileExists ¶
CheckFileExists checks if a file is in a given dir.
func ListImagesInDir ¶
func ListImagesInDir(rootPath string, extensions []string, excludedDirs []string, safeRename bool, safeStrings []string) (list []string, err error)
ListImagesInDir search through a directory for files with extensions that match. If a directory is excluded it will skip this directory.
Types ¶
type FileInformation ¶
type FileInformation struct { Path string SourceName string TargetName string FileName string NewFileName string FileExtension string CopyNumber int Status string }
FileInformation is a struct for file informations like target name and source name.
func GetFileInformation ¶
func GetFileInformation(sourceNames []string, templateString string, separator string, debug bool) (files []FileInformation, tableData [][]string, err error)
GetFileInformation returns file informations from source names.
func (*FileInformation) BuildFileInformation ¶
func (f *FileInformation) BuildFileInformation(sourceName string)
BuildFileInformation takes an source name as string. It assign values into the FileAttributes struct.
func (*FileInformation) GetNewFileName ¶
func (f *FileInformation) GetNewFileName(templateString string, imageExif *exif.Exif) error
GetNewFileName assign the new filename into a FileAttributes struct.
func (*FileInformation) GetTargetName ¶
func (f *FileInformation) GetTargetName(targetNames []string, separator string) error
GetTargetName assign the target name into a FileAttributes struct.
type FileNameTemplate ¶
FileNameTemplate is a struct for the template.