本文整理汇总了TypeScript中container-ts.Container.add方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Container.add方法的具体用法?TypeScript Container.add怎么用?TypeScript Container.add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类container-ts.Container
的用法示例。
在下文中一共展示了Container.add方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: setupRepositories
private setupRepositories(db) {
this.container.add(new repository.MongoDBRepository<model.UserCredentialsSchema>('user_credentials', db), 'userCredentialsRepository');
this.container.add(new repository.MongoDBRepository<model.RepositorySchema>('repositories', db), 'repositoriesRepository');
this.container.add(new repository.MongoDBRepository<model.BuildSchema>('builds', db), 'queuedBuildsRepository');
this.container.add(new repository.MongoDBRepository<model.DependencyGraphSchema>('dependency_graphs', db), 'dependencyGraphsRepository');
this.container.add(new repository.MongoDBRepository<model.PipelineSchema>('pipelines', db), 'pipelinesRepository');
}
示例2: init
init(db) {
this.container = ContainerBuilder.create();
this.setupRepositories(db);
this.setupRestServices();
if(this.args.mockGit) {
this.container.add(new auth.MockAuthenticationService(), 'authenticationService');
this.container.add(new github.GitServiceFactoryMock(), 'gitServiceFactory');
} else {
this.container.add(new auth.GithubAuthenticationService(), 'authenticationService');
this.container.add(new github.GithubServiceFactory(), 'gitServiceFactory');
}
this.container.add(new PersistedBuildQueue(), 'buildQueue');
this.container.add(new BuildRequestController(), 'buildRequestController');
this.container.add(new PipelineController(), 'pipelineController');
this.container.add(new BuildResultController(), 'buildResultController');
this.container.add(new api.ExpressServer(), 'expressServer');
this.container.init();
}
示例3: setupRestServices
private setupRestServices() {
this.container.add(new api.ExpressServer(), 'expressServer');
this.container.add(new Repositories(), 'rest.Repositories');
this.container.add(new Ping(), 'rest.Ping');
this.container.add(new Builds(), 'rest.Builds');
this.container.add(new DependencyGraphs(), 'rest.DependencyGraphs');
this.container.add(new Pipelines(), 'rest.Pipelines');
this.container.add(new BuildRequests(), 'rest.BuildRequests');
}