More porting from rep (#2388)

* More porting from rep

* Address review feedback
This commit is contained in:
Jeff Mitchell
2017-02-16 16:29:30 -05:00
committed by GitHub
parent 98c7bd6c03
commit 8acbdefdf2
29 changed files with 405 additions and 67 deletions

View File

@@ -34,6 +34,8 @@ func Backend(conf *logical.BackendConfig) *backend {
},
Clean: b.ResetDB,
Invalidate: b.invalidate,
}
b.logger = conf.Logger
@@ -126,6 +128,13 @@ func (b *backend) ResetDB() {
b.db = nil
}
func (b *backend) invalidate(key string) {
switch key {
case "config/connection":
b.ResetDB()
}
}
// Lease returns the lease information
func (b *backend) Lease(s logical.Storage) (*configLease, error) {
entry, err := s.Get("config/lease")