Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
corteza
corteza-server
Commits
cd48a4b2
Commit
cd48a4b2
authored
4 years ago
by
Tomaž Jerman
Committed by
Denis Arh
4 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Add sys user export to tructured export
parent
8b6aa177
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
+17
-5
compose/encoder/record.go
compose/encoder/record.go
+17
-5
No files found.
compose/encoder/record.go
View file @
cd48a4b2
...
...
@@ -84,7 +84,7 @@ func (enc flatWriter) Record(r *types.Record) (err error) {
return
enc
.
w
.
Write
(
out
)
}
func
(
enc
structuredEncoder
)
Record
(
r
*
types
.
Record
)
error
{
func
(
enc
structuredEncoder
)
Record
(
r
*
types
.
Record
)
(
err
error
)
{
var
(
// Exporter can choose fields so we need this buffer
// to hold just what we need
...
...
@@ -102,13 +102,22 @@ func (enc structuredEncoder) Record(r *types.Record) error {
case
"namespaceID"
:
out
[
f
.
name
]
=
r
.
NamespaceID
case
"ownedBy"
:
out
[
f
.
name
]
=
r
.
OwnedBy
out
[
f
.
name
],
err
=
fmtSysUser
(
r
.
OwnedBy
,
enc
.
u
)
if
err
!=
nil
{
return
err
}
case
"createdBy"
:
out
[
f
.
name
]
=
r
.
CreatedBy
out
[
f
.
name
],
err
=
fmtSysUser
(
r
.
CreatedBy
,
enc
.
u
)
if
err
!=
nil
{
return
err
}
case
"createdAt"
:
out
[
f
.
name
]
=
fmtTime
(
&
r
.
CreatedAt
)
case
"updatedBy"
:
out
[
f
.
name
]
=
r
.
UpdatedBy
out
[
f
.
name
],
err
=
fmtSysUser
(
r
.
UpdatedBy
,
enc
.
u
)
if
err
!=
nil
{
return
err
}
case
"updatedAt"
:
if
r
.
UpdatedAt
==
nil
{
out
[
f
.
name
]
=
nil
...
...
@@ -117,7 +126,10 @@ func (enc structuredEncoder) Record(r *types.Record) error {
}
case
"deletedBy"
:
out
[
f
.
name
]
=
r
.
DeletedBy
out
[
f
.
name
],
err
=
fmtSysUser
(
r
.
DeletedBy
,
enc
.
u
)
if
err
!=
nil
{
return
err
}
case
"deletedAt"
:
if
r
.
DeletedAt
==
nil
{
out
[
f
.
name
]
=
nil
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment