database

package
v0.0.0-...-f2b64ca Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDBConnection

func NewDBConnection(c *DBConfig) (*gorm.DB, error)

NewDBConnection returns a DB object based on config provided

Types

type DBConfig

type DBConfig struct {
	Type     DBType
	Path     string
	Username string
	Password string
	Host     string
	Port     int
	DBName   string
}

DBConfig is the config used to start a DB connection

type DBType

type DBType int

DBType is just a renamed int

const (
	SQLITE DBType = iota
	MYSQL
)

DBType constants

func ConvertToDBType

func ConvertToDBType(input string) DBType

ConvertToDBType convert a input string to DBType

Jump to

Keyboard shortcuts

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