From a5479da1e74c0c916657a0ccf092d43a2d20631b Mon Sep 17 00:00:00 2001 From: Alexander Emelin Date: Sun, 30 Aug 2020 10:34:02 +0300 Subject: [PATCH] use int64 type for offset since uint64 is not supported --- events.go | 8 ++++---- subscription.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/events.go b/events.go index f431987..90278da 100644 --- a/events.go +++ b/events.go @@ -72,7 +72,7 @@ type ErrorHandler interface { // ServerPublishEvent has info about received channel Publication. type ServerPublishEvent struct { Channel string - Offset uint64 + Offset int64 Data []byte Info *ClientInfo } @@ -198,7 +198,7 @@ func (p *eventProxy) OnMessage(_ *gocentrifuge.Client, e gocentrifuge.MessageEve func (p *eventProxy) OnServerPublish(_ *gocentrifuge.Client, e gocentrifuge.ServerPublishEvent) { event := &ServerPublishEvent{ Channel: e.Channel, - Offset: e.Offset, + Offset: int64(e.Offset), Data: e.Data, } if e.Info != nil { @@ -350,7 +350,7 @@ type JoinEvent struct { // PublishEvent has info about received channel Publication. type PublishEvent struct { - Offset uint64 + Offset int64 Data []byte Info *ClientInfo } @@ -400,7 +400,7 @@ type subEventProxy struct { func (p *subEventProxy) OnPublish(_ *gocentrifuge.Subscription, e gocentrifuge.PublishEvent) { event := &PublishEvent{ - Offset: e.Offset, + Offset: int64(e.Offset), Data: e.Data, } if e.Info != nil { diff --git a/subscription.go b/subscription.go index 191838c..88e611d 100644 --- a/subscription.go +++ b/subscription.go @@ -6,7 +6,7 @@ import ( // Publication ... type Publication struct { - Offset uint64 + Offset int64 Data []byte Info *ClientInfo } @@ -79,7 +79,7 @@ func (d *HistoryData) ItemAt(i int) *Publication { } } return &Publication{ - Offset: pub.Offset, + Offset: int64(pub.Offset), Data: pub.Data, Info: info, }