dbEdge

package
v1.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2022 License: MIT Imports: 5 Imported by: 0

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

func CloseDB

func CloseDB() error

func DeleteReceiveMessageByID

func DeleteReceiveMessageByID(id string) error

func InitDB

func InitDB(sqlitePath string) error

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL