Documentation
¶
Overview ¶
This package wraps the TrID command-line tool and parses its output to provide structured information about identified file types.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoFileSpecified is returned when no file path is provided. ErrNoFileSpecified = errors.New("no file specified") // ErrNumberOfMatches is returned when the specified number of matches is less than 1. ErrNumberOfMatches = errors.New("number of matches must be at least 1") // ErrNoDefinitions is returned when no TRiD definitions are available. ErrNoDefinitions = errors.New("no TRiD definitions available") // ErrEmptyDefPackage is returned when a TRiD definition package is empty. ErrEmptyDefPackage = errors.New("TRiD definition package is empty") // ErrFileNotFound is returned when the specified file cannot be located or accessed. ErrFileNotFound = errors.New("file not found") // ErrUnknownFileType is returned when TRiD fails to identify the file type. ErrUnknownFileType = errors.New("unknown file type") )
Functions ¶
This section is empty.
Types ¶
type FileType ¶
type FileType struct { Extension string // File extension (e.g., ".txt", ".pdf"). Probability float64 // Probability of the file type match, as a percentage (0-100). Name string // Descriptive name of the file type. MimeType string // Mime type of the file (e.g., "text/plain", "application/pdf"). RelatedURL string // URL for additional information about the file type. Remarks string // Additional notes or comments about the file type from TRiD. Definition string // Name of the TRiD definition XML file for this file type. }
FileType represents detailed information about a file type as identified by TrID.
type Options ¶
type Options struct { Cmd string // Command to invoke the TrID file identifier. Definitions string // Path to the TrID definitions package. Timeout time.Duration // Maximum duration to wait for TrID execution. }
Options configures the TrID execution parameters.
Click to show internal directories.
Click to hide internal directories.