Documentation ¶
Index ¶
- func InitMapData(fields []string) (item model.MapData, row []interface{})
- func UpdateOffsetByMap(offsets *model.LoopOffset, mapData ...model.MapData)
- type App
- type AppDatabus
- func (a *AppDatabus) AllMessages(c context.Context) (length int, err error)
- func (a *AppDatabus) BulkIndex(c context.Context, start, end int, writeEntityIndex bool) (err error)
- func (a *AppDatabus) Business() string
- func (a *AppDatabus) Commit(c context.Context) (err error)
- func (a *AppDatabus) IncrMessages(c context.Context) (length int, err error)
- func (a *AppDatabus) InitIndex(c context.Context)
- func (a *AppDatabus) InitOffset(c context.Context)
- func (a *AppDatabus) Offset(c context.Context)
- func (a *AppDatabus) SetRecover(c context.Context, recoverID int64, recoverTime string, i int)
- func (a *AppDatabus) Size(c context.Context) int
- func (a *AppDatabus) Sleep(c context.Context)
- type AppMultiple
- func (am *AppMultiple) AllMessages(c context.Context) (length int, err error)
- func (am *AppMultiple) BulkIndex(c context.Context, start int, end int, writeEntityIndex bool) (err error)
- func (am *AppMultiple) Business() string
- func (am *AppMultiple) Commit(c context.Context) (err error)
- func (am *AppMultiple) IncrMessages(c context.Context) (length int, err error)
- func (am *AppMultiple) InitIndex(c context.Context)
- func (am *AppMultiple) InitOffset(c context.Context)
- func (am *AppMultiple) Offset(c context.Context)
- func (am *AppMultiple) SetRecover(c context.Context, recoverID int64, recoverTime string, i int)
- func (am *AppMultiple) Size(c context.Context) (size int)
- func (am *AppMultiple) Sleep(c context.Context)
- type AppMultipleDatabus
- func (amd *AppMultipleDatabus) AllMessages(c context.Context) (length int, err error)
- func (amd *AppMultipleDatabus) BulkIndex(c context.Context, start int, end int, writeEntityIndex bool) (err error)
- func (amd *AppMultipleDatabus) Business() string
- func (amd *AppMultipleDatabus) Commit(c context.Context) (err error)
- func (amd *AppMultipleDatabus) IncrMessages(c context.Context) (length int, err error)
- func (amd *AppMultipleDatabus) IndexNameSuffix(format string, startDate string) (res []string, err error)
- func (amd *AppMultipleDatabus) InitIndex(c context.Context)
- func (amd *AppMultipleDatabus) InitOffset(c context.Context)
- func (amd *AppMultipleDatabus) Offset(c context.Context)
- func (amd *AppMultipleDatabus) SetRecover(c context.Context, recoverID int64, recoverTime string, i int)
- func (amd *AppMultipleDatabus) Size(c context.Context) (size int)
- func (amd *AppMultipleDatabus) Sleep(c context.Context)
- type AppSingle
- func (as *AppSingle) AllMessages(c context.Context) (length int, err error)
- func (as *AppSingle) BulkIndex(c context.Context, start int, end int, writeEntityIndex bool) (err error)
- func (as *AppSingle) Business() string
- func (as *AppSingle) Commit(c context.Context) (err error)
- func (as *AppSingle) IncrMessages(c context.Context) (length int, err error)
- func (as *AppSingle) InitIndex(c context.Context)
- func (as *AppSingle) InitOffset(c context.Context)
- func (as *AppSingle) Offset(c context.Context)
- func (as *AppSingle) SetRecover(c context.Context, recoverID int64, recoverTime string, i int)
- func (as *AppSingle) Size(c context.Context) int
- func (as *AppSingle) Sleep(c context.Context)
- type Dao
- func (d *Dao) BulkDBData(c context.Context, attrs *model.Attrs, writeEntityIndex bool, ...) (err error)
- func (d *Dao) BulkDatabusData(c context.Context, attrs *model.Attrs, writeEntityIndex bool, ...) (err error)
- func (d *Dao) Close()
- func (d *Dao) CommitOffset(c context.Context, offset *model.LoopOffset, appid, tableName string) (err error)
- func (d *Dao) Contain(obj interface{}, target interface{}) bool
- func (d *Dao) ExtraData(c context.Context, mapData []model.MapData, attrs *model.Attrs, way string, ...) (md []model.MapData, err error)
- func (d *Dao) GetAliases(esName, indexAliasPrefix string) (aliases map[string]bool, err error)
- func (d *Dao) GetConfig(c context.Context) *conf.Config
- func (d *Dao) InitIndex(c context.Context, aliases map[string]bool, ...)
- func (d *Dao) InitOffset(c context.Context, offset *model.LoopOffset, attrs *model.Attrs, arr []string)
- func (d *Dao) JSON2map(rowJSON json.RawMessage) (result map[string]interface{}, err error)
- func (d *Dao) Offset(c context.Context, appid, tableName string) (res *model.Offset, err error)
- func (d *Dao) Ping(c context.Context) (err error)
- func (d *Dao) PromError(name string, format string, args ...interface{})
- func (d *Dao) SendSMS(msg string) (err error)
- func (d *Dao) SetRecover(c context.Context, appid string, recoverID int64, recoverTime string, i int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitMapData ¶
InitMapData init each field struct
func UpdateOffsetByMap ¶
func UpdateOffsetByMap(offsets *model.LoopOffset, mapData ...model.MapData)
UpdateOffsetByMap .
Types ¶
type App ¶
type App interface { Business() string InitIndex(c context.Context) InitOffset(c context.Context) Offset(c context.Context) SetRecover(c context.Context, recoverID int64, recoverTime string, i int) IncrMessages(c context.Context) (length int, err error) AllMessages(c context.Context) (length int, err error) BulkIndex(c context.Context, start, end int, writeEntityIndex bool) (err error) Commit(c context.Context) (err error) Sleep(c context.Context) Size(c context.Context) (size int) }
App .
type AppDatabus ¶
type AppDatabus struct {
// contains filtered or unexported fields
}
AppDatabus single table consume databus.
func (*AppDatabus) AllMessages ¶
func (a *AppDatabus) AllMessages(c context.Context) (length int, err error)
AllMessages .
func (*AppDatabus) BulkIndex ¶
func (a *AppDatabus) BulkIndex(c context.Context, start, end int, writeEntityIndex bool) (err error)
BulkIndex .
func (*AppDatabus) Commit ¶
func (a *AppDatabus) Commit(c context.Context) (err error)
Commit commit offset.
func (*AppDatabus) IncrMessages ¶
func (a *AppDatabus) IncrMessages(c context.Context) (length int, err error)
IncrMessages .
func (*AppDatabus) InitIndex ¶
func (a *AppDatabus) InitIndex(c context.Context)
InitIndex init index.
func (*AppDatabus) InitOffset ¶
func (a *AppDatabus) InitOffset(c context.Context)
InitOffset insert init value to offset.
func (*AppDatabus) SetRecover ¶
SetRecover set recover
type AppMultiple ¶
type AppMultiple struct {
// contains filtered or unexported fields
}
AppMultiple .
func (*AppMultiple) AllMessages ¶
func (am *AppMultiple) AllMessages(c context.Context) (length int, err error)
AllMessages .
func (*AppMultiple) BulkIndex ¶
func (am *AppMultiple) BulkIndex(c context.Context, start int, end int, writeEntityIndex bool) (err error)
BulkIndex .
func (*AppMultiple) IncrMessages ¶
func (am *AppMultiple) IncrMessages(c context.Context) (length int, err error)
IncrMessages .
func (*AppMultiple) InitOffset ¶
func (am *AppMultiple) InitOffset(c context.Context)
InitOffset insert init value to offset.
func (*AppMultiple) SetRecover ¶
SetRecover set recover
type AppMultipleDatabus ¶
type AppMultipleDatabus struct {
// contains filtered or unexported fields
}
AppMultipleDatabus .
func NewAppMultipleDatabus ¶
func NewAppMultipleDatabus(d *Dao, appid string) (amd *AppMultipleDatabus)
NewAppMultipleDatabus .
func (*AppMultipleDatabus) AllMessages ¶
func (amd *AppMultipleDatabus) AllMessages(c context.Context) (length int, err error)
AllMessages .
func (*AppMultipleDatabus) BulkIndex ¶
func (amd *AppMultipleDatabus) BulkIndex(c context.Context, start int, end int, writeEntityIndex bool) (err error)
BulkIndex .
func (*AppMultipleDatabus) Business ¶
func (amd *AppMultipleDatabus) Business() string
Business return business.
func (*AppMultipleDatabus) Commit ¶
func (amd *AppMultipleDatabus) Commit(c context.Context) (err error)
Commit .
func (*AppMultipleDatabus) IncrMessages ¶
func (amd *AppMultipleDatabus) IncrMessages(c context.Context) (length int, err error)
IncrMessages .
func (*AppMultipleDatabus) IndexNameSuffix ¶
func (amd *AppMultipleDatabus) IndexNameSuffix(format string, startDate string) (res []string, err error)
IndexNameSuffix .
func (*AppMultipleDatabus) InitIndex ¶
func (amd *AppMultipleDatabus) InitIndex(c context.Context)
InitIndex .
func (*AppMultipleDatabus) InitOffset ¶
func (amd *AppMultipleDatabus) InitOffset(c context.Context)
InitOffset insert init value to offset.
func (*AppMultipleDatabus) Offset ¶
func (amd *AppMultipleDatabus) Offset(c context.Context)
Offset .
func (*AppMultipleDatabus) SetRecover ¶
func (amd *AppMultipleDatabus) SetRecover(c context.Context, recoverID int64, recoverTime string, i int)
SetRecover set recover
type AppSingle ¶
type AppSingle struct {
// contains filtered or unexported fields
}
AppSingle .
func (*AppSingle) AllMessages ¶
AllMessages .
func (*AppSingle) BulkIndex ¶
func (as *AppSingle) BulkIndex(c context.Context, start int, end int, writeEntityIndex bool) (err error)
BulkIndex .
func (*AppSingle) IncrMessages ¶
IncrMessages .
func (*AppSingle) InitOffset ¶
InitOffset insert init value to offset.
func (*AppSingle) SetRecover ¶
SetRecover set recover
type Dao ¶
type Dao struct { // search db SearchDB *xsql.DB // hbase *hbase.Client BusinessPool map[string]model.BsnAppInfo AttrPool map[string]*model.Attrs AppPool map[string]App DBPool map[string]*xsql.DB ESPool map[string]*elastic.Client DatabusPool map[string]*databus.Databus InfoCPool map[string]*infoc.Infoc // contains filtered or unexported fields }
Dao .
func (*Dao) BulkDBData ¶
func (d *Dao) BulkDBData(c context.Context, attrs *model.Attrs, writeEntityIndex bool, bulkData ...model.MapData) (err error)
BulkDBData 写入es数据来自db.
func (*Dao) BulkDatabusData ¶
func (d *Dao) BulkDatabusData(c context.Context, attrs *model.Attrs, writeEntityIndex bool, bulkData ...model.MapData) (err error)
BulkDatabusData 写入es数据来自databus.
func (*Dao) CommitOffset ¶
func (d *Dao) CommitOffset(c context.Context, offset *model.LoopOffset, appid, tableName string) (err error)
CommitOffset .
func (*Dao) ExtraData ¶
func (d *Dao) ExtraData(c context.Context, mapData []model.MapData, attrs *model.Attrs, way string, tags []string) (md []model.MapData, err error)
ExtraData .
func (*Dao) GetAliases ¶
GetAliases get all aliases by indexAliasPrefix
func (*Dao) InitIndex ¶
func (d *Dao) InitIndex(c context.Context, aliases map[string]bool, esName, indexAliasName, indexEntityName, indexMapping string)
InitIndex create entity indecies & aliases if necessary
func (*Dao) InitOffset ¶
func (d *Dao) InitOffset(c context.Context, offset *model.LoopOffset, attrs *model.Attrs, arr []string)
InitOffset init offset to offset table .
func (*Dao) JSON2map ¶
func (d *Dao) JSON2map(rowJSON json.RawMessage) (result map[string]interface{}, err error)
JSON2map json to map.