2023-04-01 16:43:13 +08:00
|
|
|
package global
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2023-04-02 23:35:12 +08:00
|
|
|
"github.com/minio/minio-go/v7"
|
2023-04-01 16:43:13 +08:00
|
|
|
"os"
|
|
|
|
|
|
|
|
"git.hpds.cc/Component/logging"
|
|
|
|
"go.uber.org/zap"
|
|
|
|
"xorm.io/xorm"
|
|
|
|
|
|
|
|
"data_minio/config"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2023-04-02 23:35:12 +08:00
|
|
|
DB *xorm.Engine
|
|
|
|
Cfg *config.DataMinioConfig
|
|
|
|
Logger *logging.Logger
|
|
|
|
MinioClient *minio.Client
|
2023-04-01 16:43:13 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
func Must(err error) {
|
|
|
|
if err != nil {
|
|
|
|
_, _ = fmt.Fprint(os.Stderr, err)
|
|
|
|
Logger.With(
|
|
|
|
zap.String("应用名称", Cfg.Name),
|
|
|
|
).Error(err.Error())
|
2023-04-02 23:35:12 +08:00
|
|
|
//os.Exit(1)
|
2023-04-01 16:43:13 +08:00
|
|
|
}
|
|
|
|
}
|