forked from ZupIT/charlescd
/
workspace.go
42 lines (36 loc) · 1.12 KB
/
workspace.go
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 workspace
const (
IstioNetworking = "istio"
GateNetworking = "gate"
)
const (
CircleDeployStrategy = "circle"
CanaryDeployStrategy = "canary"
)
type Workspace struct {
Name string `json:"name" validate:"required"`
Description string `json:"description" validate:"required"`
RoutingStrategy string `json:"routingStrategy" validate:"required,oneof=MATCH CANARY"`
}
type WorkspaceModel struct {
ID string `json:"id"`
CreatedAt string `json:"createdAt"`
Circles int `json:"circles"`
Modules int `json:"modules"`
Workspace
}
type WorkspaceRepository interface {
FindAll() ([]WorkspaceModel, error)
FindById(id string) (WorkspaceModel, error)
Create(workspace Workspace) (WorkspaceModel, error)
Update(id string, workspace Workspace) (WorkspaceModel, error)
Delete(id string) error
}
type WorkspaceUseCase interface {
FindAll() ([]WorkspaceModel, error)
FindById(id string) (WorkspaceModel, error)
Create(workspace Workspace) (WorkspaceModel, error)
Update(id string, workspace Workspace) (WorkspaceModel, error)
Delete(id string) error
GetKebabCaseNameById(id string) (string, error)
}