mirror of https://github.com/rocboss/paopao-ce
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.
29 lines
653 B
29 lines
653 B
package dao
|
|
|
|
import (
|
|
"github.com/rocboss/paopao-ce/internal/conf"
|
|
"github.com/rocboss/paopao-ce/internal/core"
|
|
"github.com/rocboss/paopao-ce/pkg/zinc"
|
|
"github.com/sirupsen/logrus"
|
|
)
|
|
|
|
var (
|
|
_ core.TweetSearchService = (*zincTweetSearchServant)(nil)
|
|
)
|
|
|
|
type zincTweetSearchServant struct {
|
|
indexName string
|
|
client *zinc.ZincClient
|
|
}
|
|
|
|
func NewTweetSearchService() (ts core.TweetSearchService) {
|
|
if conf.CfgIf("Zinc") {
|
|
ts = newZincTweetSearchServant()
|
|
} else {
|
|
// default use Zinc as tweet search service
|
|
ts = newZincTweetSearchServant()
|
|
}
|
|
logrus.Infof("use %s as tweet search serice by version %s", ts.Name(), ts.Version())
|
|
return
|
|
}
|