Skip to content

Commit

Permalink
- update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
kubemq committed Aug 11, 2019
1 parent cff981f commit 5d32217
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 69 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module github.com/kubemq-io/kubemq-go

require (
github.com/go-resty/resty v1.8.0
github.com/go-resty/resty/v2 v2.0.0
github.com/gogo/protobuf v1.2.0
github.com/google/uuid v1.1.0
github.com/gorilla/websocket v1.4.0
go.opencensus.io v0.21.0
golang.org/x/net v0.0.0-20190311183353-d8887717615a
golang.org/x/net v0.0.0-20190628185345-da137c7871d7
google.golang.org/grpc v1.21.0
)
56 changes: 0 additions & 56 deletions go.sum

This file was deleted.

22 changes: 11 additions & 11 deletions rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/google/uuid"
"github.com/kubemq-io/kubemq-go/pb"

"github.com/go-resty/resty"
"github.com/go-resty/resty/v2"
"github.com/gorilla/websocket"
)

Expand Down Expand Up @@ -140,7 +140,7 @@ func newRestTransport(ctx context.Context, opts *Options) (Transport, *ServerInf
func (rt *restTransport) Ping(ctx context.Context) (*ServerInfo, error) {
resp := &restResponse{}
uri := fmt.Sprintf("%s/ping", rt.restAddress)
_, err := resty.R().SetResult(resp).SetError(resp).Get(uri)
_, err := resty.New().R().SetResult(resp).SetError(resp).Get(uri)
if err != nil {
return nil, err
}
Expand All @@ -163,7 +163,7 @@ func (rt *restTransport) SendEvent(ctx context.Context, event *Event) error {
Tags: event.Tags,
}
uri := fmt.Sprintf("%s/send/event", rt.restAddress)
_, err := resty.R().SetBody(eventPb).SetResult(resp).SetError(resp).Post(uri)
_, err := resty.New().R().SetBody(eventPb).SetResult(resp).SetError(resp).Post(uri)
if err != nil {
return err
}
Expand Down Expand Up @@ -271,7 +271,7 @@ func (rt *restTransport) SendEventStore(ctx context.Context, eventStore *EventSt
Tags: eventStore.Tags,
}
uri := fmt.Sprintf("%s/send/event", rt.restAddress)
_, err := resty.R().SetBody(eventPb).SetResult(resp).SetError(resp).Post(uri)
_, err := resty.New().R().SetBody(eventPb).SetResult(resp).SetError(resp).Post(uri)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -395,7 +395,7 @@ func (rt *restTransport) SendCommand(ctx context.Context, command *Command) (*Co
XXX_sizecache: 0,
}
uri := fmt.Sprintf("%s/send/request", rt.restAddress)
_, err := resty.R().SetBody(request).SetResult(resp).SetError(resp).Post(uri)
_, err := resty.New().R().SetBody(request).SetResult(resp).SetError(resp).Post(uri)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -465,7 +465,7 @@ func (rt *restTransport) SendQuery(ctx context.Context, query *Query) (*QueryRes
Tags: query.Tags,
}
uri := fmt.Sprintf("%s/send/request", rt.restAddress)
_, err := resty.R().SetBody(request).SetResult(resp).SetError(resp).Post(uri)
_, err := resty.New().R().SetBody(request).SetResult(resp).SetError(resp).Post(uri)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -533,7 +533,7 @@ func (rt *restTransport) SendResponse(ctx context.Context, response *Response) e
Tags: response.Tags,
}
uri := fmt.Sprintf("%s/send/response", rt.restAddress)
_, err := resty.R().SetBody(request).SetResult(resp).SetError(resp).Post(uri)
_, err := resty.New().R().SetBody(request).SetResult(resp).SetError(resp).Post(uri)
if err != nil {
return err
}
Expand Down Expand Up @@ -561,7 +561,7 @@ func (rt *restTransport) SendQueueMessage(ctx context.Context, msg *QueueMessage
},
}
uri := fmt.Sprintf("%s/queue/send", rt.restAddress)
_, err := resty.R().SetBody(msgSend).SetResult(resp).SetError(resp).Post(uri)
_, err := resty.New().R().SetBody(msgSend).SetResult(resp).SetError(resp).Post(uri)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -596,7 +596,7 @@ func (rt *restTransport) SendQueueMessages(ctx context.Context, msgs []*QueueMes
})
}
uri := fmt.Sprintf("%s/queue/send_batch", rt.restAddress)
_, err := resty.R().SetBody(br).SetResult(resp).SetError(resp).Post(uri)
_, err := resty.New().R().SetBody(br).SetResult(resp).SetError(resp).Post(uri)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -630,7 +630,7 @@ func (rt *restTransport) ReceiveQueueMessages(ctx context.Context, req *ReceiveQ
IsPeak: req.IsPeak,
}
uri := fmt.Sprintf("%s/queue/receive", rt.restAddress)
_, err := resty.R().SetBody(request).SetResult(resp).SetError(resp).Post(uri)
_, err := resty.New().R().SetBody(request).SetResult(resp).SetError(resp).Post(uri)
if err != nil {
return nil, err
}
Expand All @@ -650,7 +650,7 @@ func (rt *restTransport) AckAllQueueMessages(ctx context.Context, req *AckAllQue
WaitTimeSeconds: req.WaitTimeSeconds,
}
uri := fmt.Sprintf("%s/queue/ack_all", rt.restAddress)
_, err := resty.R().SetBody(request).SetResult(resp).SetError(resp).Post(uri)
_, err := resty.New().R().SetBody(request).SetResult(resp).SetError(resp).Post(uri)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 5d32217

Please sign in to comment.