| 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 "time" | 10 "time" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // stream's Prefix field. | 25 // stream's Prefix field. |
| 26 ID HashID `gae:"$id"` | 26 ID HashID `gae:"$id"` |
| 27 | 27 |
| 28 // Schema is the datastore schema version for this object. This can be u
sed | 28 // Schema is the datastore schema version for this object. This can be u
sed |
| 29 // to facilitate schema migrations. | 29 // to facilitate schema migrations. |
| 30 // | 30 // |
| 31 // The current schema is currentSchemaVersion. | 31 // The current schema is currentSchemaVersion. |
| 32 Schema string | 32 Schema string |
| 33 | 33 |
| 34 // Created is the time when this stream was created. | 34 // Created is the time when this stream was created. |
| 35 » Created time.Time | 35 » Created time.Time `gae:",noindex"` |
| 36 | 36 |
| 37 // Prefix is this log stream's prefix value. Log streams with the same p
refix | 37 // Prefix is this log stream's prefix value. Log streams with the same p
refix |
| 38 // are logically grouped. | 38 // are logically grouped. |
| 39 // | 39 // |
| 40 // This value should not be changed once populated, as it will invalidat
e the | 40 // This value should not be changed once populated, as it will invalidat
e the |
| 41 // HashID. | 41 // HashID. |
| 42 » Prefix string | 42 » Prefix string `gae:",noindex"` |
| 43 |
| 44 » // Source is the (indexed) set of source strings sent by the prefix regi
strar. |
| 45 » Source []string |
| 43 | 46 |
| 44 // Secret is the Butler secret value for this prefix. All streams within | 47 // Secret is the Butler secret value for this prefix. All streams within |
| 45 // the prefix share this secret value. | 48 // the prefix share this secret value. |
| 46 // | 49 // |
| 47 // This value may only be returned to LogDog services; it is not user-vi
sible. | 50 // This value may only be returned to LogDog services; it is not user-vi
sible. |
| 48 Secret []byte `gae:",noindex"` | 51 Secret []byte `gae:",noindex"` |
| 49 | 52 |
| 50 // extra causes datastore to ignore unrecognized fields and strip them i
n | 53 // extra causes datastore to ignore unrecognized fields and strip them i
n |
| 51 // future writes. | 54 // future writes. |
| 52 extra ds.PropertyMap `gae:"-,extra"` | 55 extra ds.PropertyMap `gae:"-,extra"` |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 return fmt.Errorf("invalid prefix: %s", err) | 123 return fmt.Errorf("invalid prefix: %s", err) |
| 121 } | 124 } |
| 122 if err := types.PrefixSecret(p.Secret).Validate(); err != nil { | 125 if err := types.PrefixSecret(p.Secret).Validate(); err != nil { |
| 123 return fmt.Errorf("invalid prefix secret: %s", err) | 126 return fmt.Errorf("invalid prefix secret: %s", err) |
| 124 } | 127 } |
| 125 if p.Created.IsZero() { | 128 if p.Created.IsZero() { |
| 126 return errors.New("created time is not set") | 129 return errors.New("created time is not set") |
| 127 } | 130 } |
| 128 return nil | 131 return nil |
| 129 } | 132 } |
| OLD | NEW |