mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-03 23:20:26 +08:00
v1.4.1
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
package configs
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
teaconst "github.com/TeaOSLab/EdgeAPI/internal/const"
|
||||
"github.com/iwind/TeaGo/Tea"
|
||||
"gopkg.in/yaml.v3"
|
||||
"os"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
var sharedAPIConfig *APIConfig = nil
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package configs
|
||||
|
||||
import (
|
||||
_ "github.com/iwind/TeaGo/bootstrap"
|
||||
"testing"
|
||||
|
||||
_ "github.com/iwind/TeaGo/bootstrap"
|
||||
)
|
||||
|
||||
func TestSharedAPIConfig(t *testing.T) {
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
// Copyright 2024 GoEdge CDN goedge.cdn@gmail.com. All rights reserved. Official site: https://goedge.cn .
|
||||
// Copyright 2024 GoEdge CDN goedge.cdn@gmail.com. All rights reserved. Official site: https://goedge.cloud .
|
||||
|
||||
package configs
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"os"
|
||||
|
||||
"github.com/iwind/TeaGo/Tea"
|
||||
"github.com/iwind/TeaGo/dbs"
|
||||
"gopkg.in/yaml.v3"
|
||||
"os"
|
||||
)
|
||||
|
||||
func LoadDBConfig() (*dbs.Config, error) {
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
// Copyright 2024 GoEdge CDN goedge.cdn@gmail.com. All rights reserved. Official site: https://goedge.cn .
|
||||
// Copyright 2024 GoEdge CDN goedge.cdn@gmail.com. All rights reserved. Official site: https://goedge.cloud .
|
||||
|
||||
package configs
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
"os"
|
||||
|
||||
"github.com/iwind/TeaGo/Tea"
|
||||
"github.com/iwind/TeaGo/dbs"
|
||||
"gopkg.in/yaml.v3"
|
||||
"net/url"
|
||||
"os"
|
||||
)
|
||||
|
||||
type SimpleDBConfig struct {
|
||||
@@ -28,7 +29,7 @@ func ParseSimpleDBConfig(data []byte) (*SimpleDBConfig, error) {
|
||||
func (this *SimpleDBConfig) GenerateOldConfig() error {
|
||||
var dbConfig = &dbs.DBConfig{
|
||||
Driver: "mysql",
|
||||
Dsn: url.QueryEscape(this.User) + ":" + url.QueryEscape(this.Password) + "@tcp(" + this.Host + ")/" + url.PathEscape(this.Database) + "?charset=utf8mb4&timeout=30s&multiStatements=true",
|
||||
Dsn: url.QueryEscape(this.User) + ":" + this.Password + "@tcp(" + this.Host + ")/" + url.PathEscape(this.Database) + "?charset=utf8mb4&timeout=30s&multiStatements=true",
|
||||
Prefix: "edge",
|
||||
}
|
||||
dbConfig.Models.Package = "internal/db/models"
|
||||
|
||||
Reference in New Issue
Block a user