Documentation
¶
Index ¶
- func ArchiveEntryNamesFromSummary(raw json.RawMessage) []string
- func ArchiveFamilyFiles(candidateFile string, files []pgindex.CatalogReleaseFile) []pgindex.CatalogReleaseFile
- func ArchiveFamilyKey(fileName string) string
- func ArchiveProbePath(fileName string) string
- func BestMediaEntry(entries []string) string
- func DetectMIMEType(data []byte, fileName string) string
- func DetectSignature(data []byte, fileName string) string
- func ExtractPasswordCandidates(values ...string) []string
- func ExtractTextTokens(text string) []string
- func InferEncrypted(candidate pgindex.BinaryInspectionCandidate) bool
- func IsArchiveFile(fileName string) bool
- func IsArchiveRepresentative(fileName string) bool
- func IsAudioFile(fileName string) bool
- func IsVideoFile(fileName string) bool
- func MarshalArchiveEntries(entries []string) json.RawMessage
- func ParseInt64(value string) int64
- func ParseSeconds(value string) float64
- func ToolProvenance(opts Options, stageName string) map[string]any
- type ArchiveEntryInfo
- type ArchiveMediaMaterialization
- type ArchiveProbeResult
- type ArticleFetcher
- type BinaryPrefixSample
- type CatalogReader
- type CommandRunner
- type ExecCommandRunner
- type FFProbeFormat
- type FFProbeResult
- type FFProbeStream
- type MaterializedBinary
- type Options
- type Runner
- type Service
- type Workspace
- type WorkspaceManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArchiveEntryNamesFromSummary ¶
func ArchiveEntryNamesFromSummary(raw json.RawMessage) []string
func ArchiveFamilyFiles ¶
func ArchiveFamilyFiles(candidateFile string, files []pgindex.CatalogReleaseFile) []pgindex.CatalogReleaseFile
func ArchiveFamilyKey ¶
func ArchiveProbePath ¶
func BestMediaEntry ¶
func DetectMIMEType ¶
func DetectSignature ¶
func ExtractTextTokens ¶
func InferEncrypted ¶
func InferEncrypted(candidate pgindex.BinaryInspectionCandidate) bool
func IsArchiveFile ¶
func IsArchiveRepresentative ¶
func IsAudioFile ¶
func IsVideoFile ¶
func MarshalArchiveEntries ¶
func MarshalArchiveEntries(entries []string) json.RawMessage
func ParseInt64 ¶
func ParseSeconds ¶
Types ¶
type ArchiveEntryInfo ¶
type ArchiveMediaMaterialization ¶
type ArchiveMediaMaterialization struct {
ArchivePath string
OutputPath string
ArchiveBytes int64
ExtractedBytes int64
Signature string
MIMEType string
ExtractStderr string
PartialExtraction bool
}
func MaterializeArchiveMediaToWorkspace ¶
func MaterializeArchiveMediaToWorkspace(ctx context.Context, repo CatalogReader, fetcher ArticleFetcher, candidate pgindex.BinaryInspectionCandidate, entryName string, workspaceDir string, opts Options, log logger) (*ArchiveMediaMaterialization, error)
type ArchiveProbeResult ¶
type ArchiveProbeResult struct {
Strategy string
ProbePath string
MaterializedBytes int64
Entries []ArchiveEntryInfo
EntryNames []string
Encrypted bool
ProbeError string
FamilyFileNames []string
}
func PrepareArchiveProbe ¶
func PrepareArchiveProbe(ctx context.Context, workspace *Workspace, repo CatalogReader, fetcher ArticleFetcher, runner CommandRunner, log logger, opts Options, candidate pgindex.BinaryInspectionCandidate) (*ArchiveProbeResult, error)
type ArticleFetcher ¶
type BinaryPrefixSample ¶
type BinaryPrefixSample struct {
File pgindex.CatalogReleaseFile
Groups []string
Prefix []byte
Signature string
MIMEType string
BytesRead int64
ExactSize int64
OutputName string
}
func SampleBinaryPrefix ¶
func SampleBinaryPrefix(ctx context.Context, repo CatalogReader, fetcher ArticleFetcher, candidate pgindex.BinaryInspectionCandidate, maxBytes int64) (*BinaryPrefixSample, error)
type CatalogReader ¶
type CatalogReader interface {
ListCatalogReleaseFiles(ctx context.Context, releaseID string) ([]pgindex.CatalogReleaseFile, error)
ListCatalogReleaseFileArticles(ctx context.Context, releaseFileID int64) ([]pgindex.CatalogArticleRef, error)
ListCatalogReleaseNewsgroups(ctx context.Context, releaseID string) ([]string, error)
}
type CommandRunner ¶
type ExecCommandRunner ¶
type ExecCommandRunner struct{}
type FFProbeFormat ¶
type FFProbeFormat struct {
Filename string `json:"filename"`
FormatName string `json:"format_name"`
FormatLongName string `json:"format_long_name"`
Duration string `json:"duration"`
BitRate string `json:"bit_rate"`
Size string `json:"size"`
ProbeScore int `json:"probe_score"`
Tags map[string]string `json:"tags"`
}
type FFProbeResult ¶
type FFProbeResult struct {
Format FFProbeFormat `json:"format"`
Streams []FFProbeStream `json:"streams"`
}
func RunFFProbe ¶
func RunFFProbe(ctx context.Context, runner CommandRunner, ffprobePath, targetPath string) (*FFProbeResult, []byte, error)
type FFProbeStream ¶
type FFProbeStream struct {
Index int `json:"index"`
CodecType string `json:"codec_type"`
CodecName string `json:"codec_name"`
CodecLong string `json:"codec_long_name"`
CodecTagString string `json:"codec_tag_string"`
CodecTag string `json:"codec_tag"`
Profile string `json:"profile"`
Width int `json:"width"`
Height int `json:"height"`
Channels int `json:"channels"`
SampleRate string `json:"sample_rate"`
ChannelLayout string `json:"channel_layout"`
SampleFormat string `json:"sample_fmt"`
BitsPerSample int `json:"bits_per_sample"`
PixFmt string `json:"pix_fmt"`
DisplayAspectRatio string `json:"display_aspect_ratio"`
RFrameRate string `json:"r_frame_rate"`
AvgFrameRate string `json:"avg_frame_rate"`
Duration string `json:"duration"`
BitRate string `json:"bit_rate"`
Tags map[string]string `json:"tags"`
Disposition struct {
Default int `json:"default"`
Forced int `json:"forced"`
} `json:"disposition"`
}
type MaterializedBinary ¶
type MaterializedBinary struct {
File pgindex.CatalogReleaseFile
Groups []string
Header *nzb.YencHeader
OutputPath string
BytesWritten int64
ExactSize int64
Signature string
MIMEType string
}
func MaterializeBinaryToWorkspace ¶
func MaterializeBinaryToWorkspace(ctx context.Context, repo CatalogReader, fetcher ArticleFetcher, candidate pgindex.BinaryInspectionCandidate, outputPath string, maxBytes int64) (*MaterializedBinary, error)
type Options ¶
type Options struct {
WorkDir string
MaxBytes int64
MaxArchiveDepth int
ToolTimeout time.Duration
FFProbePath string
SevenZipPath string
UnrarPath string
PAR2Path string
CandidateBatchSize int
Concurrency int
ClaimOwner string
ClaimLease time.Duration
}
func DefaultOptions ¶
type WorkspaceManager ¶
type WorkspaceManager struct {
// contains filtered or unexported fields
}
func NewWorkspaceManager ¶
func NewWorkspaceManager(opts Options) *WorkspaceManager
func (*WorkspaceManager) PrepareBinaryWorkspace ¶
func (m *WorkspaceManager) PrepareBinaryWorkspace(ctx context.Context, stageName string, candidate pgindex.BinaryInspectionCandidate) (*Workspace, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.