Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrUnknownMatchType = errors.New("unknown match type")
)
Functions ¶
This section is empty.
Types ¶
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
func NewFilter ¶
NewFilter creates a new filter to determine which downloadables should be kept based on the matchers.
func (*Filter) Filter ¶
func (f *Filter) Filter(in []collector.Downloadable) (out []MatchedDownloadable, err error)
func (Filter) MarshalYAML ¶
func (*Filter) UnmarshalYAML ¶
type MatchType ¶
type MatchType int
func (MatchType) MarshalYAML ¶
func (*MatchType) UnmarshalYAML ¶
type MatchedDownloadable ¶
type MatchedDownloadable struct { collector.Downloadable Optional bool }
type Matcher ¶
type Matcher interface {
Match(dl collector.Downloadable) (MatchType, bool, error)
}
Matcher is an interface that defines a method to match a downloadable to see if it should be used or not.
type MatcherWrapper ¶
func (MatcherWrapper) MarshalYAML ¶
func (m MatcherWrapper) MarshalYAML() (any, error)
func (*MatcherWrapper) UnmarshalYAML ¶
func (m *MatcherWrapper) UnmarshalYAML(node *yaml.Node) error
type RegexMatcher ¶
RegexMatcher is a type that implements the Matcher interface to match a downloadable using a regex.
NOTE: MatchType is used to determine what to do if the regex matches. We could use negative lookaheads in the regex, but go doesn't support them. This is because they can lead to denial of service attacks.
func (*RegexMatcher) Match ¶
func (m *RegexMatcher) Match(dl collector.Downloadable) (MatchType, bool, error)
Click to show internal directories.
Click to hide internal directories.