model

package
v0.0.0-...-730ab85 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HostUri = "%s:%s@(%s:%d)/%s?charset=%s&parseTime=True&loc=Local"
)

Variables

View Source
var (
	DB *gorm.DB
)

Functions

func Init

func Init(option *Options) (err error)

Types

type Callback

type Callback struct{}

func (Callback) Print

func (callback Callback) Print(values ...interface{})

用来写入日志

type Option

type Option func(*Options)

func Charset

func Charset(charset string) Option

func Database

func Database(database string) Option

func Driver

func Driver(driver string) Option

func Host

func Host(host string) Option

func Password

func Password(password string) Option

func Port

func Port(port int) Option

func Prefix

func Prefix(prefix string) Option

func Username

func Username(username string) Option

type Options

type Options struct {
	Driver   string
	Host     string
	Port     int
	Database string
	Username string
	Password string
	Charset  string
	Prefix   string
	DbFile   string
}

func NewOptions

func NewOptions(opts ...Option) Options

Jump to

Keyboard shortcuts

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