go_package_db

package module
v0.0.0-...-b014943 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

README

go-package-db

第三方包(go-package-example) mysql 数据驱动

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DB *gorm.DB
)

Functions

func AutoMigrate

func AutoMigrate()

func Close

func Close() error

func DeleteAll

func DeleteAll() error

func Init

func Init(host, port, username, password, dbname string)

func Insert

func Insert(collect ...Collect) error

Types

type Collect

type Collect struct {
	ID       int    `json:"id" gorm:"primarykey"`
	Name     string `json:"name" gorm:"varchar(125);not null;comment:'第三方包名'"`
	Url      string `json:"url" gorm:"index:url,unique;varchar(125);not null;comment:'第三方包地址'"`
	Language string `json:"language" gorm:"varchar(125);not null;comment:'语言'"`
}

func FindAll

func FindAll() (collect []Collect, err error)

func FindByName

func FindByName(name string) (collect []Collect, err error)

func FindByUrl

func FindByUrl(url string) (collect Collect, err error)

Jump to

Keyboard shortcuts

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