2017-04-13 20:48:32 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2017-05-03 20:01:05 +00:00
|
|
|
"log"
|
2017-04-13 20:48:32 +00:00
|
|
|
"os"
|
|
|
|
|
|
|
|
"github.com/hashicorp/vault/plugins/database/mssql"
|
2020-10-22 21:43:19 +00:00
|
|
|
dbplugin "github.com/hashicorp/vault/sdk/database/dbplugin/v5"
|
2017-04-13 20:48:32 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2020-10-22 21:43:19 +00:00
|
|
|
err := Run()
|
2017-04-13 20:48:32 +00:00
|
|
|
if err != nil {
|
2017-05-03 20:01:05 +00:00
|
|
|
log.Println(err)
|
2017-04-13 20:48:32 +00:00
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
}
|
2020-10-22 21:43:19 +00:00
|
|
|
|
|
|
|
// Run instantiates a MSSQL object, and runs the RPC server for the plugin
|
|
|
|
func Run() error {
|
|
|
|
dbType, err := mssql.New()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
dbplugin.Serve(dbType.(dbplugin.Database))
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|