mirror of
https://github.com/hanzoai/status.git
synced 2026-10-30 18:21:48 +00:00
White-labelable status monitoring service with all Gatus branding removed. Defaults to neutral "Status" text. Branding is driven entirely by the ui section in config YAML. - Pure Go build (CGO_ENABLED=0, modernc.org/sqlite) - Multi-stage Dockerfile (node frontend + go backend + alpine runtime) - K8s kustomize overlays for hanzo and lux deployments - GitHub Actions CI for GHCR image push - Pre-built Vue frontend with zero upstream branding
21 lines
607 B
Go
21 lines
607 B
Go
package pattern
|
|
|
|
import (
|
|
"path/filepath"
|
|
"strings"
|
|
)
|
|
|
|
// Match checks whether a string matches a pattern
|
|
func Match(pattern, s string) bool {
|
|
if pattern == "*" {
|
|
return true
|
|
}
|
|
// Separators found in the string break filepath.Match, so we'll remove all of them.
|
|
// This has a pretty significant impact on performance when there are separators in
|
|
// the strings, but at least it doesn't break filepath.Match.
|
|
s = strings.ReplaceAll(s, string(filepath.Separator), "")
|
|
pattern = strings.ReplaceAll(pattern, string(filepath.Separator), "")
|
|
matched, _ := filepath.Match(pattern, s)
|
|
return matched
|
|
}
|