Full Mattermost server source with integrated Community Enterprise features. Includes vendor directory for offline/air-gapped builds. Structure: - enterprise-impl/: Enterprise feature implementations - enterprise-community/: Init files that register implementations - enterprise/: Bridge imports (community_imports.go) - vendor/: All dependencies for offline builds Build (online): go build ./cmd/mattermost Build (offline/air-gapped): go build -mod=vendor ./cmd/mattermost 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
37 lines
1.1 KiB
Go
37 lines
1.1 KiB
Go
package grammar
|
|
|
|
// DependencyMatcher will match if the evaluation of another split results in one of the treatments defined
|
|
// in the feature flag
|
|
type DependencyMatcher struct {
|
|
Matcher
|
|
feature string
|
|
treatments []string
|
|
dependencyEvaluator dependencyEvaluator
|
|
}
|
|
|
|
// Match will return true if the evaluation of another split results in one of the treatments defined in the
|
|
// feature flag
|
|
func (m *DependencyMatcher) Match(key string, attributes map[string]interface{}, bucketingKey *string) bool {
|
|
|
|
result := m.dependencyEvaluator.EvaluateDependency(key, bucketingKey, m.feature, attributes)
|
|
for _, treatment := range m.treatments {
|
|
if treatment == result {
|
|
return true
|
|
}
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// NewDependencyMatcher will return a new instance of DependencyMatcher
|
|
func NewDependencyMatcher(negate bool, feature string, treatments []string, deedependencyEvaluator dependencyEvaluator) *DependencyMatcher {
|
|
return &DependencyMatcher{
|
|
Matcher: Matcher{
|
|
negate: negate,
|
|
},
|
|
feature: feature,
|
|
treatments: treatments,
|
|
dependencyEvaluator: deedependencyEvaluator,
|
|
}
|
|
}
|