Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
go-gitlab
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
go-gitlab
Commits
61b5c254
Commit
61b5c254
authored
Jan 04, 2019
by
Julien Roland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Jobs] Add options struct for DownloadArtifactsFile func which contains the job name
parent
313d3b0c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
jobs.go
jobs.go
+10
-9
No files found.
jobs.go
View file @
61b5c254
...
...
@@ -178,25 +178,26 @@ func (s *JobsService) GetJobArtifacts(pid interface{}, jobID int, options ...Opt
return
artifactsBuf
,
resp
,
err
}
// DownloadArtifactsFileOptions represents the available DownloadArtifactsFile() options.
//
// GitLab API docs: https://docs.gitlab.com/ce/api/jobs.html#download-the-artifacts-file
type
DownloadArtifactsFileOptions
struct
{
Job
*
string
`url:"job,omitempty" json:"job,omitempty"`
}
// DownloadArtifactsFile download the artifacts file from the given
// reference name and job provided the job finished successfully.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/jobs.html#download-the-artifacts-file
func
(
s
*
JobsService
)
DownloadArtifactsFile
(
pid
interface
{},
refName
string
,
job
string
,
options
...
OptionFunc
)
(
io
.
Reader
,
*
Response
,
error
)
{
// GitLab API docs: https://docs.gitlab.com/ce/api/jobs.html#download-the-artifacts-file
func
(
s
*
JobsService
)
DownloadArtifactsFile
(
pid
interface
{},
refName
string
,
opt
*
DownloadArtifactsFileOptions
,
options
...
OptionFunc
)
(
io
.
Reader
,
*
Response
,
error
)
{
project
,
err
:=
parseID
(
pid
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
var
q
struct
{
Job
string
`url:"job,omitempty" json:"job,omitempty"`
}
q
.
Job
=
job
u
:=
fmt
.
Sprintf
(
"projects/%s/jobs/artifacts/%s/download"
,
url
.
QueryEscape
(
project
),
refName
)
req
,
err
:=
s
.
client
.
NewRequest
(
"GET"
,
u
,
q
,
options
)
req
,
err
:=
s
.
client
.
NewRequest
(
"GET"
,
u
,
opt
,
options
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
...
...
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