Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
perxis-go
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package Registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
perxis
perxis-go
Commits
0c106fc6
Commit
0c106fc6
authored
2 years ago
by
Anton Sattarov
Browse files
Options
Downloads
Patches
Plain Diff
Добавлено определение структуры space
parent
33567314
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
spaces/space.go
+56
-0
56 additions, 0 deletions
spaces/space.go
with
56 additions
and
0 deletions
spaces/space.go
0 → 100644
+
56
−
0
View file @
0c106fc6
package
spaces
type
State
int
const
(
StateUnknown
State
=
iota
StateNew
// Новое пространство, БД еще не инициализирована
StateReady
// Пространство готово к использованию
StatePreparing
// Пространство готовится в использованию
StateMaintenance
// Пространство находится на обслуживании
StateMigration
// Пространство в состоянии выполнения миграций
StateDeleting
// Пространство удаляется, данные будут удалены
StateError
// Произошла ошибка при конфигурации пространства (см. Space.Error)
)
type
Config
struct
{
Features
[]
string
//Deprecated Возможности используемые пространством
}
const
StateInfoEmpty
=
"EMPTY"
type
Space
struct
{
ID
string
`json:"id,omitempty" bson:"_id"`
OrgID
string
`json:"org_id,omitempty" bson:"org_id"`
Name
string
`json:"name,omitempty" bson:"name"`
Description
string
`json:"desc,omitempty" bson:"desc"`
State
State
`json:"state" bson:"state"`
StateInfo
string
`json:"stateInfo,omitempty" bson:"stateInfo,omitempty"`
Config
*
Config
`json:"config" bson:"config"`
}
func
(
s
Space
)
Clone
()
*
Space
{
return
&
s
}
func
(
s
Space
)
Fetch
(
i
interface
{})
interface
{}
{
p
,
_
:=
i
.
(
string
)
switch
p
{
case
"ID"
:
return
s
.
ID
case
"OrgID"
:
return
s
.
OrgID
case
"Name"
:
return
s
.
Name
case
"Description"
:
return
s
.
Description
case
"State"
:
return
s
.
State
case
"Config"
:
return
s
.
Config
default
:
panic
(
"unknown parameter"
)
}
return
nil
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment