9d845c8899
- backend moved to backend directory - added and initialized frontend with vue - moved infrastructure files to infra directory
29 lines
455 B
Go
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)
|
|
}
|
|
}
|