feat: driver manage api

This commit is contained in:
Noah Hsu
2022-06-26 20:25:02 +08:00
parent 3349982312
commit b98cd915a4
5 changed files with 44 additions and 0 deletions

View File

@ -51,6 +51,7 @@ func CreateAccount(ctx context.Context, account model.Account) error {
if err != nil {
return errors.WithMessage(err, "failed init account but account is already created")
}
log.Debugf("account %+v is created", accountDriver)
accountsMap.Store(account.VirtualPath, accountDriver)
return nil
}

View File

@ -28,6 +28,14 @@ func GetDriverNew(name string) (New, error) {
return n, nil
}
func GetDriverNames() []string {
var driverNames []string
for k := range driverItemsMap {
driverNames = append(driverNames, k)
}
return driverNames
}
func GetDriverItemsMap() map[string]driver.Items {
return driverItemsMap
}