forked from railwayapp/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproject.go
More file actions
42 lines (33 loc) · 1.76 KB
/
Copy pathproject.go
File metadata and controls
42 lines (33 loc) · 1.76 KB
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
36
37
38
39
40
41
42
package controller
import (
"context"
"github.com/railwayapp/cli/entity"
)
// GetProject returns a project of id projectId, error otherwise
func (c *Controller) GetProject(ctx context.Context, projectId string) (*entity.Project, error) {
return c.gtwy.GetProject(ctx, projectId)
}
// CreateProject creates a project specified by the project request, error otherwise
func (c *Controller) CreateProject(ctx context.Context, req *entity.CreateProjectRequest) (*entity.Project, error) {
return c.gtwy.CreateProject(ctx, req)
}
// CreateProjectFromTemplate creates a project from template specified by the project request, error otherwise
func (c *Controller) CreateProjectFromTemplate(ctx context.Context, req *entity.CreateProjectFromTemplateRequest) (*entity.CreateProjectFromTemplateResult, error) {
return c.gtwy.CreateProjectFromTemplate(ctx, req)
}
// UpdateProject updates a project specified by the project request, error otherwise
func (c *Controller) UpdateProject(ctx context.Context, req *entity.UpdateProjectRequest) (*entity.Project, error) {
return c.gtwy.UpdateProject(ctx, req)
}
// GetProjects returns all projects associated with the user, error otherwise
func (c *Controller) GetProjects(ctx context.Context) ([]*entity.Project, error) {
return c.gtwy.GetProjects(ctx)
}
// OpenProjectInBrowser opens the provided projectId in the browser
func (c *Controller) OpenProjectInBrowser(ctx context.Context, projectID string, environmentID string) error {
return c.gtwy.OpenProjectInBrowser(projectID, environmentID)
}
// OpenProjectDeploymentsInBrowser opens the provided projectId's depolyments in the browser
func (c *Controller) OpenProjectDeploymentsInBrowser(ctx context.Context, projectID string) error {
return c.gtwy.OpenProjectDeploymentsInBrowser(projectID)
}