2017-04-05 23:20:31 +00:00
|
|
|
package builtinplugins
|
|
|
|
|
2017-04-06 00:19:29 +00:00
|
|
|
import (
|
|
|
|
"github.com/hashicorp/vault-plugins/database/mysql"
|
|
|
|
"github.com/hashicorp/vault-plugins/database/postgresql"
|
|
|
|
)
|
2017-04-05 23:20:31 +00:00
|
|
|
|
2017-04-07 22:50:03 +00:00
|
|
|
var BuiltinPlugins *builtinPlugins = &builtinPlugins{
|
|
|
|
plugins: map[string]func() error{
|
|
|
|
"mysql-database-plugin": mysql.Run,
|
|
|
|
"postgresql-database-plugin": postgresql.Run,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
// The list of builtin plugins should not be changed by any other package, so we
|
|
|
|
// store them in an unexported variable in this unexported struct.
|
|
|
|
type builtinPlugins struct {
|
|
|
|
plugins map[string]func() error
|
|
|
|
}
|
|
|
|
|
|
|
|
func (b *builtinPlugins) Get(name string) (func() error, bool) {
|
|
|
|
f, ok := b.plugins[name]
|
|
|
|
return f, ok
|
2017-04-05 23:20:31 +00:00
|
|
|
}
|