You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
768 B
30 lines
768 B
package storageDBs
|
|
|
|
import (
|
|
"gitea.anxinyun.cn/container/common_models"
|
|
"gitea.anxinyun.cn/container/common_utils/configLoad"
|
|
"log"
|
|
)
|
|
|
|
type IStorageConsumer interface {
|
|
SaveRaw(d []common_models.EsRaw)
|
|
SaveTheme(d []common_models.EsTheme)
|
|
SaveVib(d []common_models.EsVbRaw)
|
|
SaveGroupTheme(d []common_models.EsGroupTheme)
|
|
}
|
|
|
|
func LoadIStorageConsumer() []IStorageConsumer {
|
|
var consumers []IStorageConsumer
|
|
if configLoad.LoadConfig().GetBool("es.enable") {
|
|
consumers = append(consumers, NewStorage2Es6ByDefaultConfig())
|
|
} else {
|
|
log.Printf("es 不启用")
|
|
}
|
|
|
|
if configLoad.LoadConfig().GetBool("influxDB.enable") {
|
|
consumers = append(consumers, NewStorage2InfluxDB2ByDefaultConfig())
|
|
} else {
|
|
log.Printf("Influx 不启用")
|
|
}
|
|
return consumers
|
|
}
|
|
|