Skip to content
Permalink
Browse files
fix(pubsub): Remove NewMessage and NewPublishResult (#3232)
Rolls back functions that we have decided not to expose to users.
  • Loading branch information
tmdiep committed Nov 19, 2020
1 parent 42d2ef0 commit a781a3ad0c626fc0a7aff0ce33b1ef0830ee2259
Showing with 0 additions and 13 deletions.
  1. +0 −6 pubsub/message.go
  2. +0 −7 pubsub/topic.go
@@ -61,12 +61,6 @@ type Message struct {
ackh ackHandler
}

// NewMessage creates a message with a custom ack/nack handler, which should not
// be nil.
func NewMessage(ackh ackHandler) *Message {
return &Message{ackh: ackh}
}

func toMessage(resp *pb.ReceivedMessage) (*Message, error) {
if resp.Message == nil {
return &Message{ackh: &psAckHandler{ackID: resp.AckId}}, nil
@@ -470,13 +470,6 @@ type PublishResult struct {
err error
}

// NewPublishResult returns the set() function to enable callers from outside
// this package to store and call it (e.g. unit tests).
func NewPublishResult() (*PublishResult, func(string, error)) {
result := &PublishResult{ready: make(chan struct{})}
return result, result.set
}

// Ready returns a channel that is closed when the result is ready.
// When the Ready channel is closed, Get is guaranteed not to block.
func (r *PublishResult) Ready() <-chan struct{} { return r.ready }

0 comments on commit a781a3a

Please sign in to comment.