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>
30 lines
946 B
Go
30 lines
946 B
Go
package local
|
|
|
|
import (
|
|
"regexp"
|
|
|
|
"github.com/splitio/go-toolkit/v5/logging"
|
|
)
|
|
|
|
const (
|
|
// SplitFileFormatClassic represents the file format of the standard split definition file <feature treatment>
|
|
SplitFileFormatClassic = iota
|
|
// SplitFileFormatJSON represents the file format of a JSON representation of split dtos
|
|
SplitFileFormatJSON
|
|
// SplitFileFormatYAML represents the file format of a YAML representation of split dtos
|
|
SplitFileFormatYAML
|
|
)
|
|
|
|
func DefineFormat(splitFile string, logger logging.LoggerInterface) int {
|
|
var r = regexp.MustCompile("(?i)(.yml$|.yaml$)")
|
|
if r.MatchString(splitFile) {
|
|
return SplitFileFormatYAML
|
|
}
|
|
r = regexp.MustCompile(`(?i)\.json$`)
|
|
if r.MatchString(splitFile) {
|
|
return SplitFileFormatJSON
|
|
}
|
|
logger.Warning("Localhost mode: .split mocks will be deprecated soon in favor of YAML files, which provide more targeting power. Take a look in our documentation.")
|
|
return SplitFileFormatClassic
|
|
}
|