Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // MaxIdleConn is set the maximum number of connections in the idle connection pool MaxIdleConn = 10 // MaxOpenConn is set the maximum number of open connections to the database MaxOpenConn = 100 // ConnMaxLifetime is set the maximum amount of time a connection maybe reused ConnMaxLifetime = time.Hour )
View Source
var (
DB *gorm.DB
)
View Source
var (
DefaultLimit = 50
)
Functions ¶
Types ¶
type ReceiveMessage ¶
type ReceiveMessage struct { ID string `json:"id" gorm:"primaryKey"` Data string `json:"data"` CommitStatus int `json:"commit_status" gorm:"column:commit_status;default: 0"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` }
func GetUnConsumeReceiveMessage ¶
func GetUnConsumeReceiveMessage(limit int) ([]*ReceiveMessage, error)
func (*ReceiveMessage) Create ¶
func (r *ReceiveMessage) Create() error
func (*ReceiveMessage) IsConsume ¶
func (r *ReceiveMessage) IsConsume() (bool, error)
func (*ReceiveMessage) TableName ¶
func (r *ReceiveMessage) TableName() string
func (*ReceiveMessage) Update ¶
func (r *ReceiveMessage) Update() error
Click to show internal directories.
Click to hide internal directories.