Documentation ¶
Index ¶
- Constants
- Variables
- type BinlogListener
- type DispatchFunc
- type Empty
- type EsCache
- type EsGetResp
- type EsUpdateResp
- type ICache
- type Msg
- type MsgType
- type PKCache
- func (c *PKCache) Del(table, pk string) (err error)
- func (c *PKCache) Dispatch(table string, f DispatchFunc)
- func (c *PKCache) Get(table, pk string) (data string, err error)
- func (c *PKCache) NewICache(ic ICache, table string)
- func (c *PKCache) Register(bl *BinlogListener)
- func (c *PKCache) Set(table, pk, data string) (err error)
- func (c *PKCache) Update(table, pk string) (err error)
- type RedisCache
- type TableSchema
Constants ¶
View Source
const ( EsCreated = "created" EsUpdated = "updated" EsDeleted = "deleted" )
View Source
const BufferSize int = 256 // experiential
View Source
const DefaultInternal = 30 * time.Second
View Source
const MaxQueueLen int = 64 // experiential
View Source
const OneYear = 24 * 365 * time.Hour
View Source
const SearchTimeOut = "请求搜索超时"
Variables ¶
View Source
var ErrNil = errors.New("err: Nil Cache")
Functions ¶
This section is empty.
Types ¶
type BinlogListener ¶
type BinlogListener struct {
// contains filtered or unexported fields
}
Listener to and parse binlog
func InitBinlogListener ¶
func (*BinlogListener) Loop ¶
func (bl *BinlogListener) Loop()
func (*BinlogListener) Pub ¶
func (bl *BinlogListener) Pub(msg Msg)
func (*BinlogListener) Subscribe ¶
func (bl *BinlogListener) Subscribe(ch chan Msg)
type DispatchFunc ¶
type EsGetResp ¶
type EsGetResp struct { Id string `json:"_id"` Found bool `json:"found"` Source interface{} `json:"_source"` }
GET
{ "_index": "warehouse", "_type": "order", "_id": "43020156", "found": false }
type EsUpdateResp ¶
type PKCache ¶
type PKCache struct {
// contains filtered or unexported fields
}
schema.table.PK -> data
func InitPKCache ¶
func InitPKCache(schema string, bl *BinlogListener) *PKCache
func (*PKCache) Dispatch ¶
func (c *PKCache) Dispatch(table string, f DispatchFunc)
func (*PKCache) Register ¶
func (c *PKCache) Register(bl *BinlogListener)
type RedisCache ¶
type RedisCache struct {
// contains filtered or unexported fields
}
func NewRedisKV ¶
func (*RedisCache) Del ¶
func (r *RedisCache) Del(key string) (err error)
func (*RedisCache) K ¶
func (r *RedisCache) K(key string) string
func (*RedisCache) Set ¶
func (r *RedisCache) Set(key, value string) error
type TableSchema ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.