util

package
v0.0.0-...-7607688 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fatalf

func Fatalf(args ...any)

func GetPackageName

func GetPackageName(path string) string

func GetProjRootDir

func GetProjRootDir() (string, error)

GetProjRootDir 获取项目根目录

func GetTempText

func GetTempText(tmpl string, fields any) (string, error)

func MD5

func MD5(str string) string

Types

type Db

type Db interface {
	GetTables() ([]*Table, error)
}

func ConnectDb

func ConnectDb(dbType, link string) (Db, error)

func NewMysql

func NewMysql(link string) (Db, error)

type Field

type Field struct {
	Name string `json:"name"`
	Type string `json:"type"`
	Desc string `json:"desc"`
}

type Mysql

type Mysql struct {
	*gorm.DB
}

func (*Mysql) GetTables

func (s *Mysql) GetTables() ([]*Table, error)

type Table

type Table struct {
	Name   string   `json:"name"`
	Desc   string   `json:"desc"`
	Fields []*Field `json:"fields"`
}

Jump to

Keyboard shortcuts

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