Versions in this module Expand all Collapse all v1 v1.0.0 Dec 30, 2020 Changes in this version + const InvalidAvailable + const InvalidUnavailable + func FormatConsumeConfigListForMap(consumeConfigList []ConsumeConfig) map[int]ConsumeConfig + func IsErrRecordNotFound(err error) bool + func NewDB(host, port, username, password, dbname string) + type ConsumeConfig struct + Channel string + Consumer *nsq.Consumer + CreatedAt time.Time + Description string + HandleNum int + Id int + Invalid int + IsRequeue bool + MaxInFlight int + MonitorThreshold int + Owner string + ServerList []ConsumeServerMap + TimeoutDial time.Duration + TimeoutRead time.Duration + TimeoutWrite time.Duration + Topic string + UpdatedAt time.Time + func GetAvailableConsumeList() ([]ConsumeConfig, error) + func (ConsumeConfig) CreateTable() error + func (ConsumeConfig) TableName() string + func (c *ConsumeConfig) Create() (int, error) + func (c *ConsumeConfig) Delete() (int64, error) + func (c *ConsumeConfig) Get() (int64, error) + func (c *ConsumeConfig) GetConsumerUniqueId() [16]byte + func (c *ConsumeConfig) Page(topic string, page int) (PageResult, error) + func (c *ConsumeConfig) SetConsumerUniqueId(consumerUniqueId [16]byte) + func (c *ConsumeConfig) SetStatusClosed() + func (c *ConsumeConfig) SetStatusFailed() + func (c *ConsumeConfig) SetStatusSuccess() + func (c *ConsumeConfig) SetStatusWait() + func (c *ConsumeConfig) Update() (int64, error) + func (c *ConsumeConfig) WorkList() error + func (c ConsumeConfig) GetStatus() int32 + func (c ConsumeConfig) IsEqual(newConsume ConsumeConfig) bool + func (c ConsumeConfig) StatusIsClose() bool + func (c ConsumeConfig) StatusIsSuccess() bool + type ConsumeServerMap struct + Consumeid int + CreatedAt time.Time + Id int + Invalid int + Serverid int + UpdatedAt time.Time + Weight int + WorkServer WorkServer + func (ConsumeServerMap) CreateTable() error + func (ConsumeServerMap) TableName() string + func (m *ConsumeServerMap) AllByConsumeid(consumeid int) ([]ConsumeServerMap, error) + func (m *ConsumeServerMap) Create() (int, error) + func (m *ConsumeServerMap) Delete() (int64, error) + func (m *ConsumeServerMap) Get() (int64, error) + func (m *ConsumeServerMap) Update() (int64, error) + func (m ConsumeServerMap) IsEqual(newMap ConsumeServerMap) bool + type PageResult struct + Page int + Result interface{} + Total int64 + type WorkServer struct + Addr string + CreatedAt time.Time + Description string + Extra string + Id int + Invalid int + Owner string + Protocol string + UpdatedAt time.Time + func (WorkServer) CreateTable() error + func (WorkServer) TableName() string + func (w *WorkServer) All() ([]WorkServer, error) + func (w *WorkServer) Create() (int, error) + func (w *WorkServer) Delete() (int64, error) + func (w *WorkServer) Get() (int64, error) + func (w *WorkServer) Page(page int) (PageResult, error) + func (w *WorkServer) SetStatusAvailable() + func (w *WorkServer) SetStatusUnAvailable() + func (w *WorkServer) Update() (int64, error) + func (w WorkServer) GetStatus() + func (w WorkServer) IsEqual(newWork WorkServer) bool