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

Side by Side Diff: appengine/logdog/coordinator/coordinatorTest/logStream.go

Issue 1863973002: LogDog: Update to archival V2. (Closed) Base URL: https://github.com/luci/luci-go@grpcutil-errors
Patch Set: Fix proto comment. Created 4 years, 8 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 coordinatorTest 5 package coordinatorTest
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "fmt" 9 "fmt"
10 10
(...skipping 23 matching lines...) Expand all
34 ls, err := coordinator.NewLogStream(string(desc.Path())) 34 ls, err := coordinator.NewLogStream(string(desc.Path()))
35 if err != nil { 35 if err != nil {
36 panic(err) 36 panic(err)
37 } 37 }
38 if err := ls.LoadDescriptor(desc); err != nil { 38 if err := ls.LoadDescriptor(desc); err != nil {
39 panic(err) 39 panic(err)
40 } 40 }
41 41
42 ls.ProtoVersion = logpb.Version 42 ls.ProtoVersion = logpb.Version
43 ls.Created = ds.RoundTime(clock.Now(c).UTC()) 43 ls.Created = ds.RoundTime(clock.Now(c).UTC())
44 ls.Updated = ds.RoundTime(clock.Now(c).UTC())
45 ls.Secret = bytes.Repeat([]byte{0x6F}, types.StreamSecretLength) 44 ls.Secret = bytes.Repeat([]byte{0x6F}, types.StreamSecretLength)
46 ls.TerminalIndex = -1 45 ls.TerminalIndex = -1
47 return ls 46 return ls
48 } 47 }
49 48
50 // TestLogEntry generates a standard testing text logpb.LogEntry. 49 // TestLogEntry generates a standard testing text logpb.LogEntry.
51 func TestLogEntry(c context.Context, ls *coordinator.LogStream, i int) *logpb.Lo gEntry { 50 func TestLogEntry(c context.Context, ls *coordinator.LogStream, i int) *logpb.Lo gEntry {
52 return &logpb.LogEntry{ 51 return &logpb.LogEntry{
53 TimeOffset: google.NewDuration(clock.Now(c).Sub(ls.Created)), 52 TimeOffset: google.NewDuration(clock.Now(c).Sub(ls.Created)),
54 StreamIndex: uint64(i), 53 StreamIndex: uint64(i),
55 54
56 Content: &logpb.LogEntry_Text{ 55 Content: &logpb.LogEntry_Text{
57 &logpb.Text{ 56 &logpb.Text{
58 Lines: []*logpb.Text_Line{ 57 Lines: []*logpb.Text_Line{
59 { 58 {
60 Value: fmt.Sprintf("log entr y #%d", i), 59 Value: fmt.Sprintf("log entr y #%d", i),
61 Delimiter: "\n", 60 Delimiter: "\n",
62 }, 61 },
63 }, 62 },
64 }, 63 },
65 }, 64 },
66 } 65 }
67 } 66 }
OLDNEW
« no previous file with comments | « appengine/logdog/coordinator/coordinatorTest/config.go ('k') | appengine/logdog/coordinator/coordinatorTest/service.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698