| 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 26 matching lines...) Expand all Loading... |
| 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 `gae:",noindex"` | 42 Prefix string `gae:",noindex"` |
| 43 | 43 |
| 44 // Source is the (indexed) set of source strings sent by the prefix regi
strar. | 44 // Source is the (indexed) set of source strings sent by the prefix regi
strar. |
| 45 Source []string | 45 Source []string |
| 46 | 46 |
| 47 // Expiration is the time when this log prefix expires. Stream registrat
ions |
| 48 // for this prefix will fail after this point. |
| 49 Expiration time.Time |
| 50 |
| 47 // Secret is the Butler secret value for this prefix. All streams within | 51 // Secret is the Butler secret value for this prefix. All streams within |
| 48 // the prefix share this secret value. | 52 // the prefix share this secret value. |
| 49 // | 53 // |
| 50 // This value may only be returned to LogDog services; it is not user-vi
sible. | 54 // This value may only be returned to LogDog services; it is not user-vi
sible. |
| 51 Secret []byte `gae:",noindex"` | 55 Secret []byte `gae:",noindex"` |
| 52 | 56 |
| 53 // extra causes datastore to ignore unrecognized fields and strip them i
n | 57 // extra causes datastore to ignore unrecognized fields and strip them i
n |
| 54 // future writes. | 58 // future writes. |
| 55 extra ds.PropertyMap `gae:"-,extra"` | 59 extra ds.PropertyMap `gae:"-,extra"` |
| 56 } | 60 } |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 return fmt.Errorf("invalid prefix: %s", err) | 127 return fmt.Errorf("invalid prefix: %s", err) |
| 124 } | 128 } |
| 125 if err := types.PrefixSecret(p.Secret).Validate(); err != nil { | 129 if err := types.PrefixSecret(p.Secret).Validate(); err != nil { |
| 126 return fmt.Errorf("invalid prefix secret: %s", err) | 130 return fmt.Errorf("invalid prefix secret: %s", err) |
| 127 } | 131 } |
| 128 if p.Created.IsZero() { | 132 if p.Created.IsZero() { |
| 129 return errors.New("created time is not set") | 133 return errors.New("created time is not set") |
| 130 } | 134 } |
| 131 return nil | 135 return nil |
| 132 } | 136 } |
| OLD | NEW |