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
e343ccc7
Commit
e343ccc7
authored
1 year ago
by
Danis Kirasirov
Committed by
Pavel Antonov
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Доработки нового Setup
parent
fc59dbf3
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
pkg/setup/collection.go
+2
-0
2 additions, 0 deletions
pkg/setup/collection.go
pkg/setup/config.go
+1
-1
1 addition, 1 deletion
pkg/setup/config.go
pkg/setup/entity.go
+3
-3
3 additions, 3 deletions
pkg/setup/entity.go
with
6 additions
and
4 deletions
pkg/setup/collection.go
+
2
−
0
View file @
e343ccc7
...
@@ -141,6 +141,8 @@ func (s *Setup) InstallCollection(ctx context.Context, c *Collection) (updateSch
...
@@ -141,6 +141,8 @@ func (s *Setup) InstallCollection(ctx context.Context, c *Collection) (updateSch
// TODO: Проверить, что коллекция изменилась
// TODO: Проверить, что коллекция изменилась
// TODO: Тест на сравнение схем
// TODO: Тест на сравнение схем
// Замена возможного алиаса окружения на реального ID окружения перед сравнением
collection
.
EnvID
=
exist
.
EnvID
if
!
exist
.
Equal
(
collection
)
{
if
!
exist
.
Equal
(
collection
)
{
if
err
=
s
.
content
.
Collections
.
Update
(
ctx
,
collection
);
err
!=
nil
{
if
err
=
s
.
content
.
Collections
.
Update
(
ctx
,
collection
);
err
!=
nil
{
return
false
,
err
return
false
,
err
...
...
This diff is collapsed.
Click to expand it.
pkg/setup/config.go
+
1
−
1
View file @
e343ccc7
...
@@ -45,7 +45,7 @@ func (cfg *Config) Load(fsys fs.FS) (*Config, error) {
...
@@ -45,7 +45,7 @@ func (cfg *Config) Load(fsys fs.FS) (*Config, error) {
}
}
if
subFS
,
err
:=
fs
.
Sub
(
fsys
,
"items"
);
err
==
nil
{
if
subFS
,
err
:=
fs
.
Sub
(
fsys
,
"items"
);
err
==
nil
{
if
err
=
cfg
.
Items
.
Load
(
subFS
);
err
!=
nil
&&
!
errors
.
Is
(
err
,
fs
.
ErrNotExist
)
{
if
err
=
cfg
.
Items
.
Load
(
subFS
,
DecodeItem
()
);
err
!=
nil
&&
!
errors
.
Is
(
err
,
fs
.
ErrNotExist
)
{
return
nil
,
err
return
nil
,
err
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
pkg/setup/entity.go
+
3
−
3
View file @
e343ccc7
...
@@ -90,14 +90,14 @@ func (l *EntityList[C, T]) AddMany(t []T, opt ...EntityOption[C, T]) {
...
@@ -90,14 +90,14 @@ func (l *EntityList[C, T]) AddMany(t []T, opt ...EntityOption[C, T]) {
}
}
// Filter возвращает список сущностей, удовлетворяющих фильтру
// Filter возвращает список сущностей, удовлетворяющих фильтру
func
(
l
*
EntityList
[
C
,
T
])
Filter
(
filter
FilterFunc
[
T
])
[]
*
Entity
[
C
,
T
]
{
func
(
l
*
EntityList
[
C
,
T
])
Filter
(
filter
FilterFunc
[
T
])
*
Entity
List
[
C
,
T
]
{
var
res
[]
*
Entity
[
C
,
T
]
res
:=
make
(
Entity
List
[
C
,
T
]
,
0
)
for
_
,
e
:=
range
*
l
{
for
_
,
e
:=
range
*
l
{
if
filter
(
e
.
value
)
{
if
filter
(
e
.
value
)
{
res
=
append
(
res
,
e
)
res
=
append
(
res
,
e
)
}
}
}
}
return
res
return
&
res
}
}
// Get возвращает конфигурацию по ID
// Get возвращает конфигурацию по 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