dbhandler

package
v0.0.0-...-15b4a15 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect()

Connect utilizes the viper config system and connects to the specified database. Because problems in the connection are almost always fatal to the successful continuation of the server daemon, if there are problems, it logs the problem and exits the main process.

func ConnectWithString

func ConnectWithString(connString string)

func Disconnect

func Disconnect()

Disconnect shuts down the connection to the database server

func GetConnection

func GetConnection() *sql.DB

GetConnection returns a pointer to the database connection

func IsConnected

func IsConnected() bool

IsConnected returns a boolean if it has successfully connected to the Mensago server database

func IsEmpty

func IsEmpty() bool

func Reset

func Reset() error

Reset clears all database to empty tables

Types

type JSONNetworkAdapter

type JSONNetworkAdapter struct {
	Name    string
	Type    string
	DHCP    bool
	MAC     string
	IPv4    string
	Subnet  string
	Gateway string
	DNS1    string
	DNS2    string
	IPv6    string
}

Jump to

Keyboard shortcuts

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