historica

package module
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2021 License: BSD-3-Clause Imports: 3 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 {
	ID      int
	Name    string
	Explain string
	Reverse bool
}

type AssetRecord

type AssetRecord struct {
	IID   int
	Value float64
}

type Book

type Book struct {
	Name string
	// contains filtered or unexported fields
}

func NewBook

func NewBook(name, dbpath string) (*Book, error)

func (*Book) AddTransactionInventoryRecord

func (b *Book) AddTransactionInventoryRecord(tid int, value AssetRecord) error

func (*Book) AddTransactionRecord

func (b *Book) AddTransactionRecord(tid int, value Record) error

func (*Book) DeleteAccount

func (b *Book) DeleteAccount(tid int) error

func (*Book) DeleteInventory

func (b *Book) DeleteInventory(tid int) error

func (*Book) DeleteTag

func (b *Book) DeleteTag(tid int) error

func (*Book) DeleteTransaction

func (b *Book) DeleteTransaction(tid int) error

func (*Book) DeleteTransactionInventoryRecord

func (b *Book) DeleteTransactionInventoryRecord(tid int, iid int) error

func (*Book) DeleteTransactionRecord

func (b *Book) DeleteTransactionRecord(tid int, aid int) error

func (*Book) GetAccountByID

func (b *Book) GetAccountByID(id int) (Account, error)

func (*Book) GetAccountByName

func (b *Book) GetAccountByName(name string) (Account, error)

func (*Book) GetAccountByTagID

func (b *Book) GetAccountByTagID(id int) ([]Account, error)

func (*Book) GetInventoryByID

func (b *Book) GetInventoryByID(id int) (Inventory, error)

func (*Book) GetInventoryByName

func (b *Book) GetInventoryByName(name string) (Inventory, error)

func (*Book) GetInventoryByTagID

func (b *Book) GetInventoryByTagID(id int) ([]Inventory, error)

func (*Book) GetTagByID

func (b *Book) GetTagByID(id int) (Tag, error)

func (*Book) GetTagByName

func (b *Book) GetTagByName(name string) (Tag, error)

func (*Book) GetTagOfAccountID

func (b *Book) GetTagOfAccountID(id int) ([]Tag, error)

func (*Book) GetTagOfInventoryID

func (b *Book) GetTagOfInventoryID(id int) ([]Tag, error)

func (*Book) GetTransactionByID

func (b *Book) GetTransactionByID(id int) (Transaction, error)

func (*Book) GetTransactionByTagID

func (b *Book) GetTransactionByTagID(id int) ([]Transaction, error)

func (*Book) GetTransactionWithinDuration

func (b *Book) GetTransactionWithinDuration(start, end time.Time) ([]Transaction, error)

func (*Book) NewAccount

func (b *Book) NewAccount(account Account) (int, error)

func (*Book) NewInventory

func (b *Book) NewInventory(inventory Inventory) (int, error)

func (*Book) NewTag

func (b *Book) NewTag(tag Tag) (int, error)

func (*Book) NewTransaction

func (b *Book) NewTransaction(TX Transaction, time *time.Time) (int, error)

func (*Book) SearchAccountByName

func (b *Book) SearchAccountByName(name string) ([]Account, error)

func (*Book) SearchAccountByPrefix

func (b *Book) SearchAccountByPrefix(prefix string) ([]Account, error)

func (*Book) SearchInventoryByName

func (b *Book) SearchInventoryByName(name string) ([]Inventory, error)

func (*Book) SearchInventoryByPrefix

func (b *Book) SearchInventoryByPrefix(prefix string) ([]Inventory, error)

func (*Book) SearchTagByName

func (b *Book) SearchTagByName(name string) ([]Tag, error)

func (*Book) SearchTagByPrefix

func (b *Book) SearchTagByPrefix(prefix string) ([]Tag, error)

func (*Book) SetAccount

func (b *Book) SetAccount(tid int, value Account) error

func (*Book) SetInventory

func (b *Book) SetInventory(tid int, value Inventory) error

func (*Book) SetTag

func (b *Book) SetTag(tid int, value Tag) error

func (*Book) SetTransactionInfo

func (b *Book) SetTransactionInfo(tid int, value Transaction) error

type Inventory

type Inventory struct {
	ID      int
	Name    string
	Explain string
	Tags    []*Tag
}

type Record

type Record struct {
	AID   int
	Value float64
}

type Tag

type Tag struct {
	ID      int
	Name    string
	Explain string
}

type Transaction

type Transaction struct {
	ID      int
	Explain string
	UTCTIme time.Time
	Tags    []*Tag

	From []Record
	To   []Record

	StockChange []AssetRecord
}

Jump to

Keyboard shortcuts

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