ledger

package
v0.0.0-...-c46f14b Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2023 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(e *engine.Engine)

Types

type Entry

type Entry struct {
	ID        uuid.UUID
	LedgerID  uuid.UUID `storm:"index"`
	Action    string
	Amount    int64
	CreatedAt int64 `storm:"index"`
}

type Ledger

type Ledger struct {
	ID       uuid.UUID `storm:"index"`
	PlayerID uuid.UUID `storm:"index"`
	Name     string    `storm:"index"`
	Type     string    `storm:"index"`
	Currency string
}

func CreateLedger

func CreateLedger(e *engine.Engine, l *Ledger) (*Ledger, error)

func GetLedger

func GetLedger(e *engine.Engine, l *Ledger) (*Ledger, error)

func GetOrCreateLedger

func GetOrCreateLedger(e *engine.Engine, l *Ledger) (*Ledger, error)

func (*Ledger) Credit

func (l *Ledger) Credit(e *engine.Engine, amount int64) error

func (*Ledger) Debit

func (l *Ledger) Debit(e *engine.Engine, amount int64) error

Jump to

Keyboard shortcuts

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