Skip to content

Commit d3acfff

Browse files
authored
Merge pull request #14 from jonbretman/publish-time
Add PublishTime to Msg type
2 parents 96bf3ea + 82c523d commit d3acfff

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

google/google.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,10 @@ func (g *GoogleCloud) subscribe(opts ps.HandlerOptions, h ps.MsgHandler, ready c
148148

149149
b.Reset()
150150
msg := ps.Msg{
151-
ID: m.ID,
152-
Metadata: m.Attributes,
153-
Data: m.Data,
151+
ID: m.ID,
152+
Metadata: m.Attributes,
153+
Data: m.Data,
154+
PublishTime: &m.PublishTime,
154155
Ack: func() {
155156
m.Ack()
156157
},

pubsub.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package pubsub
44

55
import (
66
"context"
7+
"time"
78
)
89

910
var (
@@ -39,9 +40,10 @@ type Subscriber interface {
3940

4041
// Msg is a lile representation of a pub sub message
4142
type Msg struct {
42-
ID string
43-
Metadata map[string]string
44-
Data []byte
43+
ID string
44+
Metadata map[string]string
45+
Data []byte
46+
PublishTime *time.Time
4547

4648
Ack func()
4749
Nack func()

0 commit comments

Comments
 (0)