mirror of
https://github.com/hashicorp/vault.git
synced 2026-05-28 04:10:44 -04:00
Update New() func signature and its references
This commit is contained in:
parent
2faa08dfba
commit
230a36c5a1
2 changed files with 15 additions and 8 deletions
|
|
@ -24,7 +24,7 @@ type Cassandra struct {
|
|||
credsutil.CredentialsProducer
|
||||
}
|
||||
|
||||
func New() *Cassandra {
|
||||
func New() (interface{}, error) {
|
||||
connProducer := &connutil.CassandraConnectionProducer{}
|
||||
connProducer.Type = cassandraTypeName
|
||||
|
||||
|
|
@ -35,14 +35,17 @@ func New() *Cassandra {
|
|||
CredentialsProducer: credsProducer,
|
||||
}
|
||||
|
||||
return dbType
|
||||
return dbType, nil
|
||||
}
|
||||
|
||||
// Run instantiates a MySQL object, and runs the RPC server for the plugin
|
||||
func Run() error {
|
||||
dbType := New()
|
||||
dbType, err := New()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
dbplugin.NewPluginServer(dbType)
|
||||
dbplugin.NewPluginServer(dbType.(*Cassandra))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,7 +80,8 @@ func TestCassandra_Initialize(t *testing.T) {
|
|||
"protocol_version": 4,
|
||||
}
|
||||
|
||||
db := New()
|
||||
dbRaw, _ := New()
|
||||
db := dbRaw.(*Cassandra)
|
||||
connProducer := db.ConnectionProducer.(*connutil.CassandraConnectionProducer)
|
||||
|
||||
err := db.Initialize(connectionDetails, true)
|
||||
|
|
@ -109,7 +110,8 @@ func TestCassandra_CreateUser(t *testing.T) {
|
|||
"protocol_version": 4,
|
||||
}
|
||||
|
||||
db := New()
|
||||
dbRaw, _ := New()
|
||||
db := dbRaw.(*Cassandra)
|
||||
err := db.Initialize(connectionDetails, true)
|
||||
if err != nil {
|
||||
t.Fatalf("err: %s", err)
|
||||
|
|
@ -140,7 +142,8 @@ func TestMyCassandra_RenewUser(t *testing.T) {
|
|||
"protocol_version": 4,
|
||||
}
|
||||
|
||||
db := New()
|
||||
dbRaw, _ := New()
|
||||
db := dbRaw.(*Cassandra)
|
||||
err := db.Initialize(connectionDetails, true)
|
||||
if err != nil {
|
||||
t.Fatalf("err: %s", err)
|
||||
|
|
@ -176,7 +179,8 @@ func TestCassandra_RevokeUser(t *testing.T) {
|
|||
"protocol_version": 4,
|
||||
}
|
||||
|
||||
db := New()
|
||||
dbRaw, _ := New()
|
||||
db := dbRaw.(*Cassandra)
|
||||
err := db.Initialize(connectionDetails, true)
|
||||
if err != nil {
|
||||
t.Fatalf("err: %s", err)
|
||||
|
|
|
|||
Loading…
Reference in a new issue