-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtypes.go
More file actions
51 lines (41 loc) · 1.39 KB
/
types.go
File metadata and controls
51 lines (41 loc) · 1.39 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
43
44
45
46
47
48
49
50
51
// Copyright (c) Codesphere Inc.
// SPDX-License-Identifier: Apache-2.0
package api
import (
openapi "github.com/codesphere-cloud/cs-go/api/openapi_client"
"time"
)
type DataCenter = openapi.MetadataGetDatacenters200ResponseInner
type Team = openapi.TeamsListTeams200ResponseInner
type Domain = openapi.DomainsGetDomain200Response
type DomainVerificationStatus = openapi.DomainsGetDomain200ResponseDomainVerificationStatus
type UpdateDomainArgs = openapi.DomainsGetDomain200ResponseCustomConfig
type PathToWorkspaces = map[string][]*Workspace
type Workspace = openapi.WorkspacesGetWorkspace200Response
type WorkspaceStatus = openapi.WorkspacesGetWorkspaceStatus200Response
type CreateWorkspaceArgs = openapi.WorkspacesCreateWorkspaceRequest
type WorkspacePlan = openapi.MetadataGetWorkspacePlans200ResponseInner
// TODO: remove the conversion once the api is fixed
func ConvertToTeam(t *openapi.TeamsGetTeam200Response) *Team {
return &Team{
Id: t.Id,
DefaultDataCenterId: t.DefaultDataCenterId,
Name: t.Name,
Description: t.Description,
AvatarId: t.AvatarId,
AvatarUrl: t.AvatarUrl,
IsFirst: t.IsFirst,
Role: 0,
}
}
type Time interface {
Sleep(time.Duration)
Now() time.Time
}
type RealTime struct{}
func (r *RealTime) Now() time.Time {
return time.Now()
}
func (r *RealTime) Sleep(t time.Duration) {
time.Sleep(t)
}