dao

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetGlobal

func SetGlobal()

Types

type Client

type Client struct {
	Database string
	Host     string
	Password string
	Port     int
	SSLMode  string
	UserName string
}

Client defines all database options.

func (*Client) Connect

func (o *Client) Connect() *DAO

Connect establishes a database connection.

type DAO

type DAO struct {
	Db     *sql.DB
	Client Client
}

DAO defines a sql connection object.

var (
	GlobalDAO *DAO
)

func New

func New() *DAO

New creates a new dao object.

func (*DAO) Close

func (o *DAO) Close() (err error)

Close terminates a database connection.

func (*DAO) PurgeData

func (o *DAO) PurgeData(tables []string)

PurgeData deletes all data contained within a database table.

func (*DAO) Test

func (o *DAO) Test() (err error)

Test validates if connection is still open.

Jump to

Keyboard shortcuts

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