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>
47 lines
1.2 KiB
Go
47 lines
1.2 KiB
Go
package strategy
|
|
|
|
import "github.com/splitio/go-split-commons/v7/dtos"
|
|
|
|
// DebugImpl struct for debug impression mode strategy.
|
|
type DebugImpl struct {
|
|
impressionObserver ImpressionObserver
|
|
listenerEnabled bool
|
|
}
|
|
|
|
// NewDebugImpl creates new DebugImpl.
|
|
func NewDebugImpl(impressionObserver ImpressionObserver, listenerEnabled bool) ProcessStrategyInterface {
|
|
return &DebugImpl{
|
|
impressionObserver: impressionObserver,
|
|
listenerEnabled: listenerEnabled,
|
|
}
|
|
}
|
|
|
|
func (s *DebugImpl) apply(impression *dtos.Impression) bool {
|
|
impression.Pt, _ = s.impressionObserver.TestAndSet(impression.FeatureName, impression)
|
|
|
|
return true
|
|
}
|
|
|
|
// Apply calculate the pt and return the impression.
|
|
func (s *DebugImpl) Apply(impressions []dtos.Impression) ([]dtos.Impression, []dtos.Impression) {
|
|
forLog := make([]dtos.Impression, 0, len(impressions))
|
|
forListener := make([]dtos.Impression, 0, len(impressions))
|
|
|
|
for index := range impressions {
|
|
s.apply(&impressions[index])
|
|
}
|
|
|
|
forLog = impressions
|
|
|
|
if s.listenerEnabled {
|
|
forListener = impressions
|
|
}
|
|
|
|
return forLog, forListener
|
|
}
|
|
|
|
// ApplySingle description
|
|
func (s *DebugImpl) ApplySingle(impression *dtos.Impression) bool {
|
|
return s.apply(impression)
|
|
}
|