processors

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OnlyDerived

func OnlyDerived(content *simplecontent.Content) bool

OnlyDerived returns true for derived content.

func OnlyImages

func OnlyImages(content *simplecontent.Content) bool

OnlyImages returns true for image content types.

func OnlyOriginals

func OnlyOriginals(content *simplecontent.Content) bool

OnlyOriginals returns true for non-derived content.

func OnlyStatus

func OnlyStatus(status string) func(*simplecontent.Content) bool

OnlyStatus returns a condition function that matches a specific status.

func OnlyVideos

func OnlyVideos(content *simplecontent.Content) bool

OnlyVideos returns true for video content types.

Types

type ChainProcessor

type ChainProcessor struct {
	Processors []scan.ContentProcessor
}

ChainProcessor chains multiple processors together. Each processor is called in sequence. If any processor returns an error, the chain stops and the error is returned.

func NewChainProcessor

func NewChainProcessor(processors ...scan.ContentProcessor) *ChainProcessor

NewChainProcessor creates a new ChainProcessor with the given processors.

func (*ChainProcessor) Process

func (p *ChainProcessor) Process(ctx context.Context, content *simplecontent.Content) error

type ConditionalProcessor

type ConditionalProcessor struct {
	Condition func(*simplecontent.Content) bool
	Processor scan.ContentProcessor
}

ConditionalProcessor conditionally processes contents based on a predicate function. If the condition returns true, the wrapped processor is called. If the condition returns false, the content is skipped (returns nil).

func NewConditionalProcessor

func NewConditionalProcessor(condition func(*simplecontent.Content) bool, processor scan.ContentProcessor) *ConditionalProcessor

NewConditionalProcessor creates a new ConditionalProcessor.

func (*ConditionalProcessor) Process

func (p *ConditionalProcessor) Process(ctx context.Context, content *simplecontent.Content) error

type CounterProcessor

type CounterProcessor struct {

	// ByStatus counts contents by status
	ByStatus map[string]int64

	// ByDocumentType counts contents by document type
	ByDocumentType map[string]int64

	// ByTenant counts contents by tenant ID
	ByTenant map[string]int64

	// ByDerivationType counts derived contents by derivation type
	ByDerivationType map[string]int64

	// Total is the total count of all contents processed
	Total int64
	// contains filtered or unexported fields
}

CounterProcessor counts contents by various attributes. Useful for generating statistics during a scan.

func NewCounterProcessor

func NewCounterProcessor() *CounterProcessor

func (*CounterProcessor) PrintSummary

func (p *CounterProcessor) PrintSummary()

PrintSummary prints a summary of the counts

func (*CounterProcessor) Process

func (p *CounterProcessor) Process(ctx context.Context, content *simplecontent.Content) error

type PrinterProcessor

type PrinterProcessor struct {
	Verbose bool // If true, print detailed information
}

PrinterProcessor prints content information to stdout. Useful for testing and debugging scan operations.

func (*PrinterProcessor) Process

func (p *PrinterProcessor) Process(ctx context.Context, content *simplecontent.Content) error

Jump to

Keyboard shortcuts

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