Restructured project
- backend moved to backend directory - added and initialized frontend with vue - moved infrastructure files to infra directory
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user