github.com/voedger/voedger@v0.0.0-20240520144910-273e84102129/pkg/apps/sys/clusterapp/provide.go (about) 1 /* 2 * Copyright (c) 2024-present unTill Software Development Group B.V. 3 * @author Denis Gribanov 4 */ 5 6 package clusterapp 7 8 import ( 9 "github.com/voedger/voedger/pkg/appparts" 10 "github.com/voedger/voedger/pkg/apps" 11 "github.com/voedger/voedger/pkg/cluster" 12 "github.com/voedger/voedger/pkg/extensionpoints" 13 "github.com/voedger/voedger/pkg/istructs" 14 "github.com/voedger/voedger/pkg/istructsmem" 15 "github.com/voedger/voedger/pkg/parser" 16 "github.com/voedger/voedger/pkg/sys" 17 "github.com/voedger/voedger/pkg/sys/smtp" 18 ) 19 20 func Provide() apps.AppBuilder { 21 return func(apis apps.APIs, cfg *istructsmem.AppConfigType, ep extensionpoints.IExtensionPoint) apps.BuiltInAppDef { 22 clusterAppPackageFS := parser.PackageFS{ 23 Path: ClusterAppFQN, 24 FS: schemaFS, 25 } 26 clusterPackageFS := cluster.Provide(cfg, apis.IAppStructsProvider, apis.TimeFunc) 27 sysPackageFS := sys.Provide(cfg, smtp.Cfg{}, ep, nil, apis.TimeFunc, apis.ITokens, apis.IFederation, apis.IAppStructsProvider, apis.IAppTokensFactory, 28 nil, apis.IAppStorageProvider) 29 return apps.BuiltInAppDef{ 30 AppQName: istructs.AppQName_sys_cluster, 31 Packages: []parser.PackageFS{clusterAppPackageFS, clusterPackageFS, sysPackageFS}, 32 AppDeploymentDescriptor: appparts.AppDeploymentDescriptor{ 33 NumParts: ClusterAppNumPartitions, 34 EnginePoolSize: appparts.PoolSize(int(ClusterAppNumPartitions), 1, int(ClusterAppNumPartitions)), 35 NumAppWorkspaces: ClusterAppNumAppWS, 36 }, 37 } 38 } 39 }