db

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: May 9, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCreateTableSQL

func GetCreateTableSQL(dbType string) string

func GetModuleId

func GetModuleId(db *sql.DB, SvcName, SvcGroup string) (int, error)

Types

type CSVAssign

type CSVAssign struct {
	SvcName         string
	SvcGroup        string
	PortInterval    int
	ErrcodeInterval int
	PortInitMap     map[string]int
	ErrcodeInitMap  map[string]int
	// contains filtered or unexported fields
}

func (*CSVAssign) Close

func (a *CSVAssign) Close()

func (*CSVAssign) GetModuleID

func (a *CSVAssign) GetModuleID() (int, error)

func (*CSVAssign) GetOrAssignPortAndErrcode

func (a *CSVAssign) GetOrAssignPortAndErrcode(port, errCode *int) error

type DBAssign

type DBAssign struct {
	DBURI           string
	SvcName         string
	SvcGroup        string
	PortInterval    int
	ErrcodeInterval int
	PortInitMap     map[string]int
	ErrcodeInitMap  map[string]int
	// contains filtered or unexported fields
}

func (*DBAssign) Close

func (a *DBAssign) Close()

func (*DBAssign) GetModuleID

func (a *DBAssign) GetModuleID() (int, error)

func (*DBAssign) GetOrAssignPortAndErrcode

func (a *DBAssign) GetOrAssignPortAndErrcode(port, errCode *int) error

type IDispatcher

type IDispatcher interface {
	GetOrAssignPortAndErrcode(port, errCode *int) error
	GetModuleID() (int, error)

	Close()
}

func GetDispatcher

func GetDispatcher(svcName, svcGroup string, cfg *config.Config) (IDispatcher, error)

func NewCSVAssign

func NewCSVAssign(svcName, svcGroup string, cfg *config.Config) (IDispatcher, error)

func NewDBAssign

func NewDBAssign(svcName, svcGroup string, cfg *config.Config) (IDispatcher, error)

type ModelServiceConfig

type ModelServiceConfig struct {
	Id           uint32 `gorm:"comment:主键;primarykey"`
	CreatedAt    uint32 `gorm:"comment:创建时间"`
	UpdatedAt    uint32 `gorm:"comment:更新时间"`
	DeletedAt    uint32 `gorm:"comment:删除时间"`
	ServiceName  string `gorm:"comment:服务名称;type:varchar(50)"`
	ServiceGroup string `gorm:"comment:服务分组;type:varchar(50)"`
	StartPort    uint32 `gorm:"comment:起始端口;type:int;default:0"`
	StartErrCode uint32 `gorm:"comment:起始错误码;type:int;default:0"`
}

Jump to

Keyboard shortcuts

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