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

Unified Diff: logdog/client/butlerlib/streamproto/properties.go

Issue 2456953003: LogDog: Update client/bootstrap to generate URLs. (Closed)
Patch Set: Winders Created 4 years, 2 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: logdog/client/butlerlib/streamproto/properties.go
diff --git a/logdog/client/butlerlib/streamproto/properties.go b/logdog/client/butlerlib/streamproto/properties.go
index 0debedbad563b4022b94ce8affcf5e2a0efa83e8..0d1e8c0daa401582f8449cbd8dbc34996ef33267 100644
--- a/logdog/client/butlerlib/streamproto/properties.go
+++ b/logdog/client/butlerlib/streamproto/properties.go
@@ -11,6 +11,8 @@ import (
"github.com/luci/luci-go/common/proto/google"
"github.com/luci/luci-go/logdog/api/logpb"
"github.com/luci/luci-go/logdog/common/types"
+
+ "github.com/golang/protobuf/proto"
)
// Properties is the set of properties needed to define a LogDog Butler Stream.
@@ -19,7 +21,7 @@ type Properties struct {
//
// Note that the Prefix value, if filled, will be overridden by the Butler's
// Prefix.
- logpb.LogStreamDescriptor
+ *logpb.LogStreamDescriptor
// Tee is the tee configuration for this stream. If empty, the stream will
// not be tee'd.
@@ -49,6 +51,13 @@ func (p *Properties) Validate() error {
return nil
}
+// Clone returns a fully-independent clone of this Properties object.
+func (p *Properties) Clone() *Properties {
+ clone := *p
+ clone.LogStreamDescriptor = proto.Clone(p.LogStreamDescriptor).(*logpb.LogStreamDescriptor)
+ return &clone
+}
+
// Flags is a flag- and JSON-compatible collapse of Properties. It is used
// for stream negotiation protocol and command-line interfaces.
type Flags struct {
@@ -74,7 +83,7 @@ func (f *Flags) Properties() *Properties {
}
p := &Properties{
- LogStreamDescriptor: logpb.LogStreamDescriptor{
+ LogStreamDescriptor: &logpb.LogStreamDescriptor{
Name: string(f.Name),
ContentType: string(contentType),
StreamType: logpb.StreamType(f.Type),
« no previous file with comments | « logdog/client/butlerlib/streamclient/stream_test.go ('k') | logdog/client/butlerlib/streamproto/properties_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698