triggers

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package triggers implements various trigger types for matching files and directories within packs. Triggers are pattern-matching engines that determine which files should be processed by power-ups.

Index

Constants

View Source
const (
	CatchallTriggerName = "catchall"
)
View Source
const DirectoryTriggerName = "directory"

DirectoryTriggerName is the name used to reference this trigger

View Source
const ExtensionTriggerName = "extension"

ExtensionTriggerName is the name used to reference this trigger

View Source
const (
	FileNameTriggerName = "filename"
)
View Source
const PathPatternTriggerName = "path_pattern"

PathPatternTriggerName is the name used to reference this trigger

Variables

This section is empty.

Functions

This section is empty.

Types

type CatchallTrigger added in v0.1.1

type CatchallTrigger struct {
	// contains filtered or unexported fields
}

CatchallTrigger matches all files and directories not matched by other triggers

func NewCatchallTrigger added in v0.1.1

func NewCatchallTrigger(options map[string]interface{}) (*CatchallTrigger, error)

NewCatchallTrigger creates a new CatchallTrigger with the given options

func (*CatchallTrigger) Description added in v0.1.1

func (t *CatchallTrigger) Description() string

Description returns a human-readable description of what this trigger matches

func (*CatchallTrigger) Match added in v0.1.1

func (t *CatchallTrigger) Match(path string, info fs.FileInfo) (bool, map[string]interface{})

Match checks if the given file should be caught by the catchall

func (*CatchallTrigger) Name added in v0.1.1

func (t *CatchallTrigger) Name() string

Name returns the unique name of this trigger

func (*CatchallTrigger) Priority added in v0.1.1

func (t *CatchallTrigger) Priority() int

Priority returns the priority of this trigger

func (*CatchallTrigger) Type added in v0.1.1

func (t *CatchallTrigger) Type() types.TriggerType

Type returns the trigger type - this is a catchall trigger

type DirectoryTrigger

type DirectoryTrigger struct {
	// contains filtered or unexported fields
}

DirectoryTrigger matches entire directories by name

func NewDirectoryTrigger

func NewDirectoryTrigger(options map[string]interface{}) (*DirectoryTrigger, error)

NewDirectoryTrigger creates a new DirectoryTrigger with the given options

func (*DirectoryTrigger) Description

func (t *DirectoryTrigger) Description() string

Description returns a human-readable description of this trigger

func (*DirectoryTrigger) Match

func (t *DirectoryTrigger) Match(path string, info fs.FileInfo) (bool, map[string]interface{})

Match checks if the given path matches this trigger's pattern

func (*DirectoryTrigger) Name

func (t *DirectoryTrigger) Name() string

Name returns the name of this trigger

func (*DirectoryTrigger) Priority

func (t *DirectoryTrigger) Priority() int

Priority returns the priority of this trigger

func (*DirectoryTrigger) Type added in v0.1.1

Type returns the trigger type - this is a specific trigger

func (*DirectoryTrigger) ValidateOptions

func (t *DirectoryTrigger) ValidateOptions(options map[string]interface{}) error

ValidateOptions checks if the provided options are valid for this trigger

type ExtensionTrigger

type ExtensionTrigger struct {
	// contains filtered or unexported fields
}

ExtensionTrigger matches files by their extension

func NewExtensionTrigger

func NewExtensionTrigger(options map[string]interface{}) (*ExtensionTrigger, error)

NewExtensionTrigger creates a new ExtensionTrigger with the given options

func (*ExtensionTrigger) Description

func (t *ExtensionTrigger) Description() string

Description returns a human-readable description of this trigger

func (*ExtensionTrigger) Match

func (t *ExtensionTrigger) Match(path string, info fs.FileInfo) (bool, map[string]interface{})

Match checks if the given path matches this trigger's extension

func (*ExtensionTrigger) Name

func (t *ExtensionTrigger) Name() string

Name returns the name of this trigger

func (*ExtensionTrigger) Priority

func (t *ExtensionTrigger) Priority() int

Priority returns the priority of this trigger

func (*ExtensionTrigger) Type added in v0.1.1

Type returns the trigger type - this is a specific trigger

func (*ExtensionTrigger) ValidateOptions

func (t *ExtensionTrigger) ValidateOptions(options map[string]interface{}) error

ValidateOptions checks if the provided options are valid for this trigger

type FileNameTrigger

type FileNameTrigger struct {
	// contains filtered or unexported fields
}

FileNameTrigger matches files based on their name or glob pattern

func NewFileNameTrigger

func NewFileNameTrigger(pattern string) *FileNameTrigger

NewFileNameTrigger creates a new FileNameTrigger with the given pattern

func (*FileNameTrigger) Description

func (t *FileNameTrigger) Description() string

Description returns a human-readable description of what this trigger matches

func (*FileNameTrigger) GetPattern added in v0.1.1

func (t *FileNameTrigger) GetPattern() string

GetPattern returns the pattern this trigger matches

func (*FileNameTrigger) Match

func (t *FileNameTrigger) Match(path string, info fs.FileInfo) (bool, map[string]interface{})

Match checks if the given file matches this trigger's pattern

func (*FileNameTrigger) Name

func (t *FileNameTrigger) Name() string

Name returns the unique name of this trigger

func (*FileNameTrigger) Priority

func (t *FileNameTrigger) Priority() int

Priority returns the priority of this trigger

func (*FileNameTrigger) Type added in v0.1.1

func (t *FileNameTrigger) Type() types.TriggerType

Type returns the trigger type - this is a specific trigger

type PathPatternTrigger

type PathPatternTrigger struct {
	// contains filtered or unexported fields
}

PathPatternTrigger matches files based on their full path pattern

func NewPathPatternTrigger

func NewPathPatternTrigger(options map[string]interface{}) (*PathPatternTrigger, error)

NewPathPatternTrigger creates a new PathPatternTrigger with the given options

func (*PathPatternTrigger) Description

func (t *PathPatternTrigger) Description() string

Description returns a human-readable description of this trigger

func (*PathPatternTrigger) Match

func (t *PathPatternTrigger) Match(path string, info fs.FileInfo) (bool, map[string]interface{})

Match checks if the given path matches this trigger's pattern

func (*PathPatternTrigger) Name

func (t *PathPatternTrigger) Name() string

Name returns the name of this trigger

func (*PathPatternTrigger) Priority

func (t *PathPatternTrigger) Priority() int

Priority returns the priority of this trigger

func (*PathPatternTrigger) Type added in v0.1.1

Type returns the trigger type - this is a specific trigger

func (*PathPatternTrigger) ValidateOptions

func (t *PathPatternTrigger) ValidateOptions(options map[string]interface{}) error

ValidateOptions checks if the provided options are valid for this trigger

Jump to

Keyboard shortcuts

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