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

Unified Diff: client/internal/logdog/butler/output/pubsub/pubsubOutput.go

Issue 1975683002: LogDog: Implement prefix registration in Butler. (Closed) Base URL: https://github.com/luci/luci-go@logdog-butler-register-collector
Patch Set: Rebarse Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/internal/logdog/butler/butler_test.go ('k') | server/internal/logdog/collector/coordinator/cache.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/internal/logdog/butler/output/pubsub/pubsubOutput.go
diff --git a/client/internal/logdog/butler/output/pubsub/pubsubOutput.go b/client/internal/logdog/butler/output/pubsub/pubsubOutput.go
index 3f262c639b2b84b9a922710b8810ece1b1ebdfa1..b45cdf07ae1c9575fd2890951414100d3155c175 100644
--- a/client/internal/logdog/butler/output/pubsub/pubsubOutput.go
+++ b/client/internal/logdog/butler/output/pubsub/pubsubOutput.go
@@ -14,6 +14,7 @@ import (
"github.com/luci/luci-go/client/internal/logdog/butler/output"
gcps "github.com/luci/luci-go/common/gcloud/pubsub"
"github.com/luci/luci-go/common/logdog/butlerproto"
+ "github.com/luci/luci-go/common/logdog/types"
log "github.com/luci/luci-go/common/logging"
"github.com/luci/luci-go/common/proto/logdog/logpb"
"github.com/luci/luci-go/common/recordio"
@@ -40,6 +41,9 @@ type Config struct {
// Topic is the Pub/Sub topic to publish to.
Topic Topic
+ // Secret, if not nil, is the prefix secret to attach to each outgoing bundle.
+ Secret types.PrefixSecret
+
// Compress, if true, enables zlib compression.
Compress bool
@@ -96,6 +100,7 @@ func (o *pubSubOutput) SendBundle(bundle *logpb.ButlerLogBundle) error {
b := o.bufferPool.Get().(*buffer)
defer o.bufferPool.Put(b)
+ bundle.Secret = []byte(o.Secret)
message, err := o.buildMessage(b, bundle)
if err != nil {
log.Fields{
« no previous file with comments | « client/internal/logdog/butler/butler_test.go ('k') | server/internal/logdog/collector/coordinator/cache.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698