s3-share/internal/s3Share.go
2022-05-09 16:10:05 +02:00

30 lines
661 B
Go

package s3share
import (
"git.kapelle.org/niklas/s3share/internal/client"
"git.kapelle.org/niklas/s3share/internal/db"
"git.kapelle.org/niklas/s3share/internal/s3"
"git.kapelle.org/niklas/s3share/internal/types"
"git.kapelle.org/niklas/s3share/internal/web"
)
func Start(config *types.AppConfig) {
db, err := db.NewSqlLiteDB("foo.db")
if err != nil {
panic(err)
}
s3Client, err := s3.NewMinio(config.S3Endpoint, config.S3Bucket, config.S3AccessKey, config.S3SecretKey, config.S3SSL)
if err != nil {
panic(err)
}
client := client.NewClient(db, s3Client)
err = web.StartWebserver(config.Address, *client)
if err != nil {
panic(err)
}
}