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
1348750e
Commit
1348750e
authored
2 years ago
by
ko_oler
Browse files
Options
Downloads
Patches
Plain Diff
fix
parent
f2c4ed8f
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
pkg/extension/extension.go
+2
-0
2 additions, 0 deletions
pkg/extension/extension.go
pkg/schema/schema.go
+20
-3
20 additions, 3 deletions
pkg/schema/schema.go
with
22 additions
and
3 deletions
pkg/extension/extension.go
+
2
−
0
View file @
1348750e
...
@@ -21,6 +21,8 @@ const (
...
@@ -21,6 +21,8 @@ const (
StateInstalled
=
pb
.
SpaceExtensions_INSTALLED
StateInstalled
=
pb
.
SpaceExtensions_INSTALLED
StateInProgress
=
pb
.
SpaceExtensions_IN_PROGRESS
StateInProgress
=
pb
.
SpaceExtensions_IN_PROGRESS
StateFail
=
pb
.
SpaceExtensions_FAIL
StateFail
=
pb
.
SpaceExtensions_FAIL
ExtensionMetadataKey
=
"extension"
)
)
type
(
type
(
...
...
This diff is collapsed.
Click to expand it.
pkg/schema/schema.go
+
20
−
3
View file @
1348750e
...
@@ -13,6 +13,7 @@ import (
...
@@ -13,6 +13,7 @@ import (
type
Schema
struct
{
type
Schema
struct
{
field
.
Field
field
.
Field
Loaded
bool
`json:"loaded"`
Loaded
bool
`json:"loaded"`
Metadata
map
[
string
]
string
`json:"metadata"`
}
}
func
New
(
kv
...
interface
{})
*
Schema
{
func
New
(
kv
...
interface
{})
*
Schema
{
...
@@ -35,6 +36,7 @@ func (s *Schema) Clone(reset bool) *Schema {
...
@@ -35,6 +36,7 @@ func (s *Schema) Clone(reset bool) *Schema {
return
&
Schema
{
return
&
Schema
{
Field
:
*
s
.
Field
.
Clone
(
reset
),
Field
:
*
s
.
Field
.
Clone
(
reset
),
Loaded
:
s
.
Loaded
,
Loaded
:
s
.
Loaded
,
Metadata
:
s
.
Metadata
,
}
}
}
}
...
@@ -43,6 +45,21 @@ func (s Schema) WithIncludes(includes ...interface{}) *Schema {
...
@@ -43,6 +45,21 @@ func (s Schema) WithIncludes(includes ...interface{}) *Schema {
return
&
s
return
&
s
}
}
func
(
s
*
Schema
)
WithMetadata
(
kv
...
string
)
*
Schema
{
if
s
.
Metadata
==
nil
{
s
.
Metadata
=
make
(
map
[
string
]
string
,
len
(
s
.
Metadata
))
}
for
i
:=
0
;
i
<
len
(
kv
);
i
+=
2
{
s
.
Metadata
[
kv
[
i
]]
=
kv
[
i
+
1
]
}
return
s
}
func
(
s
Schema
)
SetMetadata
(
md
map
[
string
]
string
)
*
Schema
{
s
.
Metadata
=
md
return
&
s
}
func
(
s
*
Schema
)
Load
(
ctx
context
.
Context
)
error
{
func
(
s
*
Schema
)
Load
(
ctx
context
.
Context
)
error
{
if
s
.
Loaded
{
if
s
.
Loaded
{
return
nil
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