bank

package
v0.0.0-...-6165795 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2015 License: MIT 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 {
	Number    AccountID
	PIN       PIN
	Balance   float32
	Assets    map[exchange.Symbol]uint64
	Suspended bool
	Tapped    bool
}

type AccountID

type AccountID uint64
const (
	BA_Admin AccountID = math.MaxUint64 - iota
	BA_Feds
	BA_Start
)

type Bank

type Bank interface {
	Open() Token
	PIN(Token, PIN) Error
	Balance(Token) (float32, Error)
	Transfer(Token, float32, AccountID) Error

	SetAsset(AccountID, exchange.Symbol, uint64)
	GetAssets(Token) (map[exchange.Symbol]uint64, Error)
	TransferAsset(Token, exchange.Symbol, uint64, AccountID) Error // Move [3] shares of [2] from [1] to [4]

	Freeze(AccountID)
	Thaw(AccountID)
}

type Error

type Error uint
const (
	BE_OK Error = iota
	BE_EMPTY
	BE_FROZEN
	BE_NOACCT
	BE_BADPIN
)

type PIN

type PIN []int

func (PIN) Compare

func (p PIN) Compare(other PIN) bool

type TapID

type TapID uint

type Token

type Token struct {
	Account AccountID
	PIN     PIN
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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