portfolio

package
v0.0.0-...-9b4e82f Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2019 License: MIT Imports: 15 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Portfolios = make(map[string]*Portfolio)
View Source
var PortfoliosLock = lock.NewLock("portfolios")

Functions

func DeletePortfolio

func DeletePortfolio(uuid string)

func UpdateAll

func UpdateAll()

Types

type Portfolio

type Portfolio struct {
	objects.Portfolio
	//keeps track of how much $$$ they own, used for some slight optomization on calc networth
	// stock_uuid -> ledgerObject
	UpdateChannel *duplicator.ChannelDuplicator `json:"-"`
	UpdateInput   *duplicator.ChannelDuplicator `json:"-"`
	Lock          *lock.Lock                    `json:"-"`
	// contains filtered or unexported fields
}

* Portfolios are the $$$ part of a user

func GetAllPortfolios

func GetAllPortfolios() []*Portfolio

func GetPortfolio

func GetPortfolio(userUUID string) (*Portfolio, error)

func MakePortfolio

func MakePortfolio(portfolio objects.Portfolio, lockAquired bool) (*Portfolio, error)

func NewPortfolio

func NewPortfolio(portfolioUuid, userUuid string) (*Portfolio, error)

func (*Portfolio) LevelUp

func (port *Portfolio) LevelUp() error

func (*Portfolio) RegisterUpdate

func (port *Portfolio) RegisterUpdate(newInput chan interface{})

func (*Portfolio) Update

func (port *Portfolio) Update()

Jump to

Keyboard shortcuts

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