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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
perxis
perxis-go
Commits
d6fff184
Commit
d6fff184
authored
1 year ago
by
ko_oler
Browse files
Options
Downloads
Patches
Plain Diff
- изменено имя метода IsWriteAvailable на IsReadAvailable
- правки в метод IsSpaceAvailable, IsReadAvailable
parent
9880bdec
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
pkg/spaces/service.go
+10
-13
10 additions, 13 deletions
pkg/spaces/service.go
with
10 additions
and
13 deletions
pkg/spaces/service.go
+
10
−
13
View file @
d6fff184
...
@@ -50,27 +50,24 @@ type Spaces interface {
...
@@ -50,27 +50,24 @@ type Spaces interface {
Move
(
ctx
context
.
Context
,
spaceID
,
orgID
string
)
(
err
error
)
Move
(
ctx
context
.
Context
,
spaceID
,
orgID
string
)
(
err
error
)
}
}
func
IsSpaceAvailable
(
ctx
context
.
Context
,
spcs
Spaces
,
spaceId
string
)
error
{
func
IsSpaceAvailable
(
ctx
context
.
Context
,
svc
Spaces
,
spaceID
string
)
error
{
spc
,
err
:=
spcs
.
Get
(
ctx
,
spaceId
)
sp
,
err
:=
svc
.
Get
(
ctx
,
spaceID
)
if
err
!=
nil
{
if
err
!=
nil
{
return
errors
.
Wrap
(
err
,
"space not available"
)
return
errors
.
Wrap
(
err
,
"space not available"
)
}
}
if
sp
.
State
==
StateReady
||
sp
.
State
==
StateNew
{
if
spc
.
State
!=
StateReady
{
return
errors
.
New
(
"space not available"
)
}
return
nil
return
nil
}
}
return
errors
.
New
(
"space not available"
)
}
func
Is
Write
Available
(
ctx
context
.
Context
,
s
pcs
Spaces
,
spaceID
string
)
error
{
func
Is
Read
Available
(
ctx
context
.
Context
,
s
vc
Spaces
,
spaceID
string
)
error
{
sp
,
err
:=
s
pcs
.
Get
(
ctx
,
spaceID
)
sp
,
err
:=
s
vc
.
Get
(
ctx
,
spaceID
)
if
err
!=
nil
{
if
err
!=
nil
{
return
errors
.
Wrap
(
err
,
"fail to get space"
)
return
errors
.
Wrap
(
err
,
"fail to get space"
)
}
}
if
sp
.
State
==
StateMigration
{
if
sp
.
State
==
StateReady
||
sp
.
State
==
StateNew
||
sp
.
State
==
StateMigration
{
return
errors
.
Errorf
(
"space '%s' is migrating, fail to do operation"
,
sp
.
ID
)
}
return
nil
return
nil
}
}
return
errors
.
Errorf
(
"space '%s' is migrating, fail to do operation"
,
sp
.
ID
)
}
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