| OLD | NEW |
| 1 // Copyright 2015 The LUCI Authors. All rights reserved. | 1 // Copyright 2015 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
| 4 | 4 |
| 5 package pubsub | 5 package pubsub |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "bytes" | 8 "bytes" |
| 9 "errors" | 9 "errors" |
| 10 "fmt" | 10 "fmt" |
| 11 "sync" | 11 "sync" |
| 12 "time" | 12 "time" |
| 13 | 13 |
| 14 "cloud.google.com/go/pubsub" |
| 14 "github.com/luci/luci-go/common/data/recordio" | 15 "github.com/luci/luci-go/common/data/recordio" |
| 15 gcps "github.com/luci/luci-go/common/gcloud/pubsub" | 16 gcps "github.com/luci/luci-go/common/gcloud/pubsub" |
| 16 log "github.com/luci/luci-go/common/logging" | 17 log "github.com/luci/luci-go/common/logging" |
| 17 "github.com/luci/luci-go/common/retry" | 18 "github.com/luci/luci-go/common/retry" |
| 18 "github.com/luci/luci-go/logdog/api/logpb" | 19 "github.com/luci/luci-go/logdog/api/logpb" |
| 19 "github.com/luci/luci-go/logdog/client/butler/output" | 20 "github.com/luci/luci-go/logdog/client/butler/output" |
| 20 "github.com/luci/luci-go/logdog/client/butlerproto" | 21 "github.com/luci/luci-go/logdog/client/butlerproto" |
| 21 "github.com/luci/luci-go/logdog/common/types" | 22 "github.com/luci/luci-go/logdog/common/types" |
| 22 "golang.org/x/net/context" | 23 "golang.org/x/net/context" |
| 23 "google.golang.org/cloud/pubsub" | |
| 24 ) | 24 ) |
| 25 | 25 |
| 26 // Topic is an interface for a Pub/Sub topic. | 26 // Topic is an interface for a Pub/Sub topic. |
| 27 // | 27 // |
| 28 // pubsub.Topic implements Topic. | 28 // pubsub.Topic implements Topic. |
| 29 type Topic interface { | 29 type Topic interface { |
| 30 // Name returns the name of the topic. | 30 // Name returns the name of the topic. |
| 31 Name() string | 31 Name() string |
| 32 | 32 |
| 33 // Publish mirrors the pubsub.Connection Publish method. | 33 // Publish mirrors the pubsub.Connection Publish method. |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 // indefiniteRetry is a retry.Iterator that will indefinitely retry errors with | 220 // indefiniteRetry is a retry.Iterator that will indefinitely retry errors with |
| 221 // a maximum backoff. | 221 // a maximum backoff. |
| 222 func indefiniteRetry() retry.Iterator { | 222 func indefiniteRetry() retry.Iterator { |
| 223 return &retry.ExponentialBackoff{ | 223 return &retry.ExponentialBackoff{ |
| 224 Limited: retry.Limited{ | 224 Limited: retry.Limited{ |
| 225 Retries: -1, | 225 Retries: -1, |
| 226 }, | 226 }, |
| 227 MaxDelay: 30 * time.Second, | 227 MaxDelay: 30 * time.Second, |
| 228 } | 228 } |
| 229 } | 229 } |
| OLD | NEW |