feat: driver manage

This commit is contained in:
Noah Hsu
2022-06-07 18:13:55 +08:00
parent 84eb978731
commit 0d93a6aa41
10 changed files with 153 additions and 11 deletions

14
internal/driver/manage.go Normal file
View File

@ -0,0 +1,14 @@
package driver
import (
log "github.com/sirupsen/logrus"
)
type New func() Driver
var driversMap = map[string]New{}
func RegisterDriver(name string, new New) {
log.Infof("register driver: [%s]", name)
driversMap[name] = new
}