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
82c89c7c
Commit
82c89c7c
authored
Sep 23, 2020
by
张雷雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增根据用户token获取client,设置endpoint
parent
9f93d8bb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
gitlab.go
gitlab.go
+9
-0
No files found.
gitlab.go
View file @
82c89c7c
...
...
@@ -389,6 +389,15 @@ func NewClient(httpClient *http.Client, token string) *Client {
return
client
}
//zly 新增根据用户token获取client
func
NewClientBySetBaseUrl
(
httpClient
*
http
.
Client
,
token
string
,
endPoint
string
)
*
Client
{
client
:=
newClient
(
httpClient
)
client
.
authType
=
privateToken
client
.
token
=
token
client
.
SetBaseURL
(
endPoint
)
return
client
}
// NewBasicAuthClient returns a new GitLab API client. If a nil httpClient is
// provided, http.DefaultClient will be used. To use API methods which require
// authentication, provide a valid username and password.
...
...
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