Documentation ¶
Index ¶
- Constants
- Variables
- func AddBookMap(key string, bn BookName) bool
- func CloseKafka()
- func CreateIndex(model _interface.EsTabler) error
- func DeleteBookMap(key string)
- func DeleteFromIndex(tabler _interface.EsTabler, recID *int, ctx context.Context) error
- func DeleteIndex(tabler _interface.EsTabler) bool
- func FindBookNameByGorm(db *gorm.DB) (id, name string)deprecated
- func GetBookNameInstance() *bookNameMap
- func GetFromIndex(tabler _interface.EsTabler, query elastic.Query, from, size int) (list []interface{}, count int64, err error)
- func InitBookMap(configs []config.BookConfig) error
- func InitElasticsearch(config cfg.ESConfig) (*elastic.Client, error)
- func InitInflux(config cfg.InfluxConfig) (*influxdb2.Client, error)
- func InitKafka(config cfg.KafkaConfig) (*sarama.Client, error)
- func InitMinio(config config.MinioConfig) (*minio.Client, error)
- func InitMongoClient(config cfg.MongoDBConfig) (*qmgo.Client, error)
- func InitMongoDB(config cfg.MongoDBConfig) (*qmgo.Database, error)
- func InitMysqlGormV2(config config2.MysqlConfig) (*gorm.DB, error)
- func InitRedis(config cfg.RedisConfig) (*redis.Client, error)
- func InitRedisCluster(config cfg.RedisConfig) (*redis.ClusterClient, error)
- func InitSystemStorage(config config.StorageConfig)
- func MysqlPaginateSql(ctx *gin.Context) string
- func MysqlScopePaginate(ctx *gin.Context) func(db *gorm.DB) *gorm.DB
- func Paginate(ctx *gin.Context) (int, int)
- func PushInterfaceToKafka(topic string, data []interface{}) error
- func PutIntoIndex(tabler _interface.EsTabler) error
- func UpdateIntoIndex(tabler _interface.EsTabler, recID *int, ctx context.Context, ...) error
- type BookName
Constants ¶
View Source
const ( PRE_TAG = "<hl>" POST_TAG = "</hl>" )
View Source
const MaxMessageBytes = 4 * 1024 * 1024
Variables ¶
Functions ¶
func AddBookMap ¶
func CloseKafka ¶
func CloseKafka()
func CreateIndex ¶
func CreateIndex(model _interface.EsTabler) error
func DeleteBookMap ¶
func DeleteBookMap(key string)
func DeleteFromIndex ¶
DeleteFromIndex 删除数据
func FindBookNameByGorm
deprecated
func GetBookNameInstance ¶
func GetBookNameInstance() *bookNameMap
func GetFromIndex ¶
func GetFromIndex(tabler _interface.EsTabler, query elastic.Query, from, size int) (list []interface{}, count int64, err error)
GetFromIndex 获取数据, 所有字段均带高亮(指定字段失败)
func InitBookMap ¶
func InitBookMap(configs []config.BookConfig) error
func InitElasticsearch ¶
InitElasticsearch ...
func InitInflux ¶
func InitInflux(config cfg.InfluxConfig) (*influxdb2.Client, error)
func InitMinio ¶
func InitMinio(config config.MinioConfig) (*minio.Client, error)
func InitMongoClient ¶
func InitMongoClient(config cfg.MongoDBConfig) (*qmgo.Client, error)
func InitMongoDB ¶
func InitMongoDB(config cfg.MongoDBConfig) (*qmgo.Database, error)
InitMongoDB ...
func InitMysqlGormV2 ¶
func InitMysqlGormV2(config config2.MysqlConfig) (*gorm.DB, error)
InitMysqlGormV2 GormV2 returns a MySQL DB engine from configs
func InitRedisCluster ¶
func InitRedisCluster(config cfg.RedisConfig) (*redis.ClusterClient, error)
InitRedisCluster 初始化Redis集群的连接
func InitSystemStorage ¶
func InitSystemStorage(config config.StorageConfig)
InitSystemStorage 初始化系统配置
func MysqlScopePaginate ¶
MysqlScopePaginate 分页函数 纯 gorm 时在 scope 里调用
func PushInterfaceToKafka ¶
PushInterfaceToKafka 无限定格式推送kafka
func UpdateIntoIndex ¶
func UpdateIntoIndex(tabler _interface.EsTabler, recID *int, ctx context.Context, script *elastic.Script) error
UpdateIntoIndex 更新内容
Types ¶
Click to show internal directories.
Click to hide internal directories.