30 lines
602 B
Go
30 lines
602 B
Go
package serverdeps
|
|
|
|
import (
|
|
"git.front.kjuulh.io/kjuulh/kraken/internal/services/storage"
|
|
"go.uber.org/zap"
|
|
)
|
|
|
|
type ServerDeps struct {
|
|
logger *zap.Logger
|
|
storageConfig *storage.StorageConfig
|
|
}
|
|
|
|
func NewServerDeps(logger *zap.Logger) *ServerDeps {
|
|
deps := &ServerDeps{
|
|
logger: logger.With(zap.String("app", "serverdeps")),
|
|
}
|
|
|
|
if storageCfg, err := storage.NewDefaultStorageConfig(); err != nil {
|
|
panic(err)
|
|
} else {
|
|
deps.storageConfig = storageCfg
|
|
}
|
|
|
|
return deps
|
|
}
|
|
|
|
func (deps *ServerDeps) GetStorageService() *storage.Service {
|
|
return storage.NewService(deps.storageConfig)
|
|
}
|