Files
FamilyHUB/backend/src/config/runMode.go
T
admin 9d845c8899 Restructured project
- backend moved to backend directory
- added and initialized frontend with vue
- moved infrastructure files to infra directory
2026-04-01 23:16:27 +03:00

29 lines
455 B
Go

package config
import (
"fmt"
"strings"
)
type RunMode string
const (
Bot RunMode = "bot"
API RunMode = "api"
Standalone RunMode = "standalone"
Unknown RunMode = "unknown"
)
func ParseRunMode(s string) (RunMode, error) {
switch strings.ToLower(s) {
case "bot":
return Bot, nil
case "api":
return API, nil
case "standalone":
return Standalone, nil
default:
return Unknown, fmt.Errorf("invalid run mode: %s", s)
}
}