Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
K
koko
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
koko
Commits
c66ef25b
Commit
c66ef25b
authored
Apr 24, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Plain Diff
[Update] Merge master to local master (conflict: pkg/sdk/client.go)
parents
834a0e68
22805668
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
4 deletions
+44
-4
client.go
pkg/sdk/client.go
+44
-4
No files found.
pkg/sdk/client.go
View file @
c66ef25b
...
@@ -13,9 +13,10 @@ type ClientAuth interface {
...
@@ -13,9 +13,10 @@ type ClientAuth interface {
}
}
type
WrapperClient
struct
{
type
WrapperClient
struct
{
Http
*
common
.
Client
Http
*
common
.
Client
Auth
ClientAuth
AuthClient
*
common
.
Client
BaseHost
string
Auth
ClientAuth
BaseHost
string
}
}
func
(
c
*
WrapperClient
)
LoadAuth
()
error
{
func
(
c
*
WrapperClient
)
LoadAuth
()
error
{
...
@@ -42,16 +43,24 @@ func (c *WrapperClient) CheckAuth() error {
...
@@ -42,16 +43,24 @@ func (c *WrapperClient) CheckAuth() error {
}
}
func
(
c
*
WrapperClient
)
Get
(
url
string
,
res
interface
{},
needAuth
bool
)
error
{
func
(
c
*
WrapperClient
)
Get
(
url
string
,
res
interface
{},
needAuth
bool
)
error
{
<<<<<<<
HEAD
//if needAuth {
//if needAuth {
// c.Http.SetAuth(c.Auth.Sign())
// c.Http.SetAuth(c.Auth.Sign())
//} else {
//} else {
// c.Http.SetAuth("")
// c.Http.SetAuth("")
//}
//}
=======
if
needAuth
{
return
c
.
AuthClient
.
Get
(
c
.
BaseHost
+
url
,
res
)
}
else
{
return
c
.
Http
.
Get
(
c
.
BaseHost
+
url
,
res
)
}
>>>>>>>
228056688660034
ec5b8061e99c187aa0b1c85e7
return
c
.
Http
.
Get
(
c
.
BaseHost
+
url
,
res
)
}
}
func
(
c
*
WrapperClient
)
Post
(
url
string
,
data
interface
{},
res
interface
{},
needAuth
bool
)
error
{
func
(
c
*
WrapperClient
)
Post
(
url
string
,
data
interface
{},
res
interface
{},
needAuth
bool
)
error
{
<<<<<<<
HEAD
//if needAuth {
//if needAuth {
// c.Http.SetAuth(c.Auth.Sign())
// c.Http.SetAuth(c.Auth.Sign())
//} else {
//} else {
...
@@ -85,4 +94,35 @@ func (c *WrapperClient) Patch(url string, data interface{}, res interface{}, nee
...
@@ -85,4 +94,35 @@ func (c *WrapperClient) Patch(url string, data interface{}, res interface{}, nee
// c.Http.SetAuth("")
// c.Http.SetAuth("")
//}
//}
return
c
.
Http
.
Patch
(
url
,
data
,
res
)
return
c
.
Http
.
Patch
(
url
,
data
,
res
)
=======
if
needAuth
{
return
c
.
AuthClient
.
Post
(
url
,
data
,
res
)
}
else
{
return
c
.
Http
.
Post
(
url
,
data
,
res
)
}
}
func
(
c
*
WrapperClient
)
Delete
(
url
string
,
res
interface
{},
needAuth
bool
)
error
{
if
needAuth
{
return
c
.
AuthClient
.
Delete
(
url
,
res
)
}
else
{
return
c
.
Http
.
Delete
(
url
,
res
)
}
}
func
(
c
*
WrapperClient
)
Put
(
url
string
,
data
interface
{},
res
interface
{},
needAuth
bool
)
error
{
if
needAuth
{
return
c
.
AuthClient
.
Put
(
url
,
data
,
res
)
}
else
{
return
c
.
Http
.
Put
(
url
,
data
,
res
)
}
}
func
(
c
*
WrapperClient
)
Patch
(
url
string
,
data
interface
{},
res
interface
{},
needAuth
bool
)
error
{
if
needAuth
{
return
c
.
AuthClient
.
Patch
(
url
,
data
,
res
)
}
else
{
return
c
.
Http
.
Patch
(
url
,
data
,
res
)
}
>>>>>>>
228056688660034
ec5b8061e99c187aa0b1c85e7
}
}
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