error log in startup

This commit is contained in:
Djeeberjr 2022-05-10 12:48:54 +02:00
parent a160602b92
commit 8cbeb1109f

View File

@ -6,24 +6,25 @@ import (
"git.kapelle.org/niklas/s3share/internal/s3" "git.kapelle.org/niklas/s3share/internal/s3"
"git.kapelle.org/niklas/s3share/internal/types" "git.kapelle.org/niklas/s3share/internal/types"
"git.kapelle.org/niklas/s3share/internal/web" "git.kapelle.org/niklas/s3share/internal/web"
"github.com/sirupsen/logrus"
) )
func Start(config *types.AppConfig) { func Start(config *types.AppConfig) {
db, err := db.NewSqlLiteDB("foo.db") db, err := db.NewSqlLiteDB("foo.db")
if err != nil { if err != nil {
panic(err) logrus.Fatal(err.Error())
} }
s3Client, err := s3.NewMinio(config.S3Endpoint, config.S3Bucket, config.S3AccessKey, config.S3SecretKey, config.S3SSL) s3Client, err := s3.NewMinio(config.S3Endpoint, config.S3Bucket, config.S3AccessKey, config.S3SecretKey, config.S3SSL)
if err != nil { if err != nil {
panic(err) logrus.Fatal(err.Error())
} }
client := client.NewClient(db, s3Client) client := client.NewClient(db, s3Client)
err = web.StartWebserver(config.Address, *client) err = web.StartWebserver(config.Address, *client)
if err != nil { if err != nil {
panic(err) logrus.Fatal(err.Error())
} }
} }