brinfo

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
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

func (*ContainsMatch) String

func (c *ContainsMatch) String() string

String get string

type GlobMatch

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

GlobMatch handle glob matching

func (*GlobMatch) Match

func (g *GlobMatch) Match(branch string) bool

Match branch name by glob pattern

func (*GlobMatch) String

func (g *GlobMatch) String() string

String get string

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) IsEmpty

func (m *MultiMatcher) IsEmpty() bool

IsEmpty check

func (*MultiMatcher) Len

func (m *MultiMatcher) Len() int

Len of multi matcher

func (*MultiMatcher) Match

func (m *MultiMatcher) Match(branch string) bool

Match branch name by multi matcher

func (*MultiMatcher) String

func (m *MultiMatcher) String() string

String get string

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

func (*PrefixMatch) String

func (p *PrefixMatch) String() string

String get string

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

func (*RegexMatch) String

func (r *RegexMatch) String() string

String get string

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

func (*SuffixMatch) String

func (s *SuffixMatch) String() string

String get string

Jump to

Keyboard shortcuts

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