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
223f3fee
Commit
223f3fee
authored
1 month ago
by
Semyon Krestyaninov
Browse files
Options
Downloads
Patches
Plain Diff
fix
parent
9c938143
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
template/funcs.go
+4
-4
4 additions, 4 deletions
template/funcs.go
with
4 additions
and
4 deletions
template/funcs.go
+
4
−
4
View file @
223f3fee
...
@@ -9,7 +9,7 @@ import (
...
@@ -9,7 +9,7 @@ import (
// getLookup возвращает функцию для шаблонизатора для получения значений из записи коллекции
// getLookup возвращает функцию для шаблонизатора для получения значений из записи коллекции
// name указывается в виде "<collection id>.<item id>.<field>"
// name указывается в виде "<collection id>.<item id>.<field>"
// Использование в шаблонах: {{ lookup "secrets.key.value" }}
// Использование в шаблонах: {{ lookup "secrets.key.value" }}
func
getLookup
[
T
Executor
[
T
]]
(
b
*
Builder
[
T
]
)
any
{
func
getLookup
(
b
*
Builder
)
any
{
return
func
(
name
string
)
(
any
,
error
)
{
return
func
(
name
string
)
(
any
,
error
)
{
parsedName
:=
strings
.
Split
(
name
,
"."
)
parsedName
:=
strings
.
Split
(
name
,
"."
)
if
len
(
parsedName
)
<
3
{
if
len
(
parsedName
)
<
3
{
...
@@ -36,8 +36,8 @@ func getLookup[T Executor[T]](b *Builder[T]) any {
...
@@ -36,8 +36,8 @@ func getLookup[T Executor[T]](b *Builder[T]) any {
// getSys возвращает функцию получения System
// getSys возвращает функцию получения System
// Использование в шаблонах: {{ system.SpaceID }}
// Использование в шаблонах: {{ system.SpaceID }}
func
getSystem
[
T
Executor
[
T
]]
(
b
*
Builder
[
T
]
)
any
{
func
getSystem
(
b
*
Builder
)
any
{
return
func
()
*
System
[
T
]
{
return
func
()
*
System
{
return
&
System
[
T
]
{
builder
:
b
}
return
&
System
{
builder
:
b
}
}
}
}
}
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