-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathhost-container-mapping.ts
35 lines (33 loc) · 1.39 KB
/
host-container-mapping.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/**
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
* Licensed under the GNU Affero General Public License (AGPL).
* See License.AGPL.txt in the project root for license information.
*/
import { injectable, interfaces } from "inversify";
import { githubContainerModule } from "../github/github-container-module";
import { gitlabContainerModule } from "../gitlab/gitlab-container-module";
import { genericAuthContainerModule } from "./oauth-container-module";
import { bitbucketContainerModule } from "../bitbucket/bitbucket-container-module";
import { giteaContainerModule } from "../gitea/gitea-container-module";
import { bitbucketServerContainerModule } from "../bitbucket-server/bitbucket-server-container-module";
@injectable()
export class HostContainerMapping {
public get(type: string): interfaces.ContainerModule[] | undefined {
switch (type) {
case "GitHub":
return [githubContainerModule];
case "GitLab":
return [gitlabContainerModule];
case "Gitea":
return [giteaContainerModule];
case "OAuth":
return [genericAuthContainerModule];
case "Bitbucket":
return [bitbucketContainerModule];
case "BitbucketServer":
return [bitbucketServerContainerModule];
default:
return undefined;
}
}
}