db

package
v0.0.0-...-341268e Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	DBPath string
}

func (*DB) Get

func (d *DB) Get(key []byte) string

func (*DB) Put

func (d *DB) Put(key []byte, value []byte) error

type Database

type Database struct {
	DBType     string
	DBName     string
	DBUser     string
	DBPassword string
	DBPort     string
	DBHost     string
}

Database database instance modelling

func (*Database) DBConfig

func (db *Database) DBConfig() (*gorm.DB, error)

DBConfig initialises the required database based on the selected DB from the .env file

func (*Database) MySQLDBConfig

func (db *Database) MySQLDBConfig() (*gorm.DB, error)

MySQLDBConfig initialises a MySQL/MariaDB database instance. Return gorm instance and error

func (*Database) PostgreSQLConfig

func (db *Database) PostgreSQLConfig() (*gorm.DB, error)

PostgreSQLConfig initialises a PostgreSQL db instamces, returns gorm, error

Jump to

Keyboard shortcuts

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