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

Side by Side Diff: client/internal/logdog/butler/bundler/bundler.go

Issue 1910923002: LogDog: Add project namespace to service endpoint. (Closed) Base URL: https://github.com/luci/luci-go@logdog-project-coordinator-backend
Patch Set: Comments. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package bundler 5 package bundler
6 6
7 import ( 7 import (
8 "container/heap" 8 "container/heap"
9 "fmt" 9 "fmt"
10 "sync" 10 "sync"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 }, 112 },
113 } 113 }
114 114
115 err := error(nil) 115 err := error(nil)
116 c.parser, err = newParser(&p, &b.prefixCounter) 116 c.parser, err = newParser(&p, &b.prefixCounter)
117 if err != nil { 117 if err != nil {
118 return nil, fmt.Errorf("failed to create stream parser: %s", err ) 118 return nil, fmt.Errorf("failed to create stream parser: %s", err )
119 } 119 }
120 120
121 // Generate a secret for this Stream instance. 121 // Generate a secret for this Stream instance.
122 » c.template.Secret, err = types.NewStreamSecret() 122 » c.template.Secret, err = types.NewPrefixSecret()
123 if err != nil { 123 if err != nil {
124 return nil, fmt.Errorf("failed to generate stream secret: %s", e rr) 124 return nil, fmt.Errorf("failed to generate stream secret: %s", e rr)
125 } 125 }
126 126
127 b.streamsLock.Lock() 127 b.streamsLock.Lock()
128 defer b.streamsLock.Unlock() 128 defer b.streamsLock.Unlock()
129 129
130 // Ensure that this is not a duplicate stream name. 130 // Ensure that this is not a duplicate stream name.
131 if s := b.streams[p.Name]; s != nil { 131 if s := b.streams[p.Name]; s != nil {
132 return nil, fmt.Errorf("a Stream is already registered for %q", p.Name) 132 return nil, fmt.Errorf("a Stream is already registered for %q", p.Name)
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 490
491 func (s *streamState) Push(x interface{}) { 491 func (s *streamState) Push(x interface{}) {
492 s.streams = append(s.streams, x.(bundlerStream)) 492 s.streams = append(s.streams, x.(bundlerStream))
493 } 493 }
494 494
495 func (s *streamState) Pop() interface{} { 495 func (s *streamState) Pop() interface{} {
496 last := s.streams[len(s.streams)-1] 496 last := s.streams[len(s.streams)-1]
497 s.streams = s.streams[:len(s.streams)-1] 497 s.streams = s.streams[:len(s.streams)-1]
498 return last 498 return last
499 } 499 }
OLDNEW
« no previous file with comments | « appengine/logdog/coordinator/logStream_test.go ('k') | common/api/logdog_coordinator/services/v1/pb.discovery.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698