tools

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: MIT Imports: 37 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertImageFile

func ConvertImageFile(src, dst, format string, quality int) error

func DNSLookup

func DNSLookup(host string) ([]string, error)

func EncodeToken

func EncodeToken(bytes int) (string, error)

func ExpandTemplate

func ExpandTemplate(tpl string, info fs.FileInfo, seq int) string

func FFmpegStatus

func FFmpegStatus() map[string]any

func FileChecksum

func FileChecksum(path string, h Hooks) (map[string]any, error)

func GenerateSecret

func GenerateSecret(length int, alphabet string) (string, error)

func HTTPProbe

func HTTPProbe(target string, timeout time.Duration) map[string]any

func ImageInfo

func ImageInfo(path string, h Hooks) (map[string]any, error)

func MediaInfo

func MediaInfo(path string, h Hooks) (map[string]any, error)

func MediaInfoWithFFprobe

func MediaInfoWithFFprobe(path string, h Hooks, useFFprobe bool) (map[string]any, error)

func OfficeRead

func OfficeRead(path string, h Hooks) (map[string]any, error)

func OfficeText

func OfficeText(path string, h Hooks) (string, error)

func SortOperations

func SortOperations(ops []Operation)

func SystemInfo

func SystemInfo() map[string]any

func TCPCheck

func TCPCheck(address string, timeout time.Duration) map[string]any

Types

type FileInfo

type FileInfo struct {
	Path    string `json:"path"`
	Name    string `json:"name"`
	Size    int64  `json:"size"`
	Mode    string `json:"mode"`
	ModTime int64  `json:"mod_time"`
	IsDir   bool   `json:"is_dir"`
	MIME    string `json:"mime,omitempty"`
}

func ArchiveList

func ArchiveList(path string, h Hooks) ([]FileInfo, error)
func Search(root string, opts map[string]any, h Hooks) ([]FileInfo, error)

type Hooks

type Hooks struct {
	Sanitize   func(string) (string, error)
	CheckRead  func(string) error
	CheckWrite func(string) error
}

type Operation

type Operation struct {
	Status     string `json:"status"`
	Op         string `json:"op"`
	Src        string `json:"src,omitempty"`
	Dst        string `json:"dst,omitempty"`
	Reason     string `json:"reason,omitempty"`
	Error      string `json:"error,omitempty"`
	SizeBefore int64  `json:"size_before,omitempty"`
	SizeAfter  int64  `json:"size_after,omitempty"`
}

func BulkRename

func BulkRename(dir string, opts map[string]any, h Hooks) ([]Operation, error)

func Compress

func Compress(src, dst string, opts map[string]any, h Hooks) Operation

func CopyOrMove

func CopyOrMove(src, dst string, move, apply bool, h Hooks) Operation

func CropImage

func CropImage(src, dst string, opts map[string]any, h Hooks) Operation

func DecryptFile

func DecryptFile(src, dst, passphrase string, apply bool, h Hooks) Operation

func Dedupe

func Dedupe(root string, opts map[string]any, h Hooks) ([]Operation, error)

func EncryptFile

func EncryptFile(src, dst, passphrase string, apply bool, h Hooks) Operation

func Extract

func Extract(src, dst string, opts map[string]any, h Hooks) Operation

func ImageConvertBatch

func ImageConvertBatch(srcDir, dstDir string, opts map[string]any, h Hooks) ([]Operation, error)

func InstallFFmpeg

func InstallFFmpeg(apply bool) Operation

func MediaConvert

func MediaConvert(src, dst string, opts map[string]any, h Hooks) Operation

func OrganizeByExt

func OrganizeByExt(root, dstRoot string, opts map[string]any, h Hooks) ([]Operation, error)

func RemovePath

func RemovePath(path string, opts map[string]any, h Hooks) Operation

func ResizeImage

func ResizeImage(src, dst string, opts map[string]any, h Hooks) Operation

func Thumbnail

func Thumbnail(src, dst string, opts map[string]any, h Hooks) Operation

Jump to

Keyboard shortcuts

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