| OLD | NEW |
| 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 coordinator | 5 package coordinator |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "errors" | 8 "errors" |
| 9 "fmt" | 9 "fmt" |
| 10 "strings" | 10 "strings" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // Timestamp is the Descriptor's recorded client-side timestamp. | 91 // Timestamp is the Descriptor's recorded client-side timestamp. |
| 92 Timestamp time.Time | 92 Timestamp time.Time |
| 93 | 93 |
| 94 // Tags is a set of arbitrary key/value tags associated with this stream
. Tags | 94 // Tags is a set of arbitrary key/value tags associated with this stream
. Tags |
| 95 // can be queried against. | 95 // can be queried against. |
| 96 // | 96 // |
| 97 // The serialization/deserialization is handled manually in order to ena
ble | 97 // The serialization/deserialization is handled manually in order to ena
ble |
| 98 // key/value queries. | 98 // key/value queries. |
| 99 Tags TagMap `gae:"-"` | 99 Tags TagMap `gae:"-"` |
| 100 | 100 |
| 101 // Source is the set of source strings sent by the Butler. | |
| 102 Source []string | |
| 103 | |
| 104 // extra causes datastore to ignore unrecognized fields and strip them i
n | 101 // extra causes datastore to ignore unrecognized fields and strip them i
n |
| 105 // future writes. | 102 // future writes. |
| 106 extra ds.PropertyMap `gae:"-,extra"` | 103 extra ds.PropertyMap `gae:"-,extra"` |
| 107 | 104 |
| 108 // noDSValidate is a testing parameter to instruct the LogStream not to | 105 // noDSValidate is a testing parameter to instruct the LogStream not to |
| 109 // validate before reading/writing to datastore. It can be controlled by | 106 // validate before reading/writing to datastore. It can be controlled by |
| 110 // calling SetDSValidate(). | 107 // calling SetDSValidate(). |
| 111 noDSValidate bool | 108 noDSValidate bool |
| 112 } | 109 } |
| 113 | 110 |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 // were created before the supplied time. | 459 // were created before the supplied time. |
| 463 func AddOlderFilter(q *ds.Query, t time.Time) *ds.Query { | 460 func AddOlderFilter(q *ds.Query, t time.Time) *ds.Query { |
| 464 return q.Lt("Created", t.UTC()).Order("-Created") | 461 return q.Lt("Created", t.UTC()).Order("-Created") |
| 465 } | 462 } |
| 466 | 463 |
| 467 // AddNewerFilter adds a filter to queries that restricts them to results that | 464 // AddNewerFilter adds a filter to queries that restricts them to results that |
| 468 // were created after the supplied time. | 465 // were created after the supplied time. |
| 469 func AddNewerFilter(q *ds.Query, t time.Time) *ds.Query { | 466 func AddNewerFilter(q *ds.Query, t time.Time) *ds.Query { |
| 470 return q.Gt("Created", t.UTC()).Order("-Created") | 467 return q.Gt("Created", t.UTC()).Order("-Created") |
| 471 } | 468 } |
| OLD | NEW |