Agent par défaut
This commit is contained in:
1 parent
cf10b9073b
commit
f74e4d1043
24 files changed
+385
-37
No files matched your search
@@ -13,6 +13,7 @@ const (
|
||||
DEFAULT_DB_URL = "lassistanoque.db"
|
||||
DEFAULT_HTTP_PORT = 3000
|
||||
DEFAULT_STORAGE_TYPE = "database"
|
||||
DEFAULT_SERVER_ID = "default"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
@@ -27,6 +28,7 @@ type Config struct {
|
||||
StorageS3AccessKeyID string // S3
|
||||
StorageS3AccessKeySecret string // S3
|
||||
StorageS3UseSSL string // S3
|
||||
ServerID string
|
||||
}
|
||||
|
||||
var config *Config
|
||||
@@ -56,6 +58,10 @@ func GetConfig() *Config {
|
||||
if storageType == "" {
|
||||
storageType = DEFAULT_STORAGE_TYPE
|
||||
}
|
||||
serverID := os.Getenv("LASSISTANOQUE_SERVER_ID")
|
||||
if serverID == "" {
|
||||
serverID = DEFAULT_SERVER_ID
|
||||
}
|
||||
|
||||
config = &Config{
|
||||
DatabaseType: databaseType,
|
||||
@@ -63,6 +69,7 @@ func GetConfig() *Config {
|
||||
HttpPort: httpPort,
|
||||
JWTSecret: jwtsecret,
|
||||
StorageType: storageType,
|
||||
ServerID: serverID,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user