| OLD | NEW |
| 1 // Copyright 2015 The LUCI Authors. All rights reserved. | 1 // Copyright 2015 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. | 3 // that can be 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 "time" | 10 "time" |
| 11 | 11 |
| 12 "github.com/golang/protobuf/proto" | |
| 13 ds "github.com/luci/gae/service/datastore" | |
| 14 "github.com/luci/luci-go/common/clock" | 12 "github.com/luci/luci-go/common/clock" |
| 15 "github.com/luci/luci-go/common/proto/google" | 13 "github.com/luci/luci-go/common/proto/google" |
| 16 "github.com/luci/luci-go/logdog/api/logpb" | 14 "github.com/luci/luci-go/logdog/api/logpb" |
| 17 "github.com/luci/luci-go/logdog/appengine/coordinator" | 15 "github.com/luci/luci-go/logdog/appengine/coordinator" |
| 18 "github.com/luci/luci-go/logdog/common/types" | 16 "github.com/luci/luci-go/logdog/common/types" |
| 19 "github.com/luci/luci-go/luci_config/common/cfgtypes" | 17 "github.com/luci/luci-go/luci_config/common/cfgtypes" |
| 18 |
| 19 ds "github.com/luci/gae/service/datastore" |
| 20 |
| 21 "github.com/golang/protobuf/proto" |
| 20 "golang.org/x/net/context" | 22 "golang.org/x/net/context" |
| 21 ) | 23 ) |
| 22 | 24 |
| 23 // TestSecret returns a testing types.StreamPrefix. | 25 // TestSecret returns a testing types.StreamPrefix. |
| 24 func TestSecret() types.PrefixSecret { | 26 func TestSecret() types.PrefixSecret { |
| 25 return types.PrefixSecret(bytes.Repeat([]byte{0x6F}, types.PrefixSecretL
ength)) | 27 return types.PrefixSecret(bytes.Repeat([]byte{0x6F}, types.PrefixSecretL
ength)) |
| 26 } | 28 } |
| 27 | 29 |
| 28 // TestStream returns a testing stream. | 30 // TestStream returns a testing stream. |
| 29 type TestStream struct { | 31 type TestStream struct { |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 } | 170 } |
| 169 } | 171 } |
| 170 return &le | 172 return &le |
| 171 } | 173 } |
| 172 | 174 |
| 173 // WithProjectNamespace runs f in proj's namespace, bypassing authentication | 175 // WithProjectNamespace runs f in proj's namespace, bypassing authentication |
| 174 // checks. | 176 // checks. |
| 175 func (ts *TestStream) WithProjectNamespace(c context.Context, f func(context.Con
text)) { | 177 func (ts *TestStream) WithProjectNamespace(c context.Context, f func(context.Con
text)) { |
| 176 WithProjectNamespace(c, ts.Project, f) | 178 WithProjectNamespace(c, ts.Project, f) |
| 177 } | 179 } |
| OLD | NEW |