Commit 82c89c7c authored by 张雷雨's avatar 张雷雨

新增根据用户token获取client,设置endpoint

parent 9f93d8bb
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment