Merge pull request #1514 from hashicorp/backend-return-objects

Backend() functions should return 'backend' objects.
This commit is contained in:
Vishal Nayak 2016-06-20 19:30:00 -04:00 committed by GitHub
commit 69d562c5db
9 changed files with 18 additions and 18 deletions

View file

@ -12,7 +12,7 @@ func Factory(conf *logical.BackendConfig) (logical.Backend, error) {
return Backend().Setup(conf)
}
func Backend() *framework.Backend {
func Backend() *backend {
var b backend
b.Map = &framework.PolicyMap{
PathMap: framework.PathMap{
@ -37,7 +37,7 @@ func Backend() *framework.Backend {
AuthRenew: b.pathLoginRenew,
}
return b.Backend
return &b
}
type backend struct {

View file

@ -15,7 +15,7 @@ func Factory(conf *logical.BackendConfig) (logical.Backend, error) {
return Backend().Setup(conf)
}
func Backend() *framework.Backend {
func Backend() *backend {
var b backend
b.Backend = &framework.Backend{
Help: backendHelp,
@ -41,7 +41,7 @@ func Backend() *framework.Backend {
AuthRenew: b.pathLoginRenew,
}
return b.Backend
return &b
}
type backend struct {

View file

@ -10,7 +10,7 @@ func Factory(conf *logical.BackendConfig) (logical.Backend, error) {
return Backend().Setup(conf)
}
func Backend() *framework.Backend {
func Backend() *backend {
var b backend
b.Backend = &framework.Backend{
Help: backendHelp,
@ -35,7 +35,7 @@ func Backend() *framework.Backend {
AuthRenew: b.pathLoginRenew,
}
return b.Backend
return &b
}
type backend struct {

View file

@ -12,7 +12,7 @@ func Factory(conf *logical.BackendConfig) (logical.Backend, error) {
return Backend().Setup(conf)
}
func Backend() *framework.Backend {
func Backend() *backend {
var b backend
b.Backend = &framework.Backend{
Help: strings.TrimSpace(backendHelp),
@ -33,7 +33,7 @@ func Backend() *framework.Backend {
WALRollbackMinAge: 5 * time.Minute,
}
return b.Backend
return &b
}
type backend struct {

View file

@ -16,7 +16,7 @@ func Factory(conf *logical.BackendConfig) (logical.Backend, error) {
}
// Backend contains the base information for the backend's functionality
func Backend() *framework.Backend {
func Backend() *backend {
var b backend
b.Backend = &framework.Backend{
Help: strings.TrimSpace(backendHelp),
@ -32,7 +32,7 @@ func Backend() *framework.Backend {
},
}
return b.Backend
return &b
}
type backend struct {

View file

@ -15,7 +15,7 @@ func Factory(conf *logical.BackendConfig) (logical.Backend, error) {
return Backend().Setup(conf)
}
func Backend() *framework.Backend {
func Backend() *backend {
var b backend
b.Backend = &framework.Backend{
Help: strings.TrimSpace(backendHelp),
@ -33,7 +33,7 @@ func Backend() *framework.Backend {
},
}
return b.Backend
return &b
}
type backend struct {

View file

@ -15,7 +15,7 @@ func Factory(conf *logical.BackendConfig) (logical.Backend, error) {
return Backend().Setup(conf)
}
func Backend() *framework.Backend {
func Backend() *backend {
var b backend
b.Backend = &framework.Backend{
Help: strings.TrimSpace(backendHelp),
@ -33,7 +33,7 @@ func Backend() *framework.Backend {
},
}
return b.Backend
return &b
}
type backend struct {

View file

@ -15,7 +15,7 @@ func Factory(conf *logical.BackendConfig) (logical.Backend, error) {
}
// Backend returns a new Backend framework struct
func Backend() *framework.Backend {
func Backend() *backend {
var b backend
b.Backend = &framework.Backend{
Help: strings.TrimSpace(backendHelp),
@ -60,7 +60,7 @@ func Backend() *framework.Backend {
b.crlLifetime = time.Hour * 72
return b.Backend
return &b
}
type backend struct {

View file

@ -14,7 +14,7 @@ func Factory(conf *logical.BackendConfig) (logical.Backend, error) {
return Backend().Setup(conf)
}
func Backend() *framework.Backend {
func Backend() *backend {
var b backend
b.Backend = &framework.Backend{
Help: strings.TrimSpace(backendHelp),
@ -34,7 +34,7 @@ func Backend() *framework.Backend {
Clean: b.ResetDB,
}
return b.Backend
return &b
}
type backend struct {