Versions in this module Expand all Collapse all v0 v0.0.1 Dec 4, 2021 Changes in this version + func NewDB(c *Cnf) (*gorm.DB, error) + type Cnf struct + CatchN int64 + CatchT tex.JsDuration + CursorTbl string + ID string + LogGorm bool + MySQLDsn *gormx.Dsn + N int + SubmitRetryNum int + Tick tex.JsDuration + TopicTbl string + func LoadCnf(fName string) (*Cnf, error) + func (c *Cnf) Normalize() error + type Consumer struct + func NewConsumer(cnf *Cnf, mh MsgHandler, eh *ErrHandler) (*Consumer, error) + func (c *Consumer) ExitSignal() <-chan struct{} + func (c *Consumer) Start() + func (c *Consumer) Stop() + func (c *Consumer) Wait() + type Cursor struct + ClientID string + ConsumedID int64 + UpdatedAt time.Time + type ErrDo interface + HandleErr func(err error) + type ErrHandler struct + MsgErrHandler ErrDo + ReadErrHandler ErrDo + SubmitErrHandler ErrDo + type Hooker interface + Msg func() interface{} + Save func() func(*gorm.DB) error + type IDW struct + ID int64 + type Msg struct + CreatedAt time.Time + Data []byte + ID int64 + P Protocol + type MsgHandler interface + Do func(msg *Msg) error + type Producer struct + func NewProducer(db *gorm.DB, tbl string) (*Producer, error) + func (p *Producer) WriteHook(db *gorm.DB, h Hooker) error + func (p *Producer) WriteHookMsgP(db *gorm.DB, fn func(db *gorm.DB) error, msg interface{}) error + type Protocol int32 + const MsgPack + func (p Protocol) String() string