Add a flag to tell plugins to verify the connection was successful

This commit is contained in:
Brian Kassouf
2017-04-10 15:36:59 -07:00
parent 64efc505c8
commit f54c4de98a
6 changed files with 25 additions and 23 deletions

View File

@@ -21,12 +21,11 @@ type DatabaseType interface {
RenewUser(statements Statements, username string, expiration time.Time) error
RevokeUser(statements Statements, username string) error
Initialize(map[string]interface{}) error
Initialize(config map[string]interface{}, verifyConnection bool) error
Close() error
}
// Statements set in role creation and passed into the database type's functions.
// TODO: Add a way of setting defaults here.
type Statements struct {
CreationStatements string `json:"creation_statments" mapstructure:"creation_statements" structs:"creation_statments"`
RevocationStatements string `json:"revocation_statements" mapstructure:"revocation_statements" structs:"revocation_statements"`
@@ -91,6 +90,11 @@ func (DatabasePlugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, e
// ---- RPC Request Args Domain ----
type InitializeRequest struct {
Config map[string]interface{}
VerifyConnection bool
}
type CreateUserRequest struct {
Statements Statements
UsernamePrefix string