Documentation ¶
Index ¶
- type Filter
- func (filter *Filter) Compile() error
- func (left *Filter) Equal(right *Filter) bool
- func (filter *Filter) Match(pathname string) bool
- func (filter *Filter) RegisterStrings(registerFunc func(string))
- func (filter *Filter) ReplaceStrings(replaceFunc func(string) string)
- func (filter *Filter) Write(writer io.Writer) error
- type MergeableFilter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Filter ¶
type Filter struct { FilterLines []string // contains filtered or unexported fields }
A Filter contains a list of regular expressions matching pathnames which should be filtered out: excluded when building or not changed when pushing images to a sub. A Filter with no lines is an empty filter (nothing is excluded, everything is changed when pushing). A nil *Filter is a sparse filter: when building nothing is excluded. When pushing to a sub, all files are pushed but files on the sub which are not in the image are not removed from the sub.
func New ¶
New will create a Filter from a list of regular expressions, which are automatically anchored to the beginning of the string to be matched against. If filterLines is of length zero the Filter is an empty Filter.
func (*Filter) Equal ¶ added in v0.3.2
Equal will return true if two filters contain the same filter lines.
func (*Filter) Match ¶
Match will return true if pathname matches one of the regular expressions. The Compile method will be automatically called if it has not been called yet.
func (*Filter) RegisterStrings ¶ added in v0.3.3
RegisterStrings may be used to register the regular expression strings with a string de-duper. This can be used for garbage collection.
func (*Filter) ReplaceStrings ¶
ReplaceStrings may be used to replace the regular expression strings with de-duplicated copies.
type MergeableFilter ¶
type MergeableFilter struct {
// contains filtered or unexported fields
}
A MergeableFilter may be used to combine multiple Filters, eliminating duplicate match expressions.
func (*MergeableFilter) ExportFilter ¶
func (mf *MergeableFilter) ExportFilter() *Filter
ExportFilter will return a Filter from previously merged Filters.
func (*MergeableFilter) Merge ¶
func (mf *MergeableFilter) Merge(filter *Filter)
Merge will merge a Filter.