// Match - matches object name with anyone of action pattern in action set.
763866
func (actionSet ActionSet) Match(action Action) bool {
	for r := range actionSet {
		if r.Match(action) {
			return true
		}
	}

	return false
}
492154
func (set Set) Match(caps [][]string) []string {
	if set == nil {
		return nil
	}
anyof:
	for _, andList := range caps {
		for _, cap := range andList {
			if _, ok := set[cap]; !ok {
				continue anyof
			}
		}
		return andList
	}
	// match anything
	return nil
}
414483
func matches(name string, patterns []string) (bool, error) {
	if len(patterns) == 0 {
		return true, nil
	}

	for _, pattern := range patterns {
		match, err := filepath.Match(pattern, name)
		if err != nil {
			return false, err
		}

		if match {
			return true, nil
		}
	}

	return false, nil
}
999181
func (d *DateString) Match(value string) bool {
	return d.Regexp.Match([]byte(value))
}
621899
func (r *router) Match(url, method string) (*Route, Params) {
	cn, ok := r.trees[method]
	if !ok {
		return nil, nil
	}
	var params = make(Params, 0, strings.Count(url, "/"))
	for _, n := range cn.edges {
		e, newParams := r.matchNode(n, url, params)
		if e != nil {
			return e.handle, newParams
		}
	}
	return nil, nil
}
293691
func (c *Constraints) Match(arch, target, event, branch, status string, matrix map[string]string) bool {
	return c.Platform.Match(arch) &&
		c.Environment.Match(target) &&
		c.Event.Match(event) &&
		c.Branch.Match(branch) &&
		c.Status.Match(status) &&
		c.Matrix.Match(matrix)
}
869448
func Match(pattern string, b []byte) (matched bool, err error) {
	re, err := Compile(pattern)
	if err != nil {
		return false, err
	}
	return re.Match(b), nil
}
1111672
func (c *ConstraintMap) Match(params map[string]string) bool {
	// when no includes or excludes automatically match
	if len(c.Include) == 0 && len(c.Exclude) == 0 {
		return true
	}

	// exclusions are processed first. So we can include everything and then
	// selectively include others.
	if len(c.Exclude) != 0 {
		var matches int

		for key, val := range c.Exclude {
			if params[key] == val {
				matches++
			}
		}
		if matches == len(c.Exclude) {
			return false
		}
	}

	for key, val := range c.Include {
		if params[key] != val {
			return false
		}
	}

	return true
}
1075054
func (s *Server) Match(methods []string, path string, handler HandlerFunc, opts ...HandlerOption) {
	info := newHandlerInfo(handler, opts)
	s.registerInfo(path, info, methods...)
}
691606
func (r Resource) Match(resource string, conditionValues map[string][]string) bool {
	pattern := r.Pattern
	for _, key := range condition.CommonKeys {
		// Empty values are not supported for policy variables.
		if rvalues, ok := conditionValues[key.Name()]; ok && rvalues[0] != "" {
			pattern = strings.Replace(pattern, key.VarName(), rvalues[0], -1)
		}
	}
	if strings.HasPrefix(resource, pattern) {
		return true
	}
	return wildcard.Match(pattern, resource)
}
678760
func (efm *Efm) Match(s string) *Match {
	ms := efm.regex.FindStringSubmatch(s)
	if len(ms) == 0 {
		return nil
	}
	match := &Match{}
	names := efm.regex.SubexpNames()
	for i, name := range names {
		if i == 0 {
			continue
		}
		m := ms[i]
		switch name {
		case "f":
			match.F = m
		case "n":
			match.N = mustAtoI(m)
		case "l":
			match.L = mustAtoI(m)
		case "c":
			match.C = mustAtoI(m)
		case "t":
			match.T = m[0]
		case "m":
			match.M = m
		case "r":
			match.R = m
		case "p":
			match.P = m
		case "v":
			match.V = mustAtoI(m)
		case "s":
			match.S = m
		}
	}
	return match
}
536341
func (code Code) Matches(err error) bool {
	if err == nil {
		return !code.IsError()
	}
	apiErr, ok := err.(*Error)
	return ok && apiErr.code == code
}
432207
func Match(methods []string, path string, h interface{}, m ...interface{}) {
	Default.Match(methods, path, h, m...)
}
224182
func matches(s, pattern string) bool {
	return regexp.MustCompile(pattern).MatchString(s)
}
22969
func (uo *UnitOption) Match(other *UnitOption) bool {
	return uo.Section == other.Section &&
		uo.Name == other.Name &&
		uo.Value == other.Value
}
81368
func match(s *drone.Secret, image, event string) bool {
	return matchImage(s, image) && matchEvent(s, event)
}
876784
func (o Operand) Match(t Operand) bool {
	if o == OperandAny || t == OperandAny {
		return true
	}
	if o == t {
		return true
	}
	return false
}