Files
sxchnge/backend/internal/profile/runtime.go
T

23 lines
717 B
Go

// Package profile selects the locally owned components of the copied BFF.
package profile
import (
"git.sendico.io/tech/sxchnge/bff/edge/product/interface/accountservice"
"git.sendico.io/tech/sxchnge/bff/edge/shared/interface/api"
)
const Accounts = "accounts"
func Runtime() api.RuntimeConfig {
return api.RuntimeConfig{Name: "sxchnge.bff", Bootstrap: bootstrap}
}
func bootstrap(a api.API) (api.RuntimeComponents, error) {
permissions := a.Permissions()
accounts, err := accountservice.NewAccountService(a.Logger(), a.DBFactory(), permissions.Enforcer(), permissions.Manager().Role(), &a.Config().Mw.Password)
if err != nil {
return nil, err
}
return api.RuntimeComponents{Accounts: accounts}, nil
}