Documentation ¶
Index ¶
- func DefaultExcludes() []types.Rule
- func NewBinaryRule() types.Rule
- func NewExtensionRule(exts []string, action types.RuleAction) types.Rule
- func NewPatternRule(patterns []string, action types.RuleAction) types.Rule
- type BaseRule
- type BinaryRule
- type ExtensionRule
- type PatternRule
- type Rule
- type RuleAction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultExcludes ¶
func NewBinaryRule ¶ added in v0.2.3
func NewExtensionRule ¶
func NewExtensionRule(exts []string, action types.RuleAction) types.Rule
func NewPatternRule ¶
func NewPatternRule(patterns []string, action types.RuleAction) types.Rule
Types ¶
type BaseRule ¶
type BaseRule struct {
// contains filtered or unexported fields
}
BaseRule provides common functionality
func (*BaseRule) Action ¶
func (r *BaseRule) Action() RuleAction
type BinaryRule ¶ added in v0.2.3
func (*BinaryRule) Match ¶ added in v0.2.3
func (r *BinaryRule) Match(path string) bool
Match checks if a file is binary using three methods: 1. Known binary file extensions 2. Presence of null bytes in the first 1024 bytes 3. UTF-8 validation of the content
type ExtensionRule ¶
func (*ExtensionRule) Match ¶
func (r *ExtensionRule) Match(path string) bool
type PatternRule ¶
func (*PatternRule) Match ¶
func (r *PatternRule) Match(path string) bool
func (*PatternRule) Patterns ¶
func (r *PatternRule) Patterns() []string
type Rule ¶
type Rule interface { Match(path string) bool Action() RuleAction }
Click to show internal directories.
Click to hide internal directories.