This commit is contained in:
zu1k 2021-08-02 12:03:06 +08:00
parent 8cb2d500f1
commit 40274f64a4
2 changed files with 1 additions and 32 deletions

View File

@ -3,11 +3,9 @@ package entity
import (
"sort"
"github.com/zu1k/nali/pkg/dbif"
"github.com/zu1k/nali/internal/db"
"github.com/zu1k/nali/internal/re"
"github.com/zu1k/nali/pkg/dbif"
)
// ParseLine parse a line into entities

View File

@ -1,29 +0,0 @@
package dbif
func init() {
}
type langMap map[string][]DB
type dataTypeMap map[QueryType][]DB
var (
lang2DB = make(langMap)
type2DB = make(dataTypeMap)
)
func RegistLang(lang string, db DB) {
originDBs, found := lang2DB[lang]
if !found {
originDBs = make([]DB, 0, 1)
}
lang2DB[lang] = append(originDBs, db)
}
func RegistType(typ QueryType, db DB) {
originDBs, found := type2DB[typ]
if !found {
originDBs = make([]DB, 0, 1)
}
type2DB[typ] = append(originDBs, db)
}