| 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 bigtable | 5 package bigtable |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "fmt" | 8 "fmt" |
| 9 "time" | 9 "time" |
| 10 | 10 |
| 11 "cloud.google.com/go/bigtable" |
| 11 "github.com/luci/luci-go/common/data/stringset" | 12 "github.com/luci/luci-go/common/data/stringset" |
| 12 "github.com/luci/luci-go/common/errors" | 13 "github.com/luci/luci-go/common/errors" |
| 13 log "github.com/luci/luci-go/common/logging" | 14 log "github.com/luci/luci-go/common/logging" |
| 14 "github.com/luci/luci-go/common/retry" | 15 "github.com/luci/luci-go/common/retry" |
| 15 "github.com/luci/luci-go/logdog/common/storage" | 16 "github.com/luci/luci-go/logdog/common/storage" |
| 16 "golang.org/x/net/context" | 17 "golang.org/x/net/context" |
| 17 "google.golang.org/cloud/bigtable" | |
| 18 ) | 18 ) |
| 19 | 19 |
| 20 // DefaultMaxLogAge is the maximum age of a log (7 days). | 20 // DefaultMaxLogAge is the maximum age of a log (7 days). |
| 21 const DefaultMaxLogAge = time.Duration(7 * 24 * time.Hour) | 21 const DefaultMaxLogAge = time.Duration(7 * 24 * time.Hour) |
| 22 | 22 |
| 23 // InitializeScopes is the set of OAuth scopes needed to use the Initialize | 23 // InitializeScopes is the set of OAuth scopes needed to use the Initialize |
| 24 // functionality. | 24 // functionality. |
| 25 var InitializeScopes = []string{ | 25 var InitializeScopes = []string{ |
| 26 bigtable.AdminScope, | 26 bigtable.AdminScope, |
| 27 } | 27 } |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 cfg := storage.Config{ | 126 cfg := storage.Config{ |
| 127 MaxLogAge: DefaultMaxLogAge, | 127 MaxLogAge: DefaultMaxLogAge, |
| 128 } | 128 } |
| 129 if err := st.Config(cfg); err != nil { | 129 if err := st.Config(cfg); err != nil { |
| 130 log.WithError(err).Errorf(ctx, "Failed to push default configura
tion.") | 130 log.WithError(err).Errorf(ctx, "Failed to push default configura
tion.") |
| 131 return err | 131 return err |
| 132 } | 132 } |
| 133 | 133 |
| 134 return nil | 134 return nil |
| 135 } | 135 } |
| OLD | NEW |