Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: common/gcloud/pubsub/pubsub.go

Issue 1838303002: Use native Pub/Sub library primitives. (Closed) Base URL: https://github.com/luci/luci-go@logdog-go1.6
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package pubsub
6
7 import (
8 "google.golang.org/cloud/pubsub"
9 )
10
11 // Message is a Google Pub/Sub API message type. It's included here as a
12 // convenience so users don't have to import the other library in addition to
13 // this one.
14 type Message pubsub.Message
15
16 func localMessageToPubSub(m []*Message) (ms []*pubsub.Message) {
17 if len(m) > 0 {
18 ms = make([]*pubsub.Message, len(m))
19 for i, msg := range m {
20 ms[i] = (*pubsub.Message)(msg)
21 }
22 }
23 return
24 }
25
26 func pubSubMessageToLocal(ms []*pubsub.Message) (m []*Message) {
27 if len(ms) > 0 {
28 m = make([]*Message, len(ms))
29 for i, msg := range ms {
30 m[i] = (*Message)(msg)
31 }
32 }
33 return
34 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698