Documentation
¶
Index ¶
- Constants
- type BranchMatcher
- func NewBranchMatcher(pattern string, regex bool) BranchMatcher
- func NewContainsMatch(pattern string) BranchMatcher
- func NewGlobMatch(pattern string) BranchMatcher
- func NewMatcher(pattern string, typ ...string) BranchMatcher
- func NewPrefixMatch(pattern string) BranchMatcher
- func NewRegexMatch(pattern string) BranchMatcher
- func NewSuffixMatch(pattern string) BranchMatcher
- type ContainsMatch
- type GlobMatch
- type MultiMatcher
- type PrefixMatch
- type RegexMatch
- type SuffixMatch
Constants ¶
const ( // MatchAny match any one as success(default) MatchAny = iota // MatchAll match all as success MatchAll )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BranchMatcher ¶
type BranchMatcher interface {
fmt.Stringer
// Match branch name, no remote prefix
Match(branch string) bool
}
BranchMatcher interface
func NewBranchMatcher ¶
func NewBranchMatcher(pattern string, regex bool) BranchMatcher
NewBranchMatcher create a new branch matcher
func NewContainsMatch ¶
func NewContainsMatch(pattern string) BranchMatcher
NewContainsMatch create a new contains matcher
func NewGlobMatch ¶
func NewGlobMatch(pattern string) BranchMatcher
NewGlobMatch create a new glob matcher
func NewMatcher ¶
func NewMatcher(pattern string, typ ...string) BranchMatcher
NewMatcher create a branch matcher by type and pattern
func NewPrefixMatch ¶
func NewPrefixMatch(pattern string) BranchMatcher
NewPrefixMatch create a new prefix matcher
func NewRegexMatch ¶
func NewRegexMatch(pattern string) BranchMatcher
NewRegexMatch create a new regex matcher
func NewSuffixMatch ¶
func NewSuffixMatch(pattern string) BranchMatcher
NewSuffixMatch create a new suffix matcher
type ContainsMatch ¶
type ContainsMatch struct {
// contains filtered or unexported fields
}
ContainsMatch handle contains matching
func (*ContainsMatch) Match ¶
func (c *ContainsMatch) Match(branch string) bool
Match branch name by contains pattern
type GlobMatch ¶
type GlobMatch struct {
// contains filtered or unexported fields
}
GlobMatch handle glob matching
type MultiMatcher ¶
type MultiMatcher struct {
// contains filtered or unexported fields
}
MultiMatcher match branch name by multi matcher
func NewMulti ¶
func NewMulti(ms ...BranchMatcher) *MultiMatcher
NewMulti create a multi matcher by matchers
func QuickMulti ¶
func QuickMulti(typWithPatterns ...string) *MultiMatcher
QuickMulti quick create a multi matcher by type and patterns
Usage:
m := QuickMulti("contains:feat", "prefix:fix", "suffix:bug")
m := QuickMulti("contains:feat", "prefix:fix", "suffix:bug").WithMode(MatchAll)
func (*MultiMatcher) Add ¶
func (m *MultiMatcher) Add(ms ...BranchMatcher)
Add matcher to multi matcher
func (*MultiMatcher) Match ¶
func (m *MultiMatcher) Match(branch string) bool
Match branch name by multi matcher
func (*MultiMatcher) WithMode ¶
func (m *MultiMatcher) WithMode(mode uint8) *MultiMatcher
WithMode set mode
type PrefixMatch ¶
type PrefixMatch struct {
// contains filtered or unexported fields
}
PrefixMatch handle prefix matching
func (*PrefixMatch) Match ¶
func (p *PrefixMatch) Match(branch string) bool
Match branch name by prefix pattern
type RegexMatch ¶
type RegexMatch struct {
// contains filtered or unexported fields
}
RegexMatch handle regex matching
func (*RegexMatch) Match ¶
func (r *RegexMatch) Match(branch string) bool
Match branch name by regex pattern
type SuffixMatch ¶
type SuffixMatch struct {
// contains filtered or unexported fields
}
SuffixMatch handle suffix matching
func (*SuffixMatch) Match ¶
func (s *SuffixMatch) Match(branch string) bool
Match branch name by suffix pattern