db

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMySQL

func NewMySQL(opts *MySQLOptions) (*gorm.DB, error)

NewMySQL create a new gorm db instance with the given options.

Types

type MySQLOptions

type MySQLOptions struct {
	Host     string `mapstructure:"host" json:"host" yaml:"host"`
	Username string `mapstructure:"username" json:"username" yaml:"username"`
	Password string `mapstructure:"password" json:"-" yaml:"password"`
	Database string `mapstructure:"database" json:"database" yaml:"database"`
}

MySQLOptions defines options for mysql database.

func (*MySQLOptions) DSN

func (o *MySQLOptions) DSN() string

DSN returns mysql dsn.

Jump to

Keyboard shortcuts

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