database

package
v0.0.0-...-be85cab Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2017 License: GPL-3.0 Imports: 8 Imported by: 1

Documentation

Overview

Cadmium - multiprotocol crossplatform messenger. Copyright (c) 2017, Stanislav N aka pztrn. Copyright (c) 2017, Cadmium developers and contributors.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Cadmium - multiprotocol crossplatform messenger. Copyright (c) 2017, Stanislav N aka pztrn. Copyright (c) 2017, Cadmium developers and contributors.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Cadmium - multiprotocol crossplatform messenger. Copyright (c) 2017, Stanislav N aka pztrn. Copyright (c) 2017, Cadmium developers and contributors.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cc *context.Context)

Types

type Database

type Database struct {
	// Opened database.
	Db *sqlx.DB
}

Database gives access to database for whole application. It can be used to store configuration, history logs, etc.

func (*Database) GetDatabase

func (d *Database) GetDatabase() *sqlx.DB

GetDatabase returns pointer to database.

func (*Database) Initialize

func (d *Database) Initialize()

Initialize initializes database connection.

func (*Database) Migrate

func (d *Database) Migrate()

Migrate launches database migration to latest version.

type DatabaseHandler

type DatabaseHandler struct{}

DatabaseHandler provides handler for DatabaseInterface. It launching real functions from Database struct.

func (DatabaseHandler) GetDatabase

func (dh DatabaseHandler) GetDatabase() *sqlx.DB

func (DatabaseHandler) Initialize

func (dh DatabaseHandler) Initialize()

func (DatabaseHandler) Migrate

func (dh DatabaseHandler) Migrate()

Directories

Path Synopsis
Cadmium - multiprotocol crossplatform messenger.
Cadmium - multiprotocol crossplatform messenger.
Cadmium - multiprotocol crossplatform messenger.
Cadmium - multiprotocol crossplatform messenger.

Jump to

Keyboard shortcuts

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