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

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: Updated patchset dependency 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
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 9b9c691a021d6b1ba0ebfd88207ea8f52f1f7145..5801aa7b005e5e4d98ffb0c8b69bd80518014b59 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{
« client/cmd/logdog_butler/output_logdog.go ('K') | « client/internal/logdog/butler/butler_test.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698