database

package
v0.16.5 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	// contains filtered or unexported fields
}

Database is a handle to the database layer

func LoadDatabase

func LoadDatabase() (*Database, error)

LoadDatabase initialize database instance, it does not connect to the database.

func (*Database) AutoMigrate

func (db *Database) AutoMigrate(dst ...interface{}) error

func (*Database) Close

func (db *Database) Close() error

Close will close the database connection. Should be deferred right after Open.

func (*Database) CreateAccount

func (db *Database) CreateAccount(account *models.Account) error

func (*Database) Engine

func (db *Database) Engine() string

func (*Database) ListAccounts

func (db *Database) ListAccounts(accountName string, userName string) (accounts []models.Account, err error)

func (*Database) Open

func (db *Database) Open() error

Open creates a database connection. This should only be called once.

func (*Database) RemoveAccount added in v0.16.4

func (db *Database) RemoveAccount(accountName string, userName string) error

func (*Database) RetrieveFirstAccount

func (db *Database) RetrieveFirstAccount(accountName string, userName string) (account models.Account)

func (*Database) SaveAccount

func (db *Database) SaveAccount(account models.Account) error

Jump to

Keyboard shortcuts

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