db

package
v0.0.0-...-66d189e Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ClientID string `json:"clientID,omitempty"`
	Name     string
	Money    int
}

type DB

type DB struct {
	*db.EncryptedDB
}

func New

func New(dbFilePath string) (*DB, error)

func (*DB) CreateAccount

func (db *DB) CreateAccount(account Account, clientID string) error

CreateAccount creates a new account in the database. clientID is the ID of the client that the account belongs to.

func (*DB) GetAccounts

func (db *DB) GetAccounts(clientID string) ([]Account, error)

GetAccounts returns all accounts of the given client.

func (*DB) GetGlobalMoney

func (db *DB) GetGlobalMoney() (int, error)

GetGlobalMoney returns the sum of all money in the database.

Jump to

Keyboard shortcuts

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