database

package
v0.0.0-...-ba02ff9 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host       string `yaml:"host"`
	Port       int    `yaml:"port"`
	Username   string `yaml:"username"`
	Password   string `yaml:"password"`
	Database   string `yaml:"database"`
	MaxRetries int    `yaml:"max_retries"`
	LogMode    bool   `yaml:"log_sql"`
}

type Connection

type Connection struct {
	// contains filtered or unexported fields
}

func NewConnection

func NewConnection(config Config) (conn *Connection, err error)

func (*Connection) Close

func (c *Connection) Close() error

func (*Connection) Db

func (c *Connection) Db() (*gorm.DB, error)

func (*Connection) Migrate

func (c *Connection) Migrate(models ...interface{}) error

Jump to

Keyboard shortcuts

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