package server import ( "context" "git.front.kjuulh.io/kjuulh/curre" "git.front.kjuulh.io/kjuulh/kraken/internal/serverdeps" "go.uber.org/zap" ) func NewStorageServer(logger *zap.Logger, deps *serverdeps.ServerDeps) curre.Component { storage := deps.GetStorageService() return curre.NewFunctionalComponent(&curre.FunctionalComponent{ InitFunc: func(fc *curre.FunctionalComponent, ctx context.Context) error { logger.Debug("Initializing storage") return storage.InitializeStorage(ctx) }, StartFunc: func(fc *curre.FunctionalComponent, ctx context.Context) error { return nil }, StopFunc: func(fc *curre.FunctionalComponent, ctx context.Context) error { logger.Debug("Cleaning up storage") return storage.CleanupStorage(ctx) }, }) }