db

package
v0.0.0-...-49bf833 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package db provides useful functions to create mysql instance

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMySql

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

Types

type MySQLOptions

type MySQLOptions struct {
	Host                  string
	Username              string
	Password              string
	Database              string
	MaxIdleConnections    int
	MaxOpenConnections    int
	MaxConnectionLifeTime time.Duration
	LogLevel              int
}

MySQLOptions defines the options for connecting to MySQL

func (*MySQLOptions) DSN

func (o *MySQLOptions) DSN() string

Jump to

Keyboard shortcuts

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