Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
image board
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
random asynchronous nightmare distributor
image board
Commits
3525ce0f
Commit
3525ce0f
authored
3 years ago
by
Ophestra
Browse files
Options
Downloads
Patches
Plain Diff
implement image group fetching in client
parent
72e13105
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
client/image.go
+38
-0
38 additions, 0 deletions
client/image.go
with
38 additions
and
0 deletions
client/image.go
+
38
−
0
View file @
3525ce0f
...
...
@@ -48,6 +48,44 @@ func (r *Remote) Image(flake string) (store.Image, error) {
return
image
,
err
}
// ImageGroup returns an entire group of store.Image.
func
(
r
*
Remote
)
ImageGroup
(
flake
string
)
([]
store
.
Image
,
error
)
{
if
image
,
err
:=
r
.
Image
(
flake
);
err
!=
nil
{
return
nil
,
err
}
else
{
var
group
[]
store
.
Image
// Iterate forwards
if
err
=
func
(
image
store
.
Image
)
error
{
group
=
[]
store
.
Image
{
image
}
for
image
.
Child
!=
""
{
if
image
,
err
=
r
.
Image
(
image
.
Child
);
err
!=
nil
{
return
err
}
group
=
append
(
group
,
image
)
}
return
nil
}(
image
);
err
!=
nil
{
return
group
,
err
}
// Iterate backwards
if
err
=
func
(
image
store
.
Image
)
error
{
for
image
.
Parent
!=
""
{
if
image
,
err
=
r
.
Image
(
image
.
Parent
);
err
!=
nil
{
return
err
}
group
=
append
([]
store
.
Image
{
image
},
group
...
)
}
return
nil
}(
image
);
err
!=
nil
{
return
group
,
err
}
return
group
,
nil
}
}
// ImageUpdate updates metadata of store.Image with given snowflake. To persist original value in a field set \000.
func
(
r
*
Remote
)
ImageUpdate
(
flake
,
source
,
parent
,
commentary
,
commentaryTranslation
string
)
error
{
payload
:=
api
.
ImageUpdatePayload
{
...
...
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